From b5a087b071b6d4752234d8c190cc7f22f44ec2e9 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Thu, 25 Feb 2021 19:13:14 +0900 Subject: ui/console: Add placeholder flag to message surface The surfaces created with former qemu_create_message_surface did not display the content from the guest and always contained simple messages describing the reason. A display backend may want to hide the window showing such a surface. This change renames the function to qemu_create_placeholder_surface, and adds "placeholder" flag; the display can check the flag to decide to do anything special like hiding the window. Signed-off-by: Akihiko Odaki Message-Id: <20210225101316.83940-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann --- hw/display/vhost-user-gpu.c | 4 ++-- hw/display/virtio-gpu.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'hw/display') diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 4d8cb35..3e911da 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -194,8 +194,8 @@ vhost_user_gpu_handle_display(VhostUserGPU *g, VhostUserGpuMsg *msg) con = s->con; if (m->scanout_id == 0 && m->width == 0) { - s->ds = qemu_create_message_surface(640, 480, - "Guest disabled display."); + s->ds = qemu_create_placeholder_surface(640, 480, + "Guest disabled display."); dpy_gfx_replace_surface(con, s->ds); } else { s->ds = qemu_create_displaysurface(m->width, m->height); diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 2e4a982..c1f17be 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -338,9 +338,9 @@ static void virtio_gpu_disable_scanout(VirtIOGPU *g, int scanout_id) if (scanout_id == 0) { /* primary head */ - ds = qemu_create_message_surface(scanout->width ?: 640, - scanout->height ?: 480, - "Guest disabled display."); + ds = qemu_create_placeholder_surface(scanout->width ?: 640, + scanout->height ?: 480, + "Guest disabled display."); } dpy_gfx_replace_surface(scanout->con, ds); scanout->resource_id = 0; -- cgit v1.1