From: Caterina Shablia <caterina.shablia@collabora.com>
To: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Frank Binns" <frank.binns@imgtec.com>,
"Matt Coster" <matt.coster@imgtec.com>,
"Karol Herbst" <kherbst@redhat.com>,
"Lyude Paul" <lyude@redhat.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Boris Brezillon" <boris.brezillon@collabora.com>,
"Steven Price" <steven.price@arm.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
nouveau@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
Asahi Lina <lina@asahilina.net>,
Caterina Shablia <caterina.shablia@collabora.com>
Subject: [PATCH v3 0/7] drm/panthor: support repeated mappings
Date: Thu, 3 Jul 2025 20:52:52 +0000 [thread overview]
Message-ID: <20250703205308.19419-1-caterina.shablia@collabora.com> (raw)
This patch series adds OP_MAP_REPEAT flag, which lets the user map a BO
region over an address range repeatedly with just one map operation.
Sparse resources in the Vulkan API let the user leave regions of a
resource unmapped (from the API perspective.) Accesses to such regions
must not result in program termination, but loads produce undefined
values.
To implement this feature on Mali hardware, Vulkan sparse unmap is
implemented by mapping the specified region to a "dummy bo" so that the
accesses do not fault. A newly created sparse resource starts off
unmapped, and therefore also has to be mapped to the "dummy bo". This
"dummy bo" is small (a page size) in comparison to the sizes of va
ranges that we might want to map to it, and a large number of vm_bind
ops can be necessary. For example, if the user were to create a
100e6-byte sparse resident resource, we'd have to poke VM_BIND with
ceil(100e6/0x1000)=24415 map operations.
OP_MAP_REPEAT addresses this particular inefficiency by letting us
implement a single Vulkan sparse unmap operation and sparse resident
resource initialization with just one map operation.
The panvk changes making use of this uapi can be found at
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35287
No changes in v3.
Changes in v2:
- Make panthor use this stuff.
- Make it possible to express a repeated mappina of any suitably sized
and aligned range of a BO, rather than strictly the page size -sized
prefix, generalizing the API. Rename DRM_GPUVA_SINGLE_PAGE to
DRM_GPUVA_REPEAT.
- Clean up parts of drm/gpuvm affected by these changes.
Link to v1: https://lore.kernel.org/lkml/20250202-gpuvm-single-page-v1-0-8cbd44fdcbd4@asahilina.net/
Asahi Lina (2):
drm/gpuvm: Add a flags field to drm_gpuvm_map_req/drm_gpuva_op_map
drm/gpuvm: Add DRM_GPUVA_REPEAT flag and logic
Boris Brezillon (5):
drm/panthor: Add support for atomic page table updates
drm/gpuvm: Kill drm_gpuva_init()
drm/gpuvm: Pass map arguments through a struct
drm/gpuvm: Add a helper to check if two VA can be merged
drm/panthor: Add support for repeated mappings
drivers/gpu/drm/drm_gpuvm.c | 182 ++++++++++++++++++-------
drivers/gpu/drm/imagination/pvr_vm.c | 15 +-
drivers/gpu/drm/nouveau/nouveau_uvmm.c | 11 +-
drivers/gpu/drm/panthor/panthor_drv.c | 3 +-
drivers/gpu/drm/panthor/panthor_mmu.c | 154 +++++++++++++++++++--
drivers/gpu/drm/xe/xe_vm.c | 13 +-
include/drm/drm_gpuvm.h | 101 +++++++++++---
include/uapi/drm/panthor_drm.h | 23 ++++
8 files changed, 408 insertions(+), 94 deletions(-)
base-commit: 026a60e3c1c55845bd9fdaa202dad81c3f95ae6b
--
2.47.2
next reply other threads:[~2025-07-03 20:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 20:52 Caterina Shablia [this message]
2025-07-03 20:52 ` [PATCH v3 1/7] drm/panthor: Add support for atomic page table updates Caterina Shablia
2025-07-03 20:52 ` [PATCH v3 2/7] drm/gpuvm: Kill drm_gpuva_init() Caterina Shablia
2025-07-03 20:52 ` [PATCH v3 3/7] drm/gpuvm: Pass map arguments through a struct Caterina Shablia
2025-07-03 20:52 ` [PATCH v3 4/7] drm/gpuvm: Add a helper to check if two VA can be merged Caterina Shablia
2025-07-03 20:52 ` [PATCH v3 5/7] drm/gpuvm: Add a flags field to drm_gpuvm_map_req/drm_gpuva_op_map Caterina Shablia
2025-07-03 20:52 ` [PATCH v3 6/7] drm/gpuvm: Add DRM_GPUVA_REPEAT flag and logic Caterina Shablia
2025-07-03 20:52 ` [PATCH v3 7/7] drm/panthor: Add support for repeated mappings Caterina Shablia
2025-07-03 21:02 ` [PATCH v3 0/7] drm/panthor: support " 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=20250703205308.19419-1-caterina.shablia@collabora.com \
--to=caterina.shablia@collabora.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=frank.binns@imgtec.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=kherbst@redhat.com \
--cc=lina@asahilina.net \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=lucas.demarchi@intel.com \
--cc=lyude@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matt.coster@imgtec.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®