summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio/virtgpu_plane.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-05-31 09:36:21 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-06-07 10:37:13 +0200
commit86f752d2cc6b5b4c7bb3db354361588767393453 (patch)
tree40f15d409f9e28f669483c9db0d8322ace572ce6 /drivers/gpu/drm/virtio/virtgpu_plane.c
parentdd5465910740ad74a318cf7464dad1136a2e0ca9 (diff)
downloadlinux-86f752d2cc6b5b4c7bb3db354361588767393453.tar.bz2
virtio-gpu: pick up hotspot from framebuffer
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_plane.c')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_plane.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 478035458e6b..b7778a78db4b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -153,17 +153,23 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
}
if (plane->state->fb != old_state->fb) {
- DRM_DEBUG("update, handle %d, +%d+%d\n", handle,
+ DRM_DEBUG("update, handle %d, pos +%d+%d, hot %d,%d\n", handle,
plane->state->crtc_x,
- plane->state->crtc_y);
+ plane->state->crtc_y,
+ plane->state->fb ? plane->state->fb->hot_x : 0,
+ plane->state->fb ? plane->state->fb->hot_y : 0);
output->cursor.hdr.type =
cpu_to_le32(VIRTIO_GPU_CMD_UPDATE_CURSOR);
output->cursor.resource_id = cpu_to_le32(handle);
-#if 0
- /* TODO */
- output->cursor.hot_x = cpu_to_le32(hot_x);
- output->cursor.hot_y = cpu_to_le32(hot_y);
-#endif
+ if (plane->state->fb) {
+ output->cursor.hot_x =
+ cpu_to_le32(plane->state->fb->hot_x);
+ output->cursor.hot_y =
+ cpu_to_le32(plane->state->fb->hot_y);
+ } else {
+ output->cursor.hot_x = cpu_to_le32(0);
+ output->cursor.hot_y = cpu_to_le32(0);
+ }
} else {
DRM_DEBUG("move +%d+%d\n",
plane->state->crtc_x,