summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_gem_shmem_helper.c
diff options
context:
space:
mode:
authorAdrián Larumbe <adrian.larumbe@collabora.com>2024-05-23 13:32:19 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2024-05-29 09:30:44 +0200
commit3b8407e81ed76c0d84d710c2a177a8fe24292702 (patch)
tree70d607291fcf348b6c11353c5eda435f27c9f985 /drivers/gpu/drm/drm_gem_shmem_helper.c
parentdrm/lima: Fix dma_resv deadlock at drm object pin time (diff)
downloadlinux-3b8407e81ed76c0d84d710c2a177a8fe24292702.tar.xz
linux-3b8407e81ed76c0d84d710c2a177a8fe24292702.zip
drm/gem-shmem: Add import attachment warning to locked pin function
Commit ec144244a43f ("drm/gem-shmem: Acquire reservation lock in GEM pin/unpin callbacks") moved locking DRM object's dma reservation to drm_gem_shmem_object_pin, and made drm_gem_shmem_pin_locked public, so we need to make sure the not-imported check warning is also added to the latter. Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com> Cc: Boris Brezillon <boris.brezillon@collabora.com> Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240523113236.432585-4-adrian.larumbe@collabora.com
Diffstat (limited to 'drivers/gpu/drm/drm_gem_shmem_helper.c')
-rw-r--r--drivers/gpu/drm/drm_gem_shmem_helper.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 885a62c2e1be..53c003983ad1 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -233,6 +233,8 @@ int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem)
dma_resv_assert_held(shmem->base.resv);
+ drm_WARN_ON(shmem->base.dev, shmem->base.import_attach);
+
ret = drm_gem_shmem_get_pages(shmem);
return ret;