id = 2303 title = "Multiple displays configuration supports" state = "opened" created_at = "2024-04-23T07:59:23.936Z" closed_at = "n/a" labels = ["GUI"] url = "https://gitlab.com/qemu-project/qemu/-/issues/2303" host-os = "n/a" host-arch = "n/a" qemu-version = "n/a" guest-os = "n/a" guest-arch = "n/a" description = "n/a" reproduce = "n/a" additional = """The following patch is a quick "hack" to make it work ```patch From 18ad5058a18fa9f6db2c0c3058e25989908d95bb Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Fri, 23 Jun 2023 13:15:15 +0200 Subject: [PATCH 6/8] HACK: Set static resolutions for the VM --- hw/display/virtio-gpu-base.c | 10 +++++++++- ui/gtk.c | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index a29f191aa8..b1ccfa17b7 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -47,6 +47,7 @@ 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); + fprintf(stderr, "display %d: %dx%d\\n", i, dpy_info->pmodes[i].r.width, dpy_info->pmodes[i].r.height); } } } @@ -63,14 +64,17 @@ static void virtio_gpu_text_update(void *opaque, console_ch_t *chardata) { } +#if 0 static void virtio_gpu_notify_event(VirtIOGPUBase *g, uint32_t event_type) { g->virtio_config.events_read |= event_type; virtio_notify_config(&g->parent_obj); } +#endif static void virtio_gpu_ui_info(void *opaque, uint32_t idx, QemuUIInfo *info) { +#if 0 VirtIOGPUBase *g = opaque; if (idx >= g->conf.max_outputs) { @@ -94,6 +98,7 @@ static void virtio_gpu_ui_info(void *opaque, uint32_t idx, QemuUIInfo *info) /* send event to guest */ virtio_gpu_notify_event(g, VIRTIO_GPU_EVENT_DISPLAY); return; +#endif } static void @@ -186,11 +191,14 @@ virtio_gpu_base_device_realize(DeviceState *qdev, virtio_add_queue(vdev, 16, cursor_cb); } - g->enabled_output_bitmask = 1; + g->enabled_output_bitmask = 3; g->req_state[0].width = g->conf.xres; g->req_state[0].height = g->conf.yres; + g->req_state[1].width = 800; + g->req_state[1].height = 600; + g->hw_ops = &virtio_gpu_ops; for (i = 0; i < g->conf.max_outputs; i++) { g->scanout[i].con = ```"""