[PULL 34/52] ui/vc: use common text console surface creation

marcandre.lureau@redhat.com posted 52 patches 1 year, 2 months ago
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
[PULL 34/52] ui/vc: use common text console surface creation
Posted by marcandre.lureau@redhat.com 1 year, 2 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-35-marcandre.lureau@redhat.com>
---
 ui/console.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index a3fd1c5059..3d884956b7 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2569,18 +2569,13 @@ static void vc_chr_open(Chardev *chr,
         height = qemu_console_get_height(NULL, 24 * FONT_HEIGHT);
     } else {
         s = QEMU_TEXT_CONSOLE(object_new(TYPE_QEMU_FIXED_TEXT_CONSOLE));
-        QEMU_CONSOLE(s)->scanout.kind = SCANOUT_SURFACE;
-        QEMU_CONSOLE(s)->surface = qemu_create_displaysurface(width, height);
     }
 
+    dpy_gfx_replace_surface(QEMU_CONSOLE(s), qemu_create_displaysurface(width, height));
+
     s->chr = chr;
     drv->console = s;
 
-    if (QEMU_CONSOLE(s)->scanout.kind != SCANOUT_SURFACE) {
-        QEMU_CONSOLE(s)->surface = qemu_create_displaysurface(width, height);
-        QEMU_CONSOLE(s)->scanout.kind = SCANOUT_SURFACE;
-    }
-
     /* set current text attributes to default */
     drv->t_attrib = TEXT_ATTRIBUTES_DEFAULT;
     text_console_resize(s);
-- 
2.41.0