aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c74
1 files changed, 11 insertions, 63 deletions
diff --git a/vl.c b/vl.c
index f98ec983e8..6120b889ed 100644
--- a/vl.c
+++ b/vl.c
@@ -2094,7 +2094,6 @@ static void parse_display(const char *p)
const char *opts;
if (strstart(p, "sdl", &opts)) {
-#ifdef CONFIG_SDL
dpy.type = DISPLAY_TYPE_SDL;
while (*opts) {
const char *nextopt;
@@ -2155,10 +2154,6 @@ static void parse_display(const char *p)
}
opts = nextopt;
}
-#else
- error_report("SDL support is disabled");
- exit(1);
-#endif
} else if (strstart(p, "vnc", &opts)) {
if (*opts == '=') {
vnc_parse(opts + 1, &error_fatal);
@@ -2167,22 +2162,10 @@ static void parse_display(const char *p)
exit(1);
}
} else if (strstart(p, "egl-headless", &opts)) {
-#ifdef CONFIG_OPENGL_DMABUF
- display_opengl = 1;
dpy.type = DISPLAY_TYPE_EGL_HEADLESS;
-#else
- error_report("egl support is disabled");
- exit(1);
-#endif
} else if (strstart(p, "curses", &opts)) {
-#ifdef CONFIG_CURSES
dpy.type = DISPLAY_TYPE_CURSES;
-#else
- error_report("curses support is disabled");
- exit(1);
-#endif
} else if (strstart(p, "gtk", &opts)) {
-#ifdef CONFIG_GTK
dpy.type = DISPLAY_TYPE_GTK;
while (*opts) {
const char *nextopt;
@@ -2214,10 +2197,6 @@ static void parse_display(const char *p)
}
opts = nextopt;
}
-#else
- error_report("GTK support is disabled");
- exit(1);
-#endif
} else if (strstart(p, "none", &opts)) {
dpy.type = DISPLAY_TYPE_NONE;
} else {
@@ -4328,17 +4307,15 @@ int main(int argc, char **argv, char **envp)
}
#endif
if (dpy.type == DISPLAY_TYPE_DEFAULT && !display_remote) {
-#if defined(CONFIG_GTK)
- dpy.type = DISPLAY_TYPE_GTK;
-#elif defined(CONFIG_SDL)
- dpy.type = DISPLAY_TYPE_SDL;
-#elif defined(CONFIG_COCOA)
- dpy.type = DISPLAY_TYPE_COCOA;
-#elif defined(CONFIG_VNC)
- vnc_parse("localhost:0,to=99,id=default", &error_abort);
-#else
- dpy.type = DISPLAY_TYPE_NONE;
+ if (!qemu_display_find_default(&dpy)) {
+ dpy.type = DISPLAY_TYPE_NONE;
+#if defined(CONFIG_VNC)
+ vnc_parse("localhost:0,to=99,id=default", &error_abort);
#endif
+ }
+ }
+ if (dpy.type == DISPLAY_TYPE_DEFAULT) {
+ dpy.type = DISPLAY_TYPE_NONE;
}
if ((no_frame || alt_grab || ctrl_grab) && dpy.type != DISPLAY_TYPE_SDL) {
@@ -4351,14 +4328,7 @@ int main(int argc, char **argv, char **envp)
"ignoring option");
}
- if (dpy.type == DISPLAY_TYPE_GTK) {
- early_gtk_display_init(&dpy);
- }
-
- if (dpy.type == DISPLAY_TYPE_SDL) {
- sdl_display_early_init(&dpy);
- }
-
+ qemu_display_early_init(&dpy);
qemu_console_early_init();
if (dpy.has_gl && dpy.gl && display_opengl == 0) {
@@ -4684,25 +4654,9 @@ int main(int argc, char **argv, char **envp)
qemu_register_reset(restore_boot_order, g_strdup(boot_order));
}
- ds = init_displaystate();
-
/* init local displays */
- switch (dpy.type) {
- case DISPLAY_TYPE_CURSES:
- curses_display_init(ds, &dpy);
- break;
- case DISPLAY_TYPE_SDL:
- sdl_display_init(ds, &dpy);
- break;
- case DISPLAY_TYPE_COCOA:
- cocoa_display_init(ds, &dpy);
- break;
- case DISPLAY_TYPE_GTK:
- gtk_display_init(ds, &dpy);
- break;
- default:
- break;
- }
+ ds = init_displaystate();
+ qemu_display_init(ds, &dpy);
/* must be after terminal init, SDL library changes signal handlers */
os_setup_signal_handling();
@@ -4717,12 +4671,6 @@ int main(int argc, char **argv, char **envp)
qemu_spice_display_init();
}
-#ifdef CONFIG_OPENGL_DMABUF
- if (dpy.type == DISPLAY_TYPE_EGL_HEADLESS) {
- egl_headless_init(&dpy);
- }
-#endif
-
if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) {
exit(1);
}