mirror of
https://github.com/torvalds/linux
synced 2024-09-21 19:47:35 +00:00
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
This commit is contained in:
parent
b4b27f08f9
commit
0345bae177
|
@ -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 @@ void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev,
|
|||
|
||||
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--;
|
||||
|
|
Loading…
Reference in a new issue