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>
This commit is contained in:
Peter Maydell
2018-03-05 15:16:30 +00:00
16 changed files with 220 additions and 176 deletions

74
vl.c
View File

@@ -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);
}