Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4148451ybc; Tue, 26 Nov 2019 04:41:10 -0800 (PST) X-Google-Smtp-Source: APXvYqycvGJbPg0j98La4uKSTwHoXSNOErd4hNy0U7rtDVLfq9CznylmVanLTqjqTN3Na37wllN6 X-Received: by 2002:a17:906:3107:: with SMTP id 7mr23798661ejx.125.1574772070588; Tue, 26 Nov 2019 04:41:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574772070; cv=none; d=google.com; s=arc-20160816; b=ASR21WDYRVxnnbUmvnl1U05AE61sH7upfs6zgi/oo7hax0kkMcQd7l2OoeLZI+paWs Sq+UrvoiSDjkC6/leA5vgosbEOxYaDJL53uzo3MHD/0TJju6lJDUnIGcEVI5jQ6jcVs1 vUNPTOT1FKvCX+FvVN1/r96shgN2u64foE6vwsl5yWyNVyRXk8rRbbSTPm5lVv+/W2/O urXSRge9W4JZmvztavMFnyIre3+A8iUJ2poamZU1ut9UwN9EtzSD+dfObSVvgzrF3/o/ ELLtkcFe5GC2GDvjKQLqUcn+tGjrQd3XYUTFdHq1Es7KnQTQxtiA9RKiXS7dA9IAwDq0 oMHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature; bh=CPxUmxxrz0H0XB9WSkrGE01aU3KDlj9zInkoJCdSrwI=; b=bfCiZeqd5RCluaGI8boJXuHNscuHFMeSSsA0V9md7tQP9bC1Sm509jyO3nfjtcpkad oUBR+h6f66V127LE04IdXmexehlok7mh7vN2HahUJ7YMuoh5XVvwE2fjEd+gz0x636Ow sm3l97SsRDpwwkhc9EhwPovlusV4NUhm7/lRLuD/u8+tFhdVV2ytzf27g+kPczS8xS7E im88NZRUpwgmXmaOm4zTzfDB5s3ne9PAWNQ3MMX4yYqoFlT/+JuZY1C6QnOIzKKMhILY mfJmm70rqjVQgPiswrzPJgnUPeQBIwTgqVwo15oHEau0ElU3yjBPTj9ABlNaZD/fxXvJ EDOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=V1luVdUV; 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 z17si6851754ejp.141.2019.11.26.04.40.46; Tue, 26 Nov 2019 04:41:10 -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=V1luVdUV; 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 S1728016AbfKZLPJ (ORCPT + 99 others); Tue, 26 Nov 2019 06:15:09 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:44685 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727141AbfKZLPJ (ORCPT ); Tue, 26 Nov 2019 06:15:09 -0500 Received: by mail-yb1-f196.google.com with SMTP id g38so7283077ybe.11 for ; Tue, 26 Nov 2019 03:15:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=CPxUmxxrz0H0XB9WSkrGE01aU3KDlj9zInkoJCdSrwI=; b=V1luVdUV4XJZz94qiIBz2tJ7QVfajnWgLB+RPf3tuqosIVP4fSEVycsb7IB4jp1+gL e6Est8fUOmF044UlBzlpXdMYTwKU8j6IKv/CVD+8vMaLEus1ZXImDoWuh/Fl9fVnLF6q 6qBxgWSIu7MdvCV+Rr8k227Eb08UChBSMQxyyX5nIeKzdaWetG1tT4QeoiaJ76xZQ5oB yhedQCP4+Y09aALzMARk6ZY93ngYyUDx7iCRPRC4HCQ9kh+rVHqW+T+CgOOjUpfAw8LD sSrVpC8rQQzzW0uZcyb5o76u3HM/8iSY3GePcHey9MUALWuFbioZ16N4w/oPuDHqI8yj 79jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=CPxUmxxrz0H0XB9WSkrGE01aU3KDlj9zInkoJCdSrwI=; b=FWXoXDeaHqdoBshMexZcCfgsqL9y/+9Pw4rcUnMRJViZk1Wwn+a9Y9E+vH4mXs+Ypv kDltHbJiZo7bhDnyZ132zoIql0HceEg3NAiR0TLs2CwV2ts4Sx6VW0VI2L8+jqpW/9s8 fdTr+7/xYBeYWTSRCQuLYLYkGuQlc8JbpxyG2HqXC+8vilSGJjlBaUIzsFOOgr+ZaT3S A2KBqhGii9GCkjRKgYqQ8F89VTuwKUxQSVBKZBOQiNrFfINHswPkuMB7C7L2NbECm/Oz bwYWkXK99a3SM9tfItHjbs8elunD+N3+9ojzfHx3zKGSXFD8tffkRtWURMPfM1Er0S+R yB6Q== X-Gm-Message-State: APjAAAUu8VrHQQMn078BAopsLF1/IzWlirxVd3e8j6xuBREF/dDLkvvq hCLnY7SS4/+7IXUSGGtex94= X-Received: by 2002:a25:258a:: with SMTP id l132mr28132474ybl.227.1574766906377; Tue, 26 Nov 2019 03:15:06 -0800 (PST) Received: from ?IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7? ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id j79sm5064019ywa.100.2019.11.26.03.15.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Nov 2019 03:15:05 -0800 (PST) Reply-To: christian.koenig@amd.com Subject: Re: [PATCH v2 2/2] drm: share address space for dma bufs To: Alex Deucher , Daniel Vetter Cc: "open list:RADEON and AMDGPU DRM DRIVERS" , David Airlie , intel-gfx , open list , dri-devel , Gerd Hoffmann , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20191122063749.27113-1-kraxel@redhat.com> <20191122063749.27113-3-kraxel@redhat.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <805a875c-a43f-556d-db72-3af32e3061d6@gmail.com> Date: Tue, 26 Nov 2019 12:15:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 22.11.19 um 19:21 schrieb Alex Deucher: > 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 Reviewed-by: Christian König > > >>> --- >>> 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 > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx