diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-02-17 13:32:13 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-02-19 09:13:25 +0100 |
commit | 0345bae1776b24e2b591f50b1bfe63001fd40efb (patch) | |
tree | 275dfc7f8bec1778c09582fffc9d22c94efbe038 /drivers/gpu/drm/qxl | |
parent | drm/qxl: rework cursor plane (diff) | |
download | linux-0345bae1776b24e2b591f50b1bfe63001fd40efb.tar.xz linux-0345bae1776b24e2b591f50b1bfe63001fd40efb.zip |
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 <kraxel@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20210217123213.2199186-12-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/qxl')
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_object.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 82c3bf195ad6..6e26d70f2f07 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -162,6 +162,8 @@ int qxl_bo_vmap_locked(struct qxl_bo *bo, struct dma_buf_map *map) { int r; + dma_resv_assert_held(bo->tbo.base.resv); + if (bo->kptr) { bo->map_count++; goto out; @@ -236,6 +238,8 @@ fallback: void qxl_bo_vunmap_locked(struct qxl_bo *bo) { + dma_resv_assert_held(bo->tbo.base.resv); + if (bo->kptr == NULL) return; bo->map_count--; |