aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSinclair Yeh <syeh@vmware.com>2017-07-18 02:26:21 -0400
committerSinclair Yeh <syeh@vmware.com>2017-07-18 02:41:21 -0400
commit14979adb0294f04cf6fbbb81555acff9ec1e7c9c (patch)
tree98fcc04fb7f9e491b0a5e0c542826a2f239c2478
parent7b009e76797c82178d7a03ae0eaad5951d975277 (diff)
drm/vmwgfx: Fix cursor hotspot issue with Wayland on Fedora
Parts of commit <8fbf9d92a7bc> (“drm/vmwgfx: Implement the cursor_set2 callback v2”) were not moved over when we started atomic mode set development because at that time the DRM did not support cursor hotspots in the fb struct. This patch fixes what was not moved over. Signed-off-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Tested-by: Brian Paul <brianp@vmware.com>
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 1d2db5d912b0..f8a977f86ec7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -384,6 +384,12 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
384 384
385 hotspot_x = du->hotspot_x; 385 hotspot_x = du->hotspot_x;
386 hotspot_y = du->hotspot_y; 386 hotspot_y = du->hotspot_y;
387
388 if (plane->fb) {
389 hotspot_x += plane->fb->hot_x;
390 hotspot_y += plane->fb->hot_y;
391 }
392
387 du->cursor_surface = vps->surf; 393 du->cursor_surface = vps->surf;
388 du->cursor_dmabuf = vps->dmabuf; 394 du->cursor_dmabuf = vps->dmabuf;
389 395
@@ -411,6 +417,9 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
411 vmw_cursor_update_position(dev_priv, true, 417 vmw_cursor_update_position(dev_priv, true,
412 du->cursor_x + hotspot_x, 418 du->cursor_x + hotspot_x,
413 du->cursor_y + hotspot_y); 419 du->cursor_y + hotspot_y);
420
421 du->core_hotspot_x = hotspot_x - du->hotspot_x;
422 du->core_hotspot_y = hotspot_y - du->hotspot_y;
414 } else { 423 } else {
415 DRM_ERROR("Failed to update cursor image\n"); 424 DRM_ERROR("Failed to update cursor image\n");
416 } 425 }