Skip to content

Commit 23a2ffd

Browse files
committed
drm/shmem-helper: Add lockdep asserts to vmap/vunmap
Since commit 21aa27d ("drm/shmem-helper: Switch to reservation lock"), the drm_gem_shmem_vmap and drm_gem_shmem_vunmap functions require that the caller holds the DMA reservation lock for the object. Add lockdep assertions to help validate this. Signed-off-by: Asahi Lina <[email protected]>
1 parent 1695a7e commit 23a2ffd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/drm_gem_shmem_helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem,
313313
struct drm_gem_object *obj = &shmem->base;
314314
int ret = 0;
315315

316+
dma_resv_assert_held(obj->resv);
317+
316318
if (obj->import_attach) {
317319
ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
318320
if (!ret) {
@@ -379,6 +381,8 @@ void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem,
379381
{
380382
struct drm_gem_object *obj = &shmem->base;
381383

384+
dma_resv_assert_held(obj->resv);
385+
382386
if (obj->import_attach) {
383387
dma_buf_vunmap(obj->import_attach->dmabuf, map);
384388
} else {

0 commit comments

Comments
 (0)