From: Thomas Zimmermann <tzimmermann@suse.de>
To: alexander.deucher@amd.com, christian.koenig@amd.com,
airlied@linux.ie, daniel@ffwll.ch, bskeggs@redhat.com,
ray.huang@amd.com, linux-graphics-maintainer@vmware.com,
sroland@vmware.com, zackr@vmware.com, shashank.sharma@amd.com,
sam@ravnborg.org, emil.velikov@collabora.com,
Felix.Kuehling@amd.com, nirmoy.das@amd.com
Cc: nouveau@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH v2 0/7] drm: Clean up mmap for TTM-based GEM drivers
Date: Thu, 15 Apr 2021 12:17:33 +0200 [thread overview]
Message-ID: <20210415101740.21847-1-tzimmermann@suse.de> (raw)
Implement mmap via struct drm_gem_object_functions.mmap in amdgpu,
radeon and nouveau. This allows for using common DRM helpers for
the mmap-related callbacks in struct file_operations and struct
drm_driver. The drivers have their own vm_ops, which are now set
automatically by the DRM core functions. The code in each driver's
verify_access becomes part of the driver's new mmap implementation.
With the GEM drivers converted, vmwgfx is the only user of
ttm_bo_mmap() and related infrastructure. So move everything into
vmwgfx and delete the rsp code from TTM.
This touches several drivers. Preferably everything would be merged
at once via drm-misc-next.
v2:
* removal of amdgpu fbdev mmap already merged (Christian)
* rebase on top of amdgpu fixes [1] (Felix)
* replace pr_err() with drm_err() in vmwgfx patch (Zack)
* several typos
[1] https://patchwork.freedesktop.org/series/88822/
Thomas Zimmermann (7):
drm/ttm: Don't override vm_ops callbacks, if set
drm/amdgpu: Implement mmap as GEM object function
drm/radeon: Implement mmap as GEM object function
drm/nouveau: Implement mmap as GEM object function
drm/vmwgfx: Inline ttm_bo_mmap() into vmwgfx driver
drm/vmwgfx: Inline vmw_verify_access()
drm/ttm: Remove ttm_bo_mmap() and friends
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 46 ---------------
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h | 2 -
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 56 ++++++++++++++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 64 --------------------
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 1 -
drivers/gpu/drm/nouveau/nouveau_bo.c | 10 ----
drivers/gpu/drm/nouveau/nouveau_drm.c | 3 +-
drivers/gpu/drm/nouveau/nouveau_gem.c | 36 ++++++++++++
drivers/gpu/drm/nouveau/nouveau_ttm.c | 49 ----------------
drivers/gpu/drm/nouveau/nouveau_ttm.h | 1 -
drivers/gpu/drm/radeon/radeon_drv.c | 3 +-
drivers/gpu/drm/radeon/radeon_gem.c | 52 +++++++++++++++++
drivers/gpu/drm/radeon/radeon_ttm.c | 65 ---------------------
drivers/gpu/drm/radeon/radeon_ttm.h | 1 -
drivers/gpu/drm/ttm/ttm_bo_vm.c | 60 ++-----------------
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 9 ---
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 53 ++++++++++++++++-
include/drm/ttm/ttm_bo_api.h | 13 -----
include/drm/ttm/ttm_device.h | 15 -----
20 files changed, 206 insertions(+), 337 deletions(-)
--
2.31.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next reply other threads:[~2021-04-15 10:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 10:17 Thomas Zimmermann [this message]
2021-04-15 10:17 ` [PATCH v2 1/7] drm/ttm: Don't override vm_ops callbacks, if set Thomas Zimmermann
2021-04-15 13:21 ` Daniel Vetter
2021-04-15 10:17 ` [PATCH v2 2/7] drm/amdgpu: Implement mmap as GEM object function Thomas Zimmermann
2021-04-15 11:38 ` Christian König
2021-04-15 12:11 ` Thomas Zimmermann
2021-04-15 12:16 ` Christian König
2021-04-15 10:17 ` [PATCH v2 3/7] drm/radeon: " Thomas Zimmermann
2021-04-15 10:17 ` [PATCH v2 4/7] drm/nouveau: " Thomas Zimmermann
2021-04-15 10:17 ` [PATCH v2 5/7] drm/vmwgfx: Inline ttm_bo_mmap() into vmwgfx driver Thomas Zimmermann
2021-04-15 10:17 ` [PATCH v2 6/7] drm/vmwgfx: Inline vmw_verify_access() Thomas Zimmermann
2021-04-15 10:17 ` [PATCH v2 7/7] drm/ttm: Remove ttm_bo_mmap() and friends Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210415101740.21847-1-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=Felix.Kuehling@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.velikov@collabora.com \
--cc=linux-graphics-maintainer@vmware.com \
--cc=nirmoy.das@amd.com \
--cc=nouveau@lists.freedesktop.org \
--cc=ray.huang@amd.com \
--cc=sam@ravnborg.org \
--cc=shashank.sharma@amd.com \
--cc=sroland@vmware.com \
--cc=zackr@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).