[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 32/67] ui/console: simplify getting active_console size
From: |
marcandre . lureau |
Subject: |
[PATCH 32/67] ui/console: simplify getting active_console size |
Date: |
Wed, 30 Aug 2023 13:38:06 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
We can get the active console dimension regardless of its kind, by
simply giving NULL as argument. It will fallback with the given value
when the dimensions aren't known.
This will also allow to move the code in a separate unit more easily.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/console.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ui/console.c b/ui/console.c
index 5d521ba79d..70e11f924d 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2577,10 +2577,8 @@ static void vc_chr_open(Chardev *chr,
drv->console = s;
if (QEMU_CONSOLE(s)->scanout.kind != SCANOUT_SURFACE) {
- if (active_console && active_console->scanout.kind == SCANOUT_SURFACE)
{
- g_width = qemu_console_get_width(active_console, g_width);
- g_height = qemu_console_get_height(active_console, g_height);
- }
+ g_width = qemu_console_get_width(NULL, g_width);
+ g_height = qemu_console_get_height(NULL, g_height);
QEMU_CONSOLE(s)->surface = qemu_create_displaysurface(g_width,
g_height);
QEMU_CONSOLE(s)->scanout.kind = SCANOUT_SURFACE;
}
--
2.41.0
- [PATCH 22/67] ui/console: remove new_console(), (continued)
- [PATCH 22/67] ui/console: remove new_console(), marcandre . lureau, 2023/08/30
- [PATCH 23/67] ui/console: specialize console_lookup_unused(), marcandre . lureau, 2023/08/30
- [PATCH 24/67] ui/console: update the head from unused QemuConsole, marcandre . lureau, 2023/08/30
- [PATCH 25/67] ui/console: allocate ui_timer in QemuConsole, marcandre . lureau, 2023/08/30
- [PATCH 26/67] ui/vc: move cursor_timer initialization to QemuTextConsole class, marcandre . lureau, 2023/08/30
- [PATCH 27/67] ui/console: free more QemuConsole resources, marcandre . lureau, 2023/08/30
- [PATCH 28/67] ui/vc: move text fields to QemuTextConsole, marcandre . lureau, 2023/08/30
- [PATCH 29/67] ui/console: move graphic fields to QemuGraphicConsole, marcandre . lureau, 2023/08/30
- [PATCH 30/67] ui/vc: fold text_console_do_init() in vc_chr_open(), marcandre . lureau, 2023/08/30
- [PATCH 31/67] ui/vc: move some text console initialization to qom handlers, marcandre . lureau, 2023/08/30
- [PATCH 32/67] ui/console: simplify getting active_console size,
marcandre . lureau <=
- [PATCH 33/67] ui/console: remove need for g_width/g_height, marcandre . lureau, 2023/08/30
- [PATCH 34/67] ui/vc: use common text console surface creation, marcandre . lureau, 2023/08/30
- [PATCH 35/67] ui/console: declare console types in console.h, marcandre . lureau, 2023/08/30
- [PATCH 38/67] ui/console: assert(surface) where appropriate, marcandre . lureau, 2023/08/30
- [PATCH 36/67] ui/console: use QEMU_PIXMAN_COLOR helpers, marcandre . lureau, 2023/08/30
- [PATCH 39/67] ui/console: fold text_console_update_cursor_timer, marcandre . lureau, 2023/08/30
- [PATCH 40/67] ui/vc: skip text console resize when possible, marcandre . lureau, 2023/08/30
- [PATCH 37/67] ui/console: rename vga_ functions → qemu_console_, marcandre . lureau, 2023/08/30