Skip to content

Commit 0345bae

Browse files
committed
drm/qxl: add lock asserts to qxl_bo_vmap_locked + qxl_bo_vunmap_locked
Try avoid re-introducing locking bugs. Signed-off-by: Gerd Hoffmann <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b4b27f0 commit 0345bae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/qxl/qxl_object.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ int qxl_bo_vmap_locked(struct qxl_bo *bo, struct dma_buf_map *map)
162162
{
163163
int r;
164164

165+
dma_resv_assert_held(bo->tbo.base.resv);
166+
165167
if (bo->kptr) {
166168
bo->map_count++;
167169
goto out;
@@ -236,6 +238,8 @@ void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev,
236238

237239
void qxl_bo_vunmap_locked(struct qxl_bo *bo)
238240
{
241+
dma_resv_assert_held(bo->tbo.base.resv);
242+
239243
if (bo->kptr == NULL)
240244
return;
241245
bo->map_count--;

0 commit comments

Comments
 (0)