summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-03-05 15:16:30 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-03-05 15:16:30 +0000
commit4ee02f53be79f21602ace1ff4057c45bbf86ca64 (patch)
tree82bd6c34d73ce7ed8ae0ec582aa9940abc42ce8a /vl.c
parent41dfc0dc55f0b338ab3c1d29a1721441b76ebd03 (diff)
parent96400a148b3e1337e2c451e95bc3c3c69a05b67c (diff)
downloadqemu-4ee02f53be79f21602ace1ff4057c45bbf86ca64.tar.gz
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180305-pull-request' into staging
ui: build curses, gtk and sdl as modules. # gpg: Signature made Mon 05 Mar 2018 08:48:24 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/ui-20180305-pull-request: ui/sdl: build as module audio: rename CONFIG_* to CONFIG_AUDIO_* ui/curses: build as module ui/gtk: build as module configure: opengl doesn't depend on x11 configure: add X11 vars to config-host.mak console: add ui module loading support console: add and use qemu_display_find_default egl-headless: switch over to new display registry curses: switch over to new display registry cocoa: switch over to new display registry sdl: switch over to new display registry console: add qemu display registry, add gtk Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
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);
}