summaryrefslogtreecommitdiff
path: root/include/drm/drm_gem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/drm_gem.h')
-rw-r--r--include/drm/drm_gem.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index d3a7b43e2c63..a995c0c1b63c 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -398,16 +398,28 @@ struct drm_gem_object {
struct dma_resv _resv;
/**
- * @gpuva:
- *
- * Provides the list of GPU VAs attached to this GEM object.
- *
- * Drivers should lock list accesses with the GEMs &dma_resv lock
- * (&drm_gem_object.resv) or a custom lock if one is provided.
+ * @gpuva: Fields used by GPUVM to manage mappings pointing to this GEM object.
*/
struct {
+ /**
+ * @gpuva.list: list of GPUVM mappings attached to this GEM object.
+ *
+ * Drivers should lock list accesses with either the GEMs
+ * &dma_resv lock (&drm_gem_object.resv) or the
+ * &drm_gem_object.gpuva.lock mutex.
+ */
struct list_head list;
+ /**
+ * @gpuva.lock: lock protecting access to &drm_gem_object.gpuva.list
+ * when the resv lock can't be used.
+ *
+ * Should only be used when the VM is being modified in a fence
+ * signalling path, otherwise you should use &drm_gem_object.resv to
+ * protect accesses to &drm_gem_object.gpuva.list.
+ */
+ struct mutex lock;
+
#ifdef CONFIG_LOCKDEP
struct lockdep_map *lock_dep_map;
#endif