From: Danilo Krummrich <dakr@redhat.com>
To: airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com,
thomas.hellstrom@linux.intel.com, sarah.walker@imgtec.com,
donald.robson@imgtec.com, boris.brezillon@collabora.com,
christian.koenig@amd.com, faith.ekstrand@collabora.com,
bskeggs@redhat.com, Liam.Howlett@oracle.com
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Danilo Krummrich <dakr@redhat.com>
Subject: [PATCH drm-misc-next 0/3] [RFC] DRM GPUVA Manager GPU-VM features
Date: Sun, 20 Aug 2023 23:53:07 +0200 [thread overview]
Message-ID: <20230820215320.4187-1-dakr@redhat.com> (raw)
So far the DRM GPUVA manager offers common infrastructure to track GPU VA
allocations and mappings, generically connect GPU VA mappings to their
backing buffers and perform more complex mapping operations on the GPU VA
space.
However, there are more design patterns commonly used by drivers, which
can potentially be generalized in order to make the DRM GPUVA manager
represent a basic GPU-VM implementation. In this context, this patch series
aims at generalizing the following elements.
1) Provide a common dma-resv for GEM objects not being used outside of
this GPU-VM.
2) Provide tracking of external GEM objects (GEM objects which are
shared with other GPU-VMs).
3) Provide functions to efficiently lock all GEM objects dma-resv the
GPU-VM contains mappings of.
4) Provide tracking of evicted GEM objects the GPU-VM contains mappings
of, such that validation of evicted GEM objects is accelerated.
5) Provide some convinience functions for common patterns.
Rather than being designed as a "framework", the target is to make all
features appear as a collection of optional helper functions, such that
drivers are free to make use of the DRM GPUVA managers basic
functionality and opt-in for other features without setting any feature
flags, just by making use of the corresponding functions.
The implementation introduces struct drm_gpuva_gem, which serves as abstraction
combining a struct drm_gpuva_manager and struct drm_gem_object, similar to what
amdgpu does with struct amdgpu_bo_vm. While this adds a bit of complexity it
improves the efficiency of tracking evicted GEM objects. [1] provides an
alternative implementation using a maple_tree, resulting into a fairly simpler
API. [2] points to the full patch series providing the alternative
implementation. [3] points to this patch series.
[1] https://gitlab.freedesktop.org/nouvelles/kernel/-/commit/2a7e1b0ece2c3bba43376783b577d97ae6f6e54f
[2] https://gitlab.freedesktop.org/nouvelles/kernel/-/commits/gpuva-vm-resv
[3] https://gitlab.freedesktop.org/nouvelles/kernel/-/commits/gpuva-vm-resv-vm-bo
Danilo Krummrich (3):
drm: drm_exec: build always builtin
drm/gpuva_mgr: generalize dma_resv/extobj handling and GEM validation
drm/nouveau: gpuva mgr dma-resv/extobj handling, GEM validation
drivers/gpu/drm/Kconfig | 6 -
drivers/gpu/drm/Makefile | 3 +-
drivers/gpu/drm/drm_gpuva_mgr.c | 688 +++++++++++++++++++++++-
drivers/gpu/drm/nouveau/Kconfig | 1 -
drivers/gpu/drm/nouveau/nouveau_bo.c | 4 +-
drivers/gpu/drm/nouveau/nouveau_exec.c | 51 +-
drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +-
drivers/gpu/drm/nouveau/nouveau_sched.h | 2 -
drivers/gpu/drm/nouveau/nouveau_uvmm.c | 191 +++++--
include/drm/drm_gem.h | 48 +-
include/drm/drm_gpuva_mgr.h | 302 ++++++++++-
11 files changed, 1161 insertions(+), 139 deletions(-)
base-commit: 25205087df1ffe06ccea9302944ed1f77dc68c6f
--
2.41.0
next reply other threads:[~2023-08-20 21:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-20 21:53 Danilo Krummrich [this message]
2023-08-20 21:53 ` [PATCH drm-misc-next 1/3] drm: drm_exec: build always builtin Danilo Krummrich
2023-08-21 9:49 ` Christian König
2023-08-21 19:14 ` Danilo Krummrich
2023-08-20 21:53 ` [PATCH drm-misc-next 2/3] drm/gpuva_mgr: generalize dma_resv/extobj handling and GEM validation Danilo Krummrich
2023-08-22 1:31 ` kernel test robot
2023-08-22 2:18 ` kernel test robot
2023-08-22 3:01 ` kernel test robot
2023-08-30 7:27 ` Thomas Hellström (Intel)
2023-08-30 12:49 ` Danilo Krummrich
2023-08-30 13:42 ` Thomas Hellström (Intel)
2023-08-30 15:00 ` Danilo Krummrich
2023-08-31 9:04 ` Thomas Hellström (Intel)
2023-08-31 11:18 ` Danilo Krummrich
2023-08-31 16:53 ` Thomas Hellström (Intel)
2023-08-31 17:23 ` Thomas Hellström
2023-08-31 19:07 ` Danilo Krummrich
2023-09-01 5:59 ` Thomas Hellström (Intel)
2023-09-01 12:10 ` Danilo Krummrich
2023-09-06 14:20 ` Danilo Krummrich
2023-10-10 20:23 ` Dave Airlie
2023-10-11 7:07 ` Christian König
2023-10-12 10:33 ` Dave Airlie
2023-10-12 12:35 ` Christian König
2023-10-12 13:15 ` Daniel Vetter
2023-10-13 5:19 ` Christoph Hellwig
2023-10-11 8:22 ` Thomas Hellström
2023-08-30 7:48 ` Christian König
2023-08-30 13:05 ` Danilo Krummrich
2023-08-20 21:53 ` [PATCH drm-misc-next 3/3] drm/nouveau: gpuva mgr dma-resv/extobj handling, " Danilo Krummrich
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=20230820215320.4187-1-dakr@redhat.com \
--to=dakr@redhat.com \
--cc=Liam.Howlett@oracle.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=donald.robson@imgtec.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith.ekstrand@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=nouveau@lists.freedesktop.org \
--cc=sarah.walker@imgtec.com \
--cc=thomas.hellstrom@linux.intel.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