Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp626530ybc; Fri, 22 Nov 2019 10:25:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzslPOfEE/xMd4r9JGRlHJfNB2DQfD6g2MVx3pcqWWDAn1Tnzx9ZR2iqPzpIZl37aEjjYSW X-Received: by 2002:a05:6402:158d:: with SMTP id c13mr2819894edv.62.1574447147944; Fri, 22 Nov 2019 10:25:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574447147; cv=none; d=google.com; s=arc-20160816; b=wwECxCtnyg5GILWopCKghb33KfJ/3rLrNgnt628MeFzaNPtFRLzo2sl+QLNAqqdrDx z+XIHazVxq/g7yBCaLY2AFEj02ScwZCikkxpSBvEy893MSt1EK+4wNfceHW+HiBtJdBx wfDbGmhLJLPuCHkuUn4034wD24Akx/6muS0FZ5ooFp1DmBeDs5Hh7DNS6Xcsj7W4qOBY Bfb8vJlNJJLlghGQq6qUKvleiKBUHZNzbD4nFvgfCJYVxr1xq/rTgiVodhqe/ILuanKo u104CNuoAYjP2sWIgpWn/zXSWGo2ky5jLBurxVhe4sZgeQ1LXCjQ9RkgosTL5LEHGZcq yo7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dBF8KOuIYHgX5AQUGnNEqK7fiaxXdl5FhJB4ieLAIBQ=; b=XH+DlmqjXGDmqIZrhpeDyROaZoc65L0J0PvtjbsrbHtEwA0eDfCP+fB3Qbh+Hq3/B+ yWvl7WQWi+6wLEhk5kWvOHzeLg7SHQvyTELYr+RQjtg5l/RyaCv9KFTWDxXl2nJf2vXN W/KR+sQcHVRJG9WzhBviEvCGjM2Xbae/Pu/i9o9tDplRvXxcuVWS8l41SUcdpT669SfG VCBT3eW/W6j9HDOzqa+3a7UbBXPeRllWPH1G3uxoFsvZUwppHVabT4ntycn0NgVSjXxt ekxTH7OfiBa1mYMMOPzKTqLlyRsQjrdsk6KYoDK8YmtmA0yUldFH9twmwRRFkcH9UUqa 4yEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cbK8yhq2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jo16si1619963ejb.247.2019.11.22.10.25.24; Fri, 22 Nov 2019 10:25:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cbK8yhq2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbfKVSVt (ORCPT + 99 others); Fri, 22 Nov 2019 13:21:49 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:32859 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbfKVSVt (ORCPT ); Fri, 22 Nov 2019 13:21:49 -0500 Received: by mail-wr1-f65.google.com with SMTP id w9so9803957wrr.0 for ; Fri, 22 Nov 2019 10:21:46 -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=dBF8KOuIYHgX5AQUGnNEqK7fiaxXdl5FhJB4ieLAIBQ=; b=cbK8yhq2kYP64/yIWyLjHR86Bm3hT1aLiBeXnIQCzYeAFUjICgmjDE/+xLcEVuwLur Ra+nrFRsMC7eQNxqrNOW/ye6me9w8AN2fs9Ol1t2CI3debIBu3cOwcFns6VKW7hv1w6T I0EKwsXSeXLtljibE347FywhcNQZn5dnS8ZdMSgNIiqCpUlghNQshb5momZR8sqsFmVP CSolsQnF66shqbenrz4kRJoJBhOOhl2zMpB7o33pZ/HplyWDm4NR1lOTj/S/jzXNNaRT ubZ+tVys888vjIUDnYcEr6IlkcqAG1zcbkP3HdskGSbHagjf3R1FMIpp9eOMmFopAxzy CT3g== 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=dBF8KOuIYHgX5AQUGnNEqK7fiaxXdl5FhJB4ieLAIBQ=; b=ozQ6ctQst3Q8XeToxIJnR4dloWn7S+/EOscxGkEyrz4hGmqtoIEQQhcY1p6OtjdPk+ 5ZdgmfpDf0gCt3iyRMmA2tl++URmNvNGmeTnJwjIYr7U/PXeBI6qkoYCUF2QbDSksBFL nxovfoJEi91L9KZHBUXcD8/TJ/ypYl502ObYngSkBMHY3gt9qEFAGgeOnU3TKf9g0vSv lYNnGpGm4Wc5v4QEaYhE3J++cJqjyknf4B5LXcebliEtHgKn9DFkXI7cnYx3LCWgqkSG EleHXuuxoRL/ziSfd5dv7HBuGoMYpYY0rwIK5c7FsrAOIsfR0X4rqGB6QiFRTS5ile1E DTAw== X-Gm-Message-State: APjAAAU6mi27jteLWgzc7E0wvSgEHzdymOZv7QYyVwUKI/dyX/5k6jX1 wdOvtDZMZlkeIWflCNnKFe4Teu+bdMsi2OUN3poIwA== X-Received: by 2002:adf:f54c:: with SMTP id j12mr1076502wrp.40.1574446905504; Fri, 22 Nov 2019 10:21:45 -0800 (PST) MIME-Version: 1.0 References: <20191122063749.27113-1-kraxel@redhat.com> <20191122063749.27113-3-kraxel@redhat.com> In-Reply-To: From: Alex Deucher Date: Fri, 22 Nov 2019 13:21:33 -0500 Message-ID: Subject: Re: [PATCH v2 2/2] drm: share address space for dma bufs To: Daniel Vetter Cc: Gerd Hoffmann , "open list:RADEON and AMDGPU DRM DRIVERS" , David Airlie , intel-gfx , open list , dri-devel , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 22, 2019 at 4:17 AM Daniel Vetter wrote: > > On Fri, Nov 22, 2019 at 7:37 AM Gerd Hoffmann wrote: > > > > Use the shared address space of the drm device (see drm_open() in > > drm_file.c) for dma-bufs too. That removes a difference betweem drm > > device mmap vmas and dma-buf mmap vmas and fixes corner cases like > > dropping ptes (using madvise(DONTNEED) for example) not working > > properly. > > > > Also remove amdgpu driver's private dmabuf update. It is not needed > > any more now that we are doing this for everybody. > > > > Signed-off-by: Gerd Hoffmann > > Reviewed-by: Daniel Vetter > > But I think you want at least an ack from amd guys for double checking here. > -Daniel Looks correct to me. Reviewed-by: Alex Deucher > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 4 +--- > > drivers/gpu/drm/drm_prime.c | 4 +++- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c > > index d5bcdfefbad6..586db4fb46bd 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c > > @@ -361,10 +361,8 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_gem_object *gobj, > > return ERR_PTR(-EPERM); > > > > buf = drm_gem_prime_export(gobj, flags); > > - if (!IS_ERR(buf)) { > > - buf->file->f_mapping = gobj->dev->anon_inode->i_mapping; > > + if (!IS_ERR(buf)) > > buf->ops = &amdgpu_dmabuf_ops; > > - } > > > > return buf; > > } > > diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c > > index a9633bd241bb..c3fc341453c0 100644 > > --- a/drivers/gpu/drm/drm_prime.c > > +++ b/drivers/gpu/drm/drm_prime.c > > @@ -240,6 +240,7 @@ void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv) > > struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev, > > struct dma_buf_export_info *exp_info) > > { > > + struct drm_gem_object *obj = exp_info->priv; > > struct dma_buf *dma_buf; > > > > dma_buf = dma_buf_export(exp_info); > > @@ -247,7 +248,8 @@ struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev, > > return dma_buf; > > > > drm_dev_get(dev); > > - drm_gem_object_get(exp_info->priv); > > + drm_gem_object_get(obj); > > + dma_buf->file->f_mapping = obj->dev->anon_inode->i_mapping; > > > > return dma_buf; > > } > > -- > > 2.18.1 > > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel