[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/52] ui/console: remove need for g_width/g_height
From: |
marcandre . lureau |
Subject: |
[PULL 33/52] ui/console: remove need for g_width/g_height |
Date: |
Mon, 4 Sep 2023 15:52:30 +0400 |
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-34-marcandre.lureau@redhat.com>
---
ui/console.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/ui/console.c b/ui/console.c
index 70e11f924d..a3fd1c5059 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2549,8 +2549,6 @@ static void vc_chr_open(Chardev *chr,
QemuTextConsole *s;
unsigned width = 0;
unsigned height = 0;
- int g_width = 80 * FONT_WIDTH;
- int g_height = 24 * FONT_HEIGHT;
if (vc->has_width) {
width = vc->width;
@@ -2567,6 +2565,8 @@ static void vc_chr_open(Chardev *chr,
trace_console_txt_new(width, height);
if (width == 0 || height == 0) {
s = QEMU_TEXT_CONSOLE(object_new(TYPE_QEMU_TEXT_CONSOLE));
+ width = qemu_console_get_width(NULL, 80 * FONT_WIDTH);
+ 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;
@@ -2577,9 +2577,7 @@ static void vc_chr_open(Chardev *chr,
drv->console = s;
if (QEMU_CONSOLE(s)->scanout.kind != SCANOUT_SURFACE) {
- 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)->surface = qemu_create_displaysurface(width, height);
QEMU_CONSOLE(s)->scanout.kind = SCANOUT_SURFACE;
}
--
2.41.0
- [PULL 24/52] ui/console: update the head from unused QemuConsole, (continued)
- [PULL 24/52] ui/console: update the head from unused QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 22/52] ui/console: remove new_console(), marcandre . lureau, 2023/09/04
- [PULL 28/52] ui/vc: move text fields to QemuTextConsole, marcandre . lureau, 2023/09/04
- [PULL 25/52] ui/console: allocate ui_timer in QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 29/52] ui/console: move graphic fields to QemuGraphicConsole, marcandre . lureau, 2023/09/04
- [PULL 30/52] ui/vc: fold text_console_do_init() in vc_chr_open(), marcandre . lureau, 2023/09/04
- [PULL 31/52] ui/vc: move some text console initialization to qom handlers, marcandre . lureau, 2023/09/04
- [PULL 32/52] ui/console: simplify getting active_console size, marcandre . lureau, 2023/09/04
- [PULL 35/52] ui/console: declare console types in console.h, marcandre . lureau, 2023/09/04
- [PULL 37/52] ui/console: rename vga_ functions with qemu_console_, marcandre . lureau, 2023/09/04
- [PULL 33/52] ui/console: remove need for g_width/g_height,
marcandre . lureau <=
- [PULL 34/52] ui/vc: use common text console surface creation, marcandre . lureau, 2023/09/04
- [PULL 36/52] ui/console: use QEMU_PIXMAN_COLOR helpers, marcandre . lureau, 2023/09/04
- [PULL 38/52] ui/console: assert(surface) where appropriate, marcandre . lureau, 2023/09/04
- [PULL 39/52] ui/console: fold text_console_update_cursor_timer, marcandre . lureau, 2023/09/04
- [PULL 40/52] ui/vc: skip text console resize when possible, marcandre . lureau, 2023/09/04
- [PULL 41/52] ui/console: minor stylistic changes, marcandre . lureau, 2023/09/04
- [PULL 43/52] ui/vc: do not parse VC-specific options in Spice and GTK, marcandre . lureau, 2023/09/04
- [PULL 42/52] ui/vc: move text console invalidate in helper, marcandre . lureau, 2023/09/04
- [PULL 44/52] ui/vc: change the argument for QemuTextConsole, marcandre . lureau, 2023/09/04
- [PULL 45/52] ui/spice-display: Avoid dynamic stack allocation, marcandre . lureau, 2023/09/04