[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 04/19] vl: move display early init before default devices
From: |
marcandre . lureau |
Subject: |
[PATCH v5 04/19] vl: move display early init before default devices |
Date: |
Mon, 23 Oct 2023 15:30:31 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The next commit needs to have the display registered itself before
creating the default VCs.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
system/vl.c | 41 +++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index 92d29bf521..2cecb3d884 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1349,6 +1349,28 @@ static void qemu_disable_default_devices(void)
}
}
+static void qemu_early_display_init(void)
+{
+#if defined(CONFIG_VNC)
+ if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) {
+ display_remote++;
+ }
+#endif
+ if (dpy.type == DISPLAY_TYPE_DEFAULT && !display_remote) {
+ if (!qemu_display_find_default(&dpy)) {
+ dpy.type = DISPLAY_TYPE_NONE;
+#if defined(CONFIG_VNC)
+ vnc_parse("localhost:0,to=99,id=default");
+#endif
+ }
+ }
+ if (dpy.type == DISPLAY_TYPE_DEFAULT) {
+ dpy.type = DISPLAY_TYPE_NONE;
+ }
+
+ qemu_display_early_init(&dpy);
+}
+
static void qemu_create_default_devices(void)
{
MachineClass *machine_class = MACHINE_GET_CLASS(current_machine);
@@ -1398,23 +1420,6 @@ static void qemu_create_default_devices(void)
#endif
}
-#if defined(CONFIG_VNC)
- if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) {
- display_remote++;
- }
-#endif
- if (dpy.type == DISPLAY_TYPE_DEFAULT && !display_remote) {
- if (!qemu_display_find_default(&dpy)) {
- dpy.type = DISPLAY_TYPE_NONE;
-#if defined(CONFIG_VNC)
- vnc_parse("localhost:0,to=99,id=default");
-#endif
- }
- }
- if (dpy.type == DISPLAY_TYPE_DEFAULT) {
- dpy.type = DISPLAY_TYPE_NONE;
- }
-
/* If no default VGA is requested, the default is "none". */
if (default_vga) {
vga_model = get_default_vga_model(machine_class);
@@ -1939,7 +1944,6 @@ static void qemu_create_early_backends(void)
"ignoring option");
}
- qemu_display_early_init(&dpy);
qemu_console_early_init();
if (dpy.has_gl && dpy.gl != DISPLAYGL_MODE_OFF && display_opengl == 0) {
@@ -3670,6 +3674,7 @@ void qemu_init(int argc, char **argv)
suspend_mux_open();
qemu_disable_default_devices();
+ qemu_early_display_init();
qemu_create_default_devices();
qemu_create_early_backends();
--
2.41.0
- [PATCH v5 00/19] Make Pixman an optional dependency, marcandre . lureau, 2023/10/23
- [PATCH v5 02/19] ui: compile out some qemu-pixman functions when !PIXMAN, marcandre . lureau, 2023/10/23
- [PATCH v5 03/19] ui: add pixman-compat.h, marcandre . lureau, 2023/10/23
- [PATCH v5 05/19] ui/console: allow to override the default VC, marcandre . lureau, 2023/10/23
- [PATCH v5 07/19] qmp/hmp: disable screendump if PIXMAN is missing, marcandre . lureau, 2023/10/23