Commit ed96cf7a authored by Martin Krastev's avatar Martin Krastev Committed by Zack Rusin

drm/vmwgfx: Fix vmw_du_get_cursor_mob fencing of newly-created MOBs

The fencing of MOB creation used in vmw_du_get_cursor_mob was incompatible
with register-based device communication employed by this routine. As a
result cursor MOB creation was racy, leading to potentially broken/missing
mouse cursor on desktops using CursorMob device feature.

Fixes: 53bc3f6f ("drm/vmwgfx: Clean up cursor mobs")
Signed-off-by: default avatarMartin Krastev <martin.krastev@broadcom.com>
Reviewed-by: default avatarMaaz Mombasawala <maaz.mombasawala@broadcom.com>
Reviewed-by: default avatarZack Rusin <zack.rusin@broadcom.com>
Signed-off-by: default avatarZack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-5-zack.rusin@broadcom.com
parent 0c10a15d
......@@ -273,6 +273,7 @@ static int vmw_du_get_cursor_mob(struct vmw_cursor_plane *vcp,
u32 size = vmw_du_cursor_mob_size(vps->base.crtc_w, vps->base.crtc_h);
u32 i;
u32 cursor_max_dim, mob_max_size;
struct vmw_fence_obj *fence = NULL;
int ret;
if (!dev_priv->has_mob ||
......@@ -314,7 +315,15 @@ static int vmw_du_get_cursor_mob(struct vmw_cursor_plane *vcp,
if (ret != 0)
goto teardown;
vmw_bo_fence_single(&vps->cursor.bo->tbo, NULL);
ret = vmw_execbuf_fence_commands(NULL, dev_priv, &fence, NULL);
if (ret != 0) {
ttm_bo_unreserve(&vps->cursor.bo->tbo);
goto teardown;
}
dma_fence_wait(&fence->base, false);
dma_fence_put(&fence->base);
ttm_bo_unreserve(&vps->cursor.bo->tbo);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment