diff mbox series

[v1,1/2] virtio-gpu: Provide position info (x, y) to the Guest

Message ID 20221118013723.182424-2-vivek.kasireddy@intel.com (mailing list archive)
State New, archived
Headers show
Series virtio-gpu: Provide display position info (x, y) to the Guest | expand

Commit Message

Kasireddy, Vivek Nov. 18, 2022, 1:37 a.m. UTC
While filling out the display info such as width, height to
be provided to the Guest, make sure that the position information
(x, y) is also included. This position info corresponds with the
x and y fields mentioned in the spec:
https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-gpu.tex#L343

Cc: Dongwon Kim <dongwon.kim@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 hw/display/virtio-gpu-base.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé Nov. 18, 2022, 7:11 a.m. UTC | #1
On 18/11/22 02:37, Vivek Kasireddy wrote:
> While filling out the display info such as width, height to
> be provided to the Guest, make sure that the position information
> (x, y) is also included. This position info corresponds with the
> x and y fields mentioned in the spec:
> https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-gpu.tex#L343
> 
> Cc: Dongwon Kim <dongwon.kim@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
>   hw/display/virtio-gpu-base.c | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index a29f191aa8..3b6b480131 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -47,6 +47,8 @@  virtio_gpu_base_fill_display_info(VirtIOGPUBase *g,
             dpy_info->pmodes[i].enabled = 1;
             dpy_info->pmodes[i].r.width = cpu_to_le32(g->req_state[i].width);
             dpy_info->pmodes[i].r.height = cpu_to_le32(g->req_state[i].height);
+            dpy_info->pmodes[i].r.x = cpu_to_le32(g->req_state[i].x);
+            dpy_info->pmodes[i].r.y = cpu_to_le32(g->req_state[i].y);
         }
     }
 }