Commit 5462dc83 authored by Dmitry Osipenko's avatar Dmitry Osipenko
Browse files

drm/gem: Document locking rule of vmap and evict callbacks



The vmap/vunmap/evict GEM callbacks are always invoked with a held GEM's
reservation lock. Document this locking rule for clarity.

Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: default avatarDmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-4-dmitry.osipenko@collabora.com
parent 9a0fd089
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -159,7 +159,8 @@ struct drm_gem_object_funcs {
	 * @vmap:
	 *
	 * Returns a virtual address for the buffer. Used by the
	 * drm_gem_dmabuf_vmap() helper.
	 * drm_gem_dmabuf_vmap() helper. Called with a held GEM reservation
	 * lock.
	 *
	 * This callback is optional.
	 */
@@ -169,7 +170,8 @@ struct drm_gem_object_funcs {
	 * @vunmap:
	 *
	 * Releases the address previously returned by @vmap. Used by the
	 * drm_gem_dmabuf_vunmap() helper.
	 * drm_gem_dmabuf_vunmap() helper. Called with a held GEM reservation
	 * lock.
	 *
	 * This callback is optional.
	 */
@@ -192,7 +194,8 @@ struct drm_gem_object_funcs {
	 * @evict:
	 *
	 * Evicts gem object out from memory. Used by the drm_gem_object_evict()
	 * helper. Returns 0 on success, -errno otherwise.
	 * helper. Returns 0 on success, -errno otherwise. Called with a held
	 * GEM reservation lock.
	 *
	 * This callback is optional.
	 */