From: Tomas M <[email protected]>
The guest-backed cursor path without cursor MOB support defines the image
using only the hotspot from the plane state. Its position calculation
also includes the legacy hotspot supplied through DRM_VMW_CURSOR_BYPASS.
Xorg's xf86-video-vmware driver supplies its hotspot through that ioctl
and loads the image with drmModeSetCursor(), which does not set a plane
hotspot. The mismatched image and position hotspots displace the visible
cursor by the legacy offset.
Use the combined hotspot for both the GB-only image command and cursor
position, matching the legacy and MOB image paths.
Fixes: eef295a85082 ("drm/vmwgfx: Restore Guest-Backed only cursor plane
support")
Cc: [email protected]
Assisted-by: LLM
Signed-off-by: Tomas M <[email protected]>
Signed-off-by: Zack Rusin <[email protected]>
---
drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c
b/drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c
index 14490ead99cd..f0661e5effeb 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c
@@ -852,6 +852,10 @@ vmw_cursor_plane_atomic_update(struct drm_plane *plane,
return;
}
+ /* Include legacy Xorg cursor-bypass offsets in the image and position.
*/
+ hotspot_x = vps->cursor.legacy.hotspot_x + new_state->hotspot_x;
+ hotspot_y = vps->cursor.legacy.hotspot_y + new_state->hotspot_y;
+
switch (vps->cursor.update_type) {
case VMW_CURSOR_UPDATE_LEGACY:
vmw_cursor_plane_update_legacy(dev_priv, vps);
@@ -864,8 +868,7 @@ vmw_cursor_plane_atomic_update(struct drm_plane *plane,
vmw_send_define_cursor_cmd(dev_priv,
vps->cursor.map.virtual,
vps->base.crtc_w,
vps->base.crtc_h,
- vps->base.hotspot_x,
- vps->base.hotspot_y);
+ hotspot_x, hotspot_y);
break;
case VMW_CURSOR_UPDATE_NONE:
/* do nothing */
@@ -878,9 +881,6 @@ vmw_cursor_plane_atomic_update(struct drm_plane *plane,
cursor_x = new_state->crtc_x + du->set_gui_x;
cursor_y = new_state->crtc_y + du->set_gui_y;
- hotspot_x = vps->cursor.legacy.hotspot_x + new_state->hotspot_x;
- hotspot_y = vps->cursor.legacy.hotspot_y + new_state->hotspot_y;
-
vmw_cursor_update_position(dev_priv, true, cursor_x + hotspot_x,
cursor_y + hotspot_y);
}
--
2.53.0