From 6d83cd17f864f5bab8609b65d9716111ff533ed1 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 15 Aug 2022 10:43:00 +0800 Subject: [PATCH] ACRN:DM:VGPU: Handle the scanout_id for cursor virtio-gpu-cmd The virtio-gpu in guest_vm also passes the scanout_id for cursor operation. So this scanout_id should be used in course of handling cursor operation. Tracked-On: #7988 Signed-off-by: Zhao Yakui Reviewed-by: Peng Sun --- devicemodel/hw/pci/virtio/virtio_gpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devicemodel/hw/pci/virtio/virtio_gpu.c b/devicemodel/hw/pci/virtio/virtio_gpu.c index 42211e0d3..52d95be28 100644 --- a/devicemodel/hw/pci/virtio/virtio_gpu.c +++ b/devicemodel/hw/pci/virtio/virtio_gpu.c @@ -1389,7 +1389,7 @@ virtio_gpu_cmd_update_cursor(struct virtio_gpu_command *cmd) cur.height = r2d->height; pixman_image_ref(r2d->image); cur.data = pixman_image_get_data(r2d->image); - vdpy_cursor_define(gpu->vdpy_handle, 0, &cur); + vdpy_cursor_define(gpu->vdpy_handle, req.pos.scanout_id, &cur); pixman_image_unref(r2d->image); } } @@ -1402,7 +1402,7 @@ virtio_gpu_cmd_move_cursor(struct virtio_gpu_command *cmd) gpu = cmd->gpu; memcpy(&req, cmd->iov[0].iov_base, sizeof(req)); - vdpy_cursor_move(gpu->vdpy_handle, 0, req.pos.x, req.pos.y); + vdpy_cursor_move(gpu->vdpy_handle, req.pos.scanout_id, req.pos.x, req.pos.y); } static void