aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_gpuvm.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2025-06-29 20:12:45 +0000
committerRob Clark <[email protected]>2025-07-04 18:09:43 +0000
commit471920ce25d50bb39bfdaf3c3d9bc9dde30fa265 (patch)
tree71d697d413515bad9030a40cc9a761bfce6282a0 /include/drm/drm_gpuvm.h
parentdrm/gpuvm: Fix doc comments (diff)
downloadkernel-471920ce25d50bb39bfdaf3c3d9bc9dde30fa265.tar.gz
kernel-471920ce25d50bb39bfdaf3c3d9bc9dde30fa265.zip
drm/gpuvm: Add locking helpers
For UNMAP/REMAP steps we could be needing to lock objects that are not explicitly listed in the VM_BIND ioctl in order to tear-down unmapped VAs. These helpers handle locking/preparing the needed objects. Note that these functions do not strictly require the VM changes to be applied before the next drm_gpuvm_sm_map_lock()/_unmap_lock() call. In the case that VM changes from an earlier drm_gpuvm_sm_map()/_unmap() call result in a differing sequence of steps when the VM changes are actually applied, it will be the same set of GEM objects involved, so the locking is still correct. v2: Rename to drm_gpuvm_sm_*_exec_locked() [Danilo] v3: Expand comments to show expected usage, and explain how the usage is safe in the case of overlapping driver VM_BIND ops. Signed-off-by: Rob Clark <[email protected]> Tested-by: Antonino Maniscalco <[email protected]> Reviewed-by: Antonino Maniscalco <[email protected]> Acked-by: Danilo Krummrich <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/661458/
Diffstat (limited to 'include/drm/drm_gpuvm.h')
-rw-r--r--include/drm/drm_gpuvm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
index 2a9629377633..274532facfd6 100644
--- a/include/drm/drm_gpuvm.h
+++ b/include/drm/drm_gpuvm.h
@@ -1211,6 +1211,14 @@ int drm_gpuvm_sm_map(struct drm_gpuvm *gpuvm, void *priv,
int drm_gpuvm_sm_unmap(struct drm_gpuvm *gpuvm, void *priv,
u64 addr, u64 range);
+int drm_gpuvm_sm_map_exec_lock(struct drm_gpuvm *gpuvm,
+ struct drm_exec *exec, unsigned int num_fences,
+ u64 req_addr, u64 req_range,
+ struct drm_gem_object *obj, u64 offset);
+
+int drm_gpuvm_sm_unmap_exec_lock(struct drm_gpuvm *gpuvm, struct drm_exec *exec,
+ u64 req_addr, u64 req_range);
+
void drm_gpuva_map(struct drm_gpuvm *gpuvm,
struct drm_gpuva *va,
struct drm_gpuva_op_map *op);