From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD879C433DB for ; Wed, 20 Jan 2021 17:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D7AB221EC for ; Wed, 20 Jan 2021 17:46:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D7AB221EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6DF66E3F9; Wed, 20 Jan 2021 17:46:38 +0000 (UTC) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by gabe.freedesktop.org (Postfix) with ESMTPS id E4E846E3F9 for ; Wed, 20 Jan 2021 17:46:37 +0000 (UTC) Received: by mail-qk1-x736.google.com with SMTP id b64so26107674qkc.12 for ; Wed, 20 Jan 2021 09:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5GEUEQI5DAgZL9yeWXJcqyV6E8eY6Pn16y7xDglJjVc=; b=EmYRFK6gKNsc07ptAaax49EUGzffGg/Qfg4OtRWYs25fuzz7LJvnJMTD4JZuATOtvE j7/gabl2W8mvEMlPpAVEVjxxtoDWc+IzgO7LRdRWYc64/36IAl+/tFz02oYHadH4iwth kpnJ8Izz5QlsROc2UAXYCd4flXPsrtweyWj32rY8JJaHyElP9c3UbRqZGwwMVCjuXLej UyxqmTJuo8IZVRmQHWLlNkl9bcnvZ9fO6XQL0aCBOqp1mypIPFupVkAxDAG0hOgP1rcL nHP9sXx2wvKCdaNpeurRvyAZZkJ4zymF77KIGeImnQqaZp+uEA8q2C7Q/hmnDrVUAknJ AKYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5GEUEQI5DAgZL9yeWXJcqyV6E8eY6Pn16y7xDglJjVc=; b=leM97dEAUYxeciuDFtrz3+mY2VnZ9Cauqy9hGSTRvXrRijRlA1/FQEkeeWyQtC/JHj g0jTtMvLIBig/uN86GvIt8ThdIq7XYZc0ZJMR77yheQNda7VyVlsD9tmkqOSXe2gOWs1 yJHcm4V39HcFezLnD/GhIkwVo1Di50x6pQI7TPC6i9zeg4EqXctpcZFfAGDzVzlY48Ue 5oGW/PVnO9KLkLbHmvaeYwpQmmB2au3yqQ9j9OMp+h/EkmHzQiNjnO0M1kA+oZS5Y7+d RjhmoztUsKBfGrPSmH324cyH+we5IaZBu/JKZr1OI0dtFvU2HmH8EOJ5oellE+IaST8q MetQ== X-Gm-Message-State: AOAM530Wxh9aJijpWZCOTt0C744gRzKzL79drcqLlch363MGjbkZCMCv 2NryiE69U1pki7S27cNuhBX2t/pw9dkxWUi6rj0= X-Google-Smtp-Source: ABdhPJzl3CuItPC25ABnRviIJglFAZ+oGtSQoGbriVHke5sEuLTzJ8UJBFBNnEMiOLDeXdssbt/YzqvccXwsCaA9Fvc= X-Received: by 2002:a05:620a:12fa:: with SMTP id f26mr6365154qkl.327.1611164797043; Wed, 20 Jan 2021 09:46:37 -0800 (PST) MIME-Version: 1.0 References: <20210120154019.5146-1-chris@chris-wilson.co.uk> In-Reply-To: <20210120154019.5146-1-chris@chris-wilson.co.uk> From: Matthew Auld Date: Wed, 20 Jan 2021 17:46:10 +0000 Message-ID: To: Chris Wilson Subject: Re: [Intel-gfx] [PATCH] drm/i915/gem: Allow importing of shmemfs objects into any device X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , Matthew Auld Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 20 Jan 2021 at 15:40, Chris Wilson wrote: > > If we import a shmemfs object between devices, for example from > Tigerlake to DG1, we can simply reuse the native object and its backing > store. Hmmm interesting, so does that include re-using the actual sg mapping for the backing pages? Does that work out-of-the-box between different devices assuming we have iommu enabled? > > Suggested-by: Imre Deak > Signed-off-by: Chris Wilson > Cc: Matthew Auld > Cc: Imre Deak > --- > drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c > index 04e9c04545ad..4816f08c4009 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c > @@ -242,6 +242,13 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev, > */ > return &i915_gem_object_get(obj)->base; > } > + > + /* > + * If the object is in plain system memory, we can reuse the > + * same backing store in any device. > + */ > + if (i915_gem_object_is_shmem(obj)) > + return &i915_gem_object_get(obj)->base; > } > > /* need to attach */ > -- > 2.20.1 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx