drm/gem-shmem: Acquire reservation lock in GEM pin/unpin callbacks
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 27 Feb 2024 10:14:48 +0000 (11:14 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 11 Mar 2024 12:33:50 +0000 (13:33 +0100)
commitec144244a43f6e4ca9767bf9fb1b2c9e293c2a31
tree6487d3088a95a8cf9ba74fc6941c655753e8e226
parent8e3ed5440b0c305dcd1d5fa7419bd8066d22ef42
drm/gem-shmem: Acquire reservation lock in GEM pin/unpin callbacks

Export drm_gem_shmem_pin_locked() and acquire the reservation lock
directly in GEM pin callback. Same for unpin. Prepares for further
changes.

Dma-buf locking semantics require callers to hold the buffer's
reservation lock when invoking the pin and unpin callbacks. Prepare
gem-shmem accordingly by pushing locking out of the implementation.
A follow-up patch will fix locking for all GEM code at once.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # virtio-gpu
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240227113853.8464-2-tzimmermann@suse.de
drivers/gpu/drm/drm_gem_shmem_helper.c
include/drm/drm_gem_shmem_helper.h