All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/12] Ui 20180227 patches
@ 2018-02-27  8:07 Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 01/12] console: add qemu display registry, add gtk Gerd Hoffmann
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

The following changes since commit 0a773d55ac76c5aa89ed9187a3bc5af8c5c2a6d0:

  maintainers: Add myself as a OpenBSD maintainer (2018-02-23 12:05:07 +0000)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/ui-20180227-pull-request

for you to fetch changes up to 8742dcaf7bcfa1ef8720f34dab984f153c87c9f3:

  curses: build as ui module (2018-02-26 15:10:12 +0100)

----------------------------------------------------------------
ui: add & use display registry, build some UIs as module.

----------------------------------------------------------------

Gerd Hoffmann (12):
  console: add qemu display registry, add gtk
  sdl: switch over to new display registry
  cocoa: switch over to new display registry
  curses: switch over to new display registry
  egl-headless: switch over to new display registry
  console: add and use qemu_display_find_default
  console: add ui module loading support
  configure: add X11 vars to config-host.mak
  configure: opengl doesn't depend on x11
  sdl: build as ui module
  gtk: build as ui module
  curses: build as ui module

 configure             | 29 +++++++++++---------
 Makefile.objs         |  1 +
 include/qemu/module.h |  1 +
 include/ui/console.h  | 75 ++++++++-------------------------------------------
 ui/console.c          | 59 ++++++++++++++++++++++++++++++++++++++++
 ui/curses.c           | 14 +++++++++-
 ui/egl-headless.c     | 20 +++++++++++++-
 ui/gtk.c              | 17 ++++++++++--
 ui/sdl.c              | 24 +++++++++--------
 ui/sdl2.c             | 17 ++++++++++--
 vl.c                  | 74 ++++++++------------------------------------------
 ui/Makefile.objs      | 31 +++++++++++++--------
 ui/cocoa.m            | 14 +++++++++-
 13 files changed, 208 insertions(+), 168 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 01/12] console: add qemu display registry, add gtk
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 02/12] sdl: switch over to new display registry Gerd Hoffmann
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Paolo Bonzini

Add a registry for user interfaces.  Add qemu_display_init and
qemu_display_early_init helper functions for display initialization.

Hook up gtk ui as first user.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-2-kraxel@redhat.com
---
 include/ui/console.h | 32 ++++++++++++--------------------
 ui/console.c         | 34 ++++++++++++++++++++++++++++++++++
 ui/gtk.c             | 17 +++++++++++++++--
 vl.c                 | 18 ++++++------------
 4 files changed, 67 insertions(+), 34 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index f29bacd625..817f9b9bcc 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -432,6 +432,18 @@ void surface_gl_setup_viewport(QemuGLShader *gls,
                                int ww, int wh);
 #endif
 
+typedef struct QemuDisplay QemuDisplay;
+
+struct QemuDisplay {
+    DisplayType type;
+    void (*early_init)(DisplayOptions *opts);
+    void (*init)(DisplayState *ds, DisplayOptions *opts);
+};
+
+void qemu_display_register(QemuDisplay *ui);
+void qemu_display_early_init(DisplayOptions *opts);
+void qemu_display_init(DisplayState *ds, DisplayOptions *opts);
+
 /* sdl.c */
 #ifdef CONFIG_SDL
 void sdl_display_early_init(DisplayOptions *opts);
@@ -487,26 +499,6 @@ static inline void curses_display_init(DisplayState *ds, DisplayOptions *opts)
 /* input.c */
 int index_from_key(const char *key, size_t key_length);
 
-/* gtk.c */
-#ifdef CONFIG_GTK
-void early_gtk_display_init(DisplayOptions *opts);
-void gtk_display_init(DisplayState *ds, DisplayOptions *opts);
-#else
-static inline void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
-{
-    /* This must never be called if CONFIG_GTK is disabled */
-    error_report("GTK support is disabled");
-    abort();
-}
-
-static inline void early_gtk_display_init(DisplayOptions *opts)
-{
-    /* This must never be called if CONFIG_GTK is disabled */
-    error_report("GTK support is disabled");
-    abort();
-}
-#endif
-
 /* egl-headless.c */
 void egl_headless_init(DisplayOptions *opts);
 
diff --git a/ui/console.c b/ui/console.c
index e22931a396..a11b120fc8 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2180,6 +2180,40 @@ PixelFormat qemu_default_pixelformat(int bpp)
     return pf;
 }
 
+static QemuDisplay *dpys[DISPLAY_TYPE__MAX];
+
+void qemu_display_register(QemuDisplay *ui)
+{
+    assert(ui->type < DISPLAY_TYPE__MAX);
+    dpys[ui->type] = ui;
+}
+
+void qemu_display_early_init(DisplayOptions *opts)
+{
+    assert(opts->type < DISPLAY_TYPE__MAX);
+    if (opts->type == DISPLAY_TYPE_NONE) {
+        return;
+    }
+    if (dpys[opts->type] == NULL) {
+        error_report("Display '%s' is not available.",
+                     DisplayType_lookup.array[opts->type]);
+        exit(1);
+    }
+    if (dpys[opts->type]->early_init) {
+        dpys[opts->type]->early_init(opts);
+    }
+}
+
+void qemu_display_init(DisplayState *ds, DisplayOptions *opts)
+{
+    assert(opts->type < DISPLAY_TYPE__MAX);
+    if (opts->type == DISPLAY_TYPE_NONE) {
+        return;
+    }
+    assert(dpys[opts->type] != NULL);
+    dpys[opts->type]->init(ds, opts);
+}
+
 void qemu_chr_parse_vc(QemuOpts *opts, ChardevBackend *backend, Error **errp)
 {
     int val;
diff --git a/ui/gtk.c b/ui/gtk.c
index ab646b70e1..c63408e036 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2297,7 +2297,7 @@ static void gd_create_menus(GtkDisplayState *s)
 
 static gboolean gtkinit;
 
-void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
+static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
 {
     VirtualConsole *vc;
 
@@ -2407,7 +2407,7 @@ void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
     }
 }
 
-void early_gtk_display_init(DisplayOptions *opts)
+static void early_gtk_display_init(DisplayOptions *opts)
 {
     /* The QEMU code relies on the assumption that it's always run in
      * the C locale. Therefore it is not prepared to deal with
@@ -2450,3 +2450,16 @@ void early_gtk_display_init(DisplayOptions *opts)
     type_register(&char_gd_vc_type_info);
 #endif
 }
+
+static QemuDisplay qemu_display_gtk = {
+    .type       = DISPLAY_TYPE_GTK,
+    .early_init = early_gtk_display_init,
+    .init       = gtk_display_init,
+};
+
+static void register_gtk(void)
+{
+    qemu_display_register(&qemu_display_gtk);
+}
+
+type_init(register_gtk);
diff --git a/vl.c b/vl.c
index 9e7235df6d..70458ba708 100644
--- a/vl.c
+++ b/vl.c
@@ -2173,7 +2173,6 @@ static void parse_display(const char *p)
         exit(1);
 #endif
     } else if (strstart(p, "gtk", &opts)) {
-#ifdef CONFIG_GTK
         dpy.type = DISPLAY_TYPE_GTK;
         while (*opts) {
             const char *nextopt;
@@ -2205,10 +2204,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 {
@@ -4318,6 +4313,9 @@ int main(int argc, char **argv, char **envp)
         dpy.type = DISPLAY_TYPE_NONE;
 #endif
     }
+    if (dpy.type == DISPLAY_TYPE_DEFAULT) {
+        dpy.type = DISPLAY_TYPE_NONE;
+    }
 
     if ((no_frame || alt_grab || ctrl_grab) && dpy.type != DISPLAY_TYPE_SDL) {
         error_report("-no-frame, -alt-grab and -ctrl-grab are only valid "
@@ -4329,12 +4327,10 @@ 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);
+    } else {
+        qemu_display_early_init(&dpy);
     }
 
     qemu_console_early_init();
@@ -4674,10 +4670,8 @@ int main(int argc, char **argv, char **envp)
     case DISPLAY_TYPE_COCOA:
         cocoa_display_init(ds, &dpy);
         break;
-    case DISPLAY_TYPE_GTK:
-        gtk_display_init(ds, &dpy);
-        break;
     default:
+        qemu_display_init(ds, &dpy);
         break;
     }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 02/12] sdl: switch over to new display registry
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 01/12] console: add qemu display registry, add gtk Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 03/12] cocoa: " Gerd Hoffmann
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Paolo Bonzini

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-3-kraxel@redhat.com
---
 include/ui/console.h | 19 -------------------
 ui/sdl.c             | 24 +++++++++++++-----------
 ui/sdl2.c            | 17 +++++++++++++++--
 vl.c                 | 15 +--------------
 4 files changed, 29 insertions(+), 46 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 817f9b9bcc..cb86e6a0dd 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -444,25 +444,6 @@ void qemu_display_register(QemuDisplay *ui);
 void qemu_display_early_init(DisplayOptions *opts);
 void qemu_display_init(DisplayState *ds, DisplayOptions *opts);
 
-/* sdl.c */
-#ifdef CONFIG_SDL
-void sdl_display_early_init(DisplayOptions *opts);
-void sdl_display_init(DisplayState *ds, DisplayOptions *opts);
-#else
-static inline void sdl_display_early_init(DisplayOptions *opts)
-{
-    /* This must never be called if CONFIG_SDL is disabled */
-    error_report("SDL support is disabled");
-    abort();
-}
-static inline void sdl_display_init(DisplayState *ds, DisplayOptions *opts)
-{
-    /* This must never be called if CONFIG_SDL is disabled */
-    error_report("SDL support is disabled");
-    abort();
-}
-#endif
-
 /* cocoa.m */
 #ifdef CONFIG_COCOA
 void cocoa_display_init(DisplayState *ds, DisplayOptions *opts);
diff --git a/ui/sdl.c b/ui/sdl.c
index c4ae7ab05d..a5fd503c25 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -901,17 +901,7 @@ static const DisplayChangeListenerOps dcl_ops = {
     .dpy_cursor_define    = sdl_mouse_define,
 };
 
-void sdl_display_early_init(DisplayOptions *opts)
-{
-    if (opts->has_gl && opts->gl) {
-        fprintf(stderr,
-                "SDL1 display code has no opengl support.\n"
-                "Please recompile qemu with SDL2, using\n"
-                "./configure --enable-sdl --with-sdlabi=2.0\n");
-    }
-}
-
-void sdl_display_init(DisplayState *ds, DisplayOptions *o)
+static void sdl1_display_init(DisplayState *ds, DisplayOptions *o)
 {
     int flags;
     uint8_t data = 0;
@@ -1023,3 +1013,15 @@ void sdl_display_init(DisplayState *ds, DisplayOptions *o)
 
     atexit(sdl_cleanup);
 }
+
+static QemuDisplay qemu_display_sdl1 = {
+    .type       = DISPLAY_TYPE_SDL,
+    .init       = sdl1_display_init,
+};
+
+static void register_sdl1(void)
+{
+    qemu_display_register(&qemu_display_sdl1);
+}
+
+type_init(register_sdl1);
diff --git a/ui/sdl2.c b/ui/sdl2.c
index b5a0fa1d13..83b917fa37 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -751,7 +751,7 @@ static const DisplayChangeListenerOps dcl_gl_ops = {
 };
 #endif
 
-void sdl_display_early_init(DisplayOptions *o)
+static void sdl2_display_early_init(DisplayOptions *o)
 {
     assert(o->type == DISPLAY_TYPE_SDL);
     if (o->has_gl && o->gl) {
@@ -761,7 +761,7 @@ void sdl_display_early_init(DisplayOptions *o)
     }
 }
 
-void sdl_display_init(DisplayState *ds, DisplayOptions *o)
+static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
 {
     int flags;
     uint8_t data = 0;
@@ -861,3 +861,16 @@ void sdl_display_init(DisplayState *ds, DisplayOptions *o)
 
     atexit(sdl_cleanup);
 }
+
+static QemuDisplay qemu_display_sdl2 = {
+    .type       = DISPLAY_TYPE_SDL,
+    .early_init = sdl2_display_early_init,
+    .init       = sdl2_display_init,
+};
+
+static void register_sdl1(void)
+{
+    qemu_display_register(&qemu_display_sdl2);
+}
+
+type_init(register_sdl1);
diff --git a/vl.c b/vl.c
index 70458ba708..45900ba7e6 100644
--- a/vl.c
+++ b/vl.c
@@ -2085,7 +2085,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;
@@ -2146,10 +2145,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);
@@ -4327,12 +4322,7 @@ int main(int argc, char **argv, char **envp)
                      "ignoring option");
     }
 
-    if (dpy.type == DISPLAY_TYPE_SDL) {
-        sdl_display_early_init(&dpy);
-    } else {
-        qemu_display_early_init(&dpy);
-    }
-
+    qemu_display_early_init(&dpy);
     qemu_console_early_init();
 
     if (dpy.has_gl && dpy.gl && display_opengl == 0) {
@@ -4664,9 +4654,6 @@ int main(int argc, char **argv, char **envp)
     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;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 03/12] cocoa: switch over to new display registry
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 01/12] console: add qemu display registry, add gtk Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 02/12] sdl: switch over to new display registry Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 04/12] curses: " Gerd Hoffmann
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Peter Maydell, Paolo Bonzini

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-4-kraxel@redhat.com
---
 include/ui/console.h | 12 ------------
 vl.c                 |  3 ---
 ui/cocoa.m           | 14 +++++++++++++-
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index cb86e6a0dd..f8c462106a 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -444,18 +444,6 @@ void qemu_display_register(QemuDisplay *ui);
 void qemu_display_early_init(DisplayOptions *opts);
 void qemu_display_init(DisplayState *ds, DisplayOptions *opts);
 
-/* cocoa.m */
-#ifdef CONFIG_COCOA
-void cocoa_display_init(DisplayState *ds, DisplayOptions *opts);
-#else
-static inline void cocoa_display_init(DisplayState *ds, DisplayOptions *opts)
-{
-    /* This must never be called if CONFIG_COCOA is disabled */
-    error_report("Cocoa support is disabled");
-    abort();
-}
-#endif
-
 /* vnc.c */
 void vnc_display_init(const char *id);
 void vnc_display_open(const char *id, Error **errp);
diff --git a/vl.c b/vl.c
index 45900ba7e6..2c3cb4651c 100644
--- a/vl.c
+++ b/vl.c
@@ -4654,9 +4654,6 @@ int main(int argc, char **argv, char **envp)
     case DISPLAY_TYPE_CURSES:
         curses_display_init(ds, &dpy);
         break;
-    case DISPLAY_TYPE_COCOA:
-        cocoa_display_init(ds, &dpy);
-        break;
     default:
         qemu_display_init(ds, &dpy);
         break;
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 90d9aa57ea..8b0dce90cb 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1683,7 +1683,7 @@ static void addRemovableDevicesMenuItems(void)
     qapi_free_BlockInfoList(pointerToFree);
 }
 
-void cocoa_display_init(DisplayState *ds, DisplayOptions *opts)
+static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts)
 {
     COCOA_DEBUG("qemu_cocoa: cocoa_display_init\n");
 
@@ -1713,3 +1713,15 @@ void cocoa_display_init(DisplayState *ds, DisplayOptions *opts)
      */
     addRemovableDevicesMenuItems();
 }
+
+static QemuDisplay qemu_display_cocoa = {
+    .type       = DISPLAY_TYPE_COCOA,
+    .init       = cocoa_display_init,
+};
+
+static void register_cocoa(void)
+{
+    qemu_display_register(&qemu_display_cocoa);
+}
+
+type_init(register_cocoa);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 04/12] curses: switch over to new display registry
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 03/12] cocoa: " Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 05/12] egl-headless: " Gerd Hoffmann
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Paolo Bonzini

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-5-kraxel@redhat.com
---
 include/ui/console.h | 12 ------------
 ui/curses.c          | 14 +++++++++++++-
 vl.c                 | 17 ++---------------
 3 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index f8c462106a..3ea6cf0870 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -453,18 +453,6 @@ int vnc_display_pw_expire(const char *id, time_t expires);
 QemuOpts *vnc_parse(const char *str, Error **errp);
 int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp);
 
-/* curses.c */
-#ifdef CONFIG_CURSES
-void curses_display_init(DisplayState *ds, DisplayOptions *opts);
-#else
-static inline void curses_display_init(DisplayState *ds, DisplayOptions *opts)
-{
-    /* This must never be called if CONFIG_CURSES is disabled */
-    error_report("curses support is disabled");
-    abort();
-}
-#endif
-
 /* input.c */
 int index_from_key(const char *key, size_t key_length);
 
diff --git a/ui/curses.c b/ui/curses.c
index 597e47fd4a..59d819fd4d 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -435,7 +435,7 @@ static const DisplayChangeListenerOps dcl_ops = {
     .dpy_text_cursor = curses_cursor_position,
 };
 
-void curses_display_init(DisplayState *ds, DisplayOptions *opts)
+static void curses_display_init(DisplayState *ds, DisplayOptions *opts)
 {
 #ifndef _WIN32
     if (!isatty(1)) {
@@ -456,3 +456,15 @@ void curses_display_init(DisplayState *ds, DisplayOptions *opts)
 
     invalidate = 1;
 }
+
+static QemuDisplay qemu_display_curses = {
+    .type       = DISPLAY_TYPE_CURSES,
+    .init       = curses_display_init,
+};
+
+static void register_curses(void)
+{
+    qemu_display_register(&qemu_display_curses);
+}
+
+type_init(register_curses);
diff --git a/vl.c b/vl.c
index 2c3cb4651c..2b4af34fbb 100644
--- a/vl.c
+++ b/vl.c
@@ -2161,12 +2161,7 @@ static void parse_display(const char *p)
         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)) {
         dpy.type = DISPLAY_TYPE_GTK;
         while (*opts) {
@@ -4647,17 +4642,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;
-    default:
-        qemu_display_init(ds, &dpy);
-        break;
-    }
+    ds = init_displaystate();
+    qemu_display_init(ds, &dpy);
 
     /* must be after terminal init, SDL library changes signal handlers */
     os_setup_signal_handling();
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 05/12] egl-headless: switch over to new display registry
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 04/12] curses: " Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 06/12] console: add and use qemu_display_find_default Gerd Hoffmann
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Paolo Bonzini

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-6-kraxel@redhat.com
---
 include/ui/console.h |  3 ---
 ui/egl-headless.c    | 20 +++++++++++++++++++-
 vl.c                 | 12 ------------
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 3ea6cf0870..94726cf190 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -456,7 +456,4 @@ int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp);
 /* input.c */
 int index_from_key(const char *key, size_t key_length);
 
-/* egl-headless.c */
-void egl_headless_init(DisplayOptions *opts);
-
 #endif
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index b33e0b21fd..7c877122d3 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -164,7 +164,12 @@ static const DisplayChangeListenerOps egl_ops = {
     .dpy_gl_update           = egl_scanout_flush,
 };
 
-void egl_headless_init(DisplayOptions *opts)
+static void early_egl_headless_init(DisplayOptions *opts)
+{
+    display_opengl = 1;
+}
+
+static void egl_headless_init(DisplayState *ds, DisplayOptions *opts)
 {
     QemuConsole *con;
     egl_dpy *edpy;
@@ -188,3 +193,16 @@ void egl_headless_init(DisplayOptions *opts)
         register_displaychangelistener(&edpy->dcl);
     }
 }
+
+static QemuDisplay qemu_display_egl = {
+    .type       = DISPLAY_TYPE_EGL_HEADLESS,
+    .early_init = early_egl_headless_init,
+    .init       = egl_headless_init,
+};
+
+static void register_egl(void)
+{
+    qemu_display_register(&qemu_display_egl);
+}
+
+type_init(register_egl);
diff --git a/vl.c b/vl.c
index 2b4af34fbb..47c953f8dc 100644
--- a/vl.c
+++ b/vl.c
@@ -2153,13 +2153,7 @@ 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)) {
         dpy.type = DISPLAY_TYPE_CURSES;
     } else if (strstart(p, "gtk", &opts)) {
@@ -4659,12 +4653,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);
     }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 06/12] console: add and use qemu_display_find_default
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 05/12] egl-headless: " Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 07/12] console: add ui module loading support Gerd Hoffmann
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Paolo Bonzini

Using the new display registry instead of #ifdefs in vl.c.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-7-kraxel@redhat.com
---
 include/ui/console.h |  1 +
 ui/console.c         | 19 +++++++++++++++++++
 vl.c                 | 15 +++++----------
 3 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 94726cf190..3a53db9360 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -441,6 +441,7 @@ struct QemuDisplay {
 };
 
 void qemu_display_register(QemuDisplay *ui);
+bool qemu_display_find_default(DisplayOptions *opts);
 void qemu_display_early_init(DisplayOptions *opts);
 void qemu_display_init(DisplayState *ds, DisplayOptions *opts);
 
diff --git a/ui/console.c b/ui/console.c
index a11b120fc8..25d342cdcb 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2188,6 +2188,25 @@ void qemu_display_register(QemuDisplay *ui)
     dpys[ui->type] = ui;
 }
 
+bool qemu_display_find_default(DisplayOptions *opts)
+{
+    static DisplayType prio[] = {
+        DISPLAY_TYPE_GTK,
+        DISPLAY_TYPE_SDL,
+        DISPLAY_TYPE_COCOA
+    };
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(prio); i++) {
+        if (dpys[prio[i]] == NULL) {
+            continue;
+        }
+        opts->type = prio[i];
+        return true;
+    }
+    return false;
+}
+
 void qemu_display_early_init(DisplayOptions *opts)
 {
     assert(opts->type < DISPLAY_TYPE__MAX);
diff --git a/vl.c b/vl.c
index 47c953f8dc..59e56593f8 100644
--- a/vl.c
+++ b/vl.c
@@ -4285,17 +4285,12 @@ 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;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 07/12] console: add ui module loading support
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 06/12] console: add and use qemu_display_find_default Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 08/12] configure: add X11 vars to config-host.mak Gerd Hoffmann
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

If a requested user interface is not available, try loading it as
module, simliar to block layer modules.  Needed to keep things working
when followup patches start to build user interfaces as modules.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-8-kraxel@redhat.com
---
 include/qemu/module.h | 1 +
 ui/console.c          | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/include/qemu/module.h b/include/qemu/module.h
index 56dd218205..9fea75aaeb 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -53,6 +53,7 @@ typedef enum {
 #define trace_init(function) module_init(function, MODULE_INIT_TRACE)
 
 #define block_module_load_one(lib) module_load_one("block-", lib)
+#define ui_module_load_one(lib) module_load_one("ui-", lib)
 
 void register_module_init(void (*fn)(void), module_init_type type);
 void register_dso_module_init(void (*fn)(void), module_init_type type);
diff --git a/ui/console.c b/ui/console.c
index 25d342cdcb..78efab269a 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2199,6 +2199,9 @@ bool qemu_display_find_default(DisplayOptions *opts)
 
     for (i = 0; i < ARRAY_SIZE(prio); i++) {
         if (dpys[prio[i]] == NULL) {
+            ui_module_load_one(DisplayType_lookup.array[prio[i]]);
+        }
+        if (dpys[prio[i]] == NULL) {
             continue;
         }
         opts->type = prio[i];
@@ -2214,6 +2217,9 @@ void qemu_display_early_init(DisplayOptions *opts)
         return;
     }
     if (dpys[opts->type] == NULL) {
+        ui_module_load_one(DisplayType_lookup.array[opts->type]);
+    }
+    if (dpys[opts->type] == NULL) {
         error_report("Display '%s' is not available.",
                      DisplayType_lookup.array[opts->type]);
         exit(1);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 08/12] configure: add X11 vars to config-host.mak
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (6 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 07/12] console: add ui module loading support Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 09/12] configure: opengl doesn't depend on x11 Gerd Hoffmann
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Simplifies handling the X11 dependency,
also makes ui/Makefile.objs more readable.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-9-kraxel@redhat.com
---
 configure        | 10 ++++++++--
 ui/Makefile.objs |  5 ++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 39f3a43001..f6dc1c92b3 100755
--- a/configure
+++ b/configure
@@ -2509,9 +2509,8 @@ fi
 
 ##########################################
 # X11 probe
-x11_cflags=
-x11_libs=-lX11
 if $pkg_config --exists "x11"; then
+    have_x11=yes
     x11_cflags=$($pkg_config --cflags x11)
     x11_libs=$($pkg_config --libs x11)
 fi
@@ -2544,6 +2543,7 @@ if test "$gtk" != "no"; then
         gtk_libs=$($pkg_config --libs $gtkpackage)
         gtk_version=$($pkg_config --modversion $gtkpackage)
         if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
+            need_x11=yes
             gtk_cflags="$gtk_cflags $x11_cflags"
             gtk_libs="$gtk_libs $x11_libs"
         fi
@@ -2912,6 +2912,7 @@ if test "$sdl" = "yes" ; then
 int main(void) { return 0; }
 EOF
   if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then
+    need_x11=yes
     sdl_cflags="$sdl_cflags $x11_cflags"
     sdl_libs="$sdl_libs $x11_libs"
   fi
@@ -6024,6 +6025,11 @@ if test "$modules" = "yes"; then
   echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
   echo "CONFIG_MODULES=y" >> $config_host_mak
 fi
+if test "$have_x11" = "yes" -a "$need_x11" = "yes"; then
+  echo "CONFIG_X11=y" >> $config_host_mak
+  echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak
+  echo "X11_LIBS=$x11_libs" >> $config_host_mak
+fi
 if test "$sdl" = "yes" ; then
   echo "CONFIG_SDL=y" >> $config_host_mak
   echo "CONFIG_SDLABI=$sdlabi" >> $config_host_mak
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index ced7d91a63..9b725b07aa 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -17,7 +17,10 @@ common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
 common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o
 common-obj-$(CONFIG_GTK) += gtk.o
-common-obj-$(if $(CONFIG_WIN32),n,$(if $(CONFIG_SDL),y,$(CONFIG_GTK))) += x_keymap.o
+
+common-obj-$(CONFIG_X11) += x_keymap.o
+x_keymap.o-cflags := $(X11_CFLAGS)
+x_keymap.o-libs := $(X11_LIBS)
 
 ifeq ($(CONFIG_SDLABI),1.2)
 sdl.mo-objs := sdl.o sdl_zoom.o
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 09/12] configure: opengl doesn't depend on x11
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (7 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 08/12] configure: add X11 vars to config-host.mak Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 10/12] sdl: build as ui module Gerd Hoffmann
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

So remove x11 from pkg-config check and don't
add x11 cflags/libs to opengl cflags/libs.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-10-kraxel@redhat.com
---
 configure | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index f6dc1c92b3..ab1ba9c47d 100755
--- a/configure
+++ b/configure
@@ -3768,9 +3768,9 @@ libs_softmmu="$libs_softmmu $fdt_libs"
 
 if test "$opengl" != "no" ; then
   opengl_pkgs="epoxy libdrm gbm"
-  if $pkg_config $opengl_pkgs x11; then
-    opengl_cflags="$($pkg_config --cflags $opengl_pkgs) $x11_cflags"
-    opengl_libs="$($pkg_config --libs $opengl_pkgs) $x11_libs"
+  if $pkg_config $opengl_pkgs; then
+    opengl_cflags="$($pkg_config --cflags $opengl_pkgs)"
+    opengl_libs="$($pkg_config --libs $opengl_pkgs)"
     opengl=yes
     if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then
         gtk_gl="yes"
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 10/12] sdl: build as ui module
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (8 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 09/12] configure: opengl doesn't depend on x11 Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 11/12] gtk: " Gerd Hoffmann
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Shared library dependencies dropped from qemu-system-*:

libSDL2-2.0.so.0 => /lib64/libSDL2-2.0.so.0

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-11-kraxel@redhat.com
---
 configure        | 2 +-
 Makefile.objs    | 1 +
 ui/Makefile.objs | 3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index ab1ba9c47d..edbc568913 100755
--- a/configure
+++ b/configure
@@ -6031,7 +6031,7 @@ if test "$have_x11" = "yes" -a "$need_x11" = "yes"; then
   echo "X11_LIBS=$x11_libs" >> $config_host_mak
 fi
 if test "$sdl" = "yes" ; then
-  echo "CONFIG_SDL=y" >> $config_host_mak
+  echo "CONFIG_SDL=m" >> $config_host_mak
   echo "CONFIG_SDLABI=$sdlabi" >> $config_host_mak
   echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
   echo "SDL_LIBS=$sdl_libs" >> $config_host_mak
diff --git a/Makefile.objs b/Makefile.objs
index 5dc134818c..57ca6d908b 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -56,6 +56,7 @@ common-obj-y += hw/
 common-obj-y += replay/
 
 common-obj-y += ui/
+common-obj-m += ui/
 common-obj-y += bt-host.o bt-vhci.o
 bt-host.o-cflags := $(BLUEZ_CFLAGS)
 
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index 9b725b07aa..ef4bd83fde 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -11,7 +11,6 @@ common-obj-y += keymaps.o console.o cursor.o qemu-pixman.o
 common-obj-y += input.o input-keymap.o input-legacy.o
 common-obj-$(CONFIG_LINUX) += input-linux.o
 common-obj-$(CONFIG_SPICE) += spice-core.o spice-input.o spice-display.o
-common-obj-$(CONFIG_SDL) += sdl.mo
 common-obj-$(CONFIG_COCOA) += cocoa.o
 common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
@@ -22,6 +21,8 @@ common-obj-$(CONFIG_X11) += x_keymap.o
 x_keymap.o-cflags := $(X11_CFLAGS)
 x_keymap.o-libs := $(X11_LIBS)
 
+# ui-sdl module
+common-obj-$(CONFIG_SDL) += sdl.mo
 ifeq ($(CONFIG_SDLABI),1.2)
 sdl.mo-objs := sdl.o sdl_zoom.o
 endif
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 11/12] gtk: build as ui module
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (9 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 10/12] sdl: build as ui module Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27  8:07 ` [Qemu-devel] [PULL 12/12] curses: " Gerd Hoffmann
  2018-02-27 17:46 ` [Qemu-devel] [PULL 00/12] Ui 20180227 patches Peter Maydell
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Also drop gtk and vte libs from libs_softmmu, so the libs are not
pulled in unless the gtk module actually gets loaded.

Shared library dependencies dropped from qemu-system-*:

libEGL.so.1 => /lib64/libEGL.so.1
libGL.so.1 => /lib64/libGL.so.1
libXcomposite.so.1 => /lib64/libXcomposite.so.1
libXcursor.so.1 => /lib64/libXcursor.so.1
libXdamage.so.1 => /lib64/libXdamage.so.1
libXfixes.so.3 => /lib64/libXfixes.so.3
libXinerama.so.1 => /lib64/libXinerama.so.1
libXrandr.so.2 => /lib64/libXrandr.so.2
libXrender.so.1 => /lib64/libXrender.so.1
libXxf86vm.so.1 => /lib64/libXxf86vm.so.1
libatk-1.0.so.0 => /lib64/libatk-1.0.so.0
libatk-bridge-2.0.so.0 => /lib64/libatk-bridge-2.0.so.0
libatspi.so.0 => /lib64/libatspi.so.0
libcairo-gobject.so.2 => /lib64/libcairo-gobject.so.2
libcairo.so.2 => /lib64/libcairo.so.2
libfontconfig.so.1 => /lib64/libfontconfig.so.1
libfreetype.so.6 => /lib64/libfreetype.so.6
libgdk-3.so.0 => /lib64/libgdk-3.so.0
libgdk_pixbuf-2.0.so.0 => /lib64/libgdk_pixbuf-2.0.so.0
libglapi.so.0 => /lib64/libglapi.so.0
libgraphite2.so.3 => /lib64/libgraphite2.so.3
libgtk-3.so.0 => /lib64/libgtk-3.so.0
libharfbuzz.so.0 => /lib64/libharfbuzz.so.0
libpango-1.0.so.0 => /lib64/libpango-1.0.so.0
libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0
libpangoft2-1.0.so.0 => /lib64/libpangoft2-1.0.so.0
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
libthai.so.0 => /lib64/libthai.so.0
libvte-2.91.so.0 => /lib64/libvte-2.91.so.0
libwayland-cursor.so.0 => /lib64/libwayland-cursor.so.0
libwayland-egl.so.1 => /lib64/libwayland-egl.so.1
libxcb-dri2.so.0 => /lib64/libxcb-dri2.so.0
libxcb-dri3.so.0 => /lib64/libxcb-dri3.so.0
libxcb-glx.so.0 => /lib64/libxcb-glx.so.0
libxcb-present.so.0 => /lib64/libxcb-present.so.0
libxcb-render.so.0 => /lib64/libxcb-render.so.0
libxcb-shm.so.0 => /lib64/libxcb-shm.so.0
libxcb-sync.so.1 => /lib64/libxcb-sync.so.1
libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0
libxkbcommon.so.0 => /lib64/libxkbcommon.so.0
libxshmfence.so.1 => /lib64/libxshmfence.so.1

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-12-kraxel@redhat.com
---
 configure        |  5 ++---
 ui/Makefile.objs | 17 +++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index edbc568913..4cabdf8c9f 100755
--- a/configure
+++ b/configure
@@ -2547,7 +2547,6 @@ if test "$gtk" != "no"; then
             gtk_cflags="$gtk_cflags $x11_cflags"
             gtk_libs="$gtk_libs $x11_libs"
         fi
-        libs_softmmu="$gtk_libs $libs_softmmu"
         gtk="yes"
     elif test "$gtk" = "yes"; then
         feature_not_found "gtk" "Install gtk3-devel"
@@ -2797,7 +2796,6 @@ if test "$vte" != "no"; then
         vte_cflags=$($pkg_config --cflags $vtepackage)
         vte_libs=$($pkg_config --libs $vtepackage)
         vteversion=$($pkg_config --modversion $vtepackage)
-        libs_softmmu="$vte_libs $libs_softmmu"
         vte="yes"
     elif test "$vte" = "yes"; then
         if test "$gtkabi" = "3.0"; then
@@ -6137,7 +6135,7 @@ if test "$glib_subprocess" = "yes" ; then
   echo "CONFIG_HAS_GLIB_SUBPROCESS_TESTS=y" >> $config_host_mak
 fi
 if test "$gtk" = "yes" ; then
-  echo "CONFIG_GTK=y" >> $config_host_mak
+  echo "CONFIG_GTK=m" >> $config_host_mak
   echo "CONFIG_GTKABI=$gtkabi" >> $config_host_mak
   echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
   echo "GTK_LIBS=$gtk_libs" >> $config_host_mak
@@ -6188,6 +6186,7 @@ fi
 if test "$vte" = "yes" ; then
   echo "CONFIG_VTE=y" >> $config_host_mak
   echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
+  echo "VTE_LIBS=$vte_libs" >> $config_host_mak
 fi
 if test "$virglrenderer" = "yes" ; then
   echo "CONFIG_VIRGL=y" >> $config_host_mak
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index ef4bd83fde..9a0e8a94f1 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -15,7 +15,6 @@ common-obj-$(CONFIG_COCOA) += cocoa.o
 common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
 common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o
-common-obj-$(CONFIG_GTK) += gtk.o
 
 common-obj-$(CONFIG_X11) += x_keymap.o
 x_keymap.o-cflags := $(X11_CFLAGS)
@@ -35,6 +34,12 @@ endif
 sdl.mo-cflags := $(SDL_CFLAGS)
 sdl.mo-libs := $(SDL_LIBS)
 
+# ui-gtk module
+common-obj-$(CONFIG_GTK) += gtk.mo
+gtk.mo-objs := gtk.o
+gtk.mo-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
+gtk.mo-libs := $(GTK_LIBS) $(VTE_LIBS)
+
 ifeq ($(CONFIG_OPENGL),y)
 common-obj-y += shader.o
 common-obj-y += console-gl.o
@@ -42,17 +47,13 @@ common-obj-y += egl-helpers.o
 common-obj-y += egl-context.o
 common-obj-$(CONFIG_OPENGL_DMABUF) += egl-headless.o
 ifeq ($(CONFIG_GTK_GL),y)
-common-obj-$(CONFIG_GTK) += gtk-gl-area.o
+gtk.mo-objs += gtk-gl-area.o
 else
-common-obj-$(CONFIG_GTK) += gtk-egl.o
+gtk.mo-objs += gtk-egl.o
+gtk.mo-libs += $(OPENGL_LIBS)
 endif
 endif
 
-gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
-gtk-egl.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
-gtk-gl-area.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
-
-gtk-egl.o-libs += $(OPENGL_LIBS)
 shader.o-libs += $(OPENGL_LIBS)
 console-gl.o-libs += $(OPENGL_LIBS)
 egl-helpers.o-libs += $(OPENGL_LIBS)
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PULL 12/12] curses: build as ui module
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (10 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 11/12] gtk: " Gerd Hoffmann
@ 2018-02-27  8:07 ` Gerd Hoffmann
  2018-02-27 17:46 ` [Qemu-devel] [PULL 00/12] Ui 20180227 patches Peter Maydell
  12 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-27  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Also drop curses libs from libs_softmmu.  Add CURSES_{CFLAGS,LIBS}
variables so we can use them for linking the curses module.

Shared library dependencies dropped from qemu-system-*:

libncursesw.so.5 => /lib64/libncursesw.so.5
libtinfo.so.5 => /lib64/libtinfo.so.5

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180221131537.31341-13-kraxel@redhat.com
---
 configure        | 6 +++---
 ui/Makefile.objs | 6 +++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 4cabdf8c9f..cc43a634c1 100755
--- a/configure
+++ b/configure
@@ -3269,8 +3269,6 @@ EOF
       unset IFS
       if compile_prog "$curses_inc" "$curses_lib" ; then
         curses_found=yes
-        QEMU_CFLAGS="$curses_inc $QEMU_CFLAGS"
-        libs_softmmu="$curses_lib $libs_softmmu"
         break
       fi
     done
@@ -6038,7 +6036,9 @@ if test "$cocoa" = "yes" ; then
   echo "CONFIG_COCOA=y" >> $config_host_mak
 fi
 if test "$curses" = "yes" ; then
-  echo "CONFIG_CURSES=y" >> $config_host_mak
+  echo "CONFIG_CURSES=m" >> $config_host_mak
+  echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak
+  echo "CURSES_LIBS=$curses_lib" >> $config_host_mak
 fi
 if test "$pipe2" = "yes" ; then
   echo "CONFIG_PIPE2=y" >> $config_host_mak
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index 9a0e8a94f1..dcd54a5287 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -12,7 +12,6 @@ common-obj-y += input.o input-keymap.o input-legacy.o
 common-obj-$(CONFIG_LINUX) += input-linux.o
 common-obj-$(CONFIG_SPICE) += spice-core.o spice-input.o spice-display.o
 common-obj-$(CONFIG_COCOA) += cocoa.o
-common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
 common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o
 
@@ -40,6 +39,11 @@ gtk.mo-objs := gtk.o
 gtk.mo-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
 gtk.mo-libs := $(GTK_LIBS) $(VTE_LIBS)
 
+common-obj-$(CONFIG_CURSES) += curses.mo
+curses.mo-objs := curses.o
+curses.mo-cflags := $(CURSES_CFLAGS)
+curses.mo-libs := $(CURSES_LIBS)
+
 ifeq ($(CONFIG_OPENGL),y)
 common-obj-y += shader.o
 common-obj-y += console-gl.o
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PULL 00/12] Ui 20180227 patches
  2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
                   ` (11 preceding siblings ...)
  2018-02-27  8:07 ` [Qemu-devel] [PULL 12/12] curses: " Gerd Hoffmann
@ 2018-02-27 17:46 ` Peter Maydell
  2018-02-28  6:26   ` Gerd Hoffmann
  12 siblings, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2018-02-27 17:46 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 27 February 2018 at 08:07, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit 0a773d55ac76c5aa89ed9187a3bc5af8c5c2a6d0:
>
>   maintainers: Add myself as a OpenBSD maintainer (2018-02-23 12:05:07 +0000)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/ui-20180227-pull-request
>
> for you to fetch changes up to 8742dcaf7bcfa1ef8720f34dab984f153c87c9f3:
>
>   curses: build as ui module (2018-02-26 15:10:12 +0100)
>
> ----------------------------------------------------------------
> ui: add & use display registry, build some UIs as module.
>
> ----------------------------------------------------------------

Hi. This failed to build on my OpenBSD test box:

  CC      qga/guest-agent-command-state.o
In file included from /home/qemu/include/qemu/osdep.h:30:0,
                 from /home/qemu/qga/guest-agent-command-state.c:12:
./config-host.h:29:0: warning: "CONFIG_SDL" redefined
 #define CONFIG_SDL m
 ^
./config-host.h:17:0: note: this is the location of the previous definition
 #define CONFIG_SDL 1
 ^

(warning repeated for pretty much every object file)

and then linking of the final executables failed with

../audio/audio.o:(.data.rel.ro+0x0): undefined reference to `sdl_audio_driver'

thanks
-- PMM

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PULL 00/12] Ui 20180227 patches
  2018-02-27 17:46 ` [Qemu-devel] [PULL 00/12] Ui 20180227 patches Peter Maydell
@ 2018-02-28  6:26   ` Gerd Hoffmann
  2018-02-28 11:33     ` Peter Maydell
  0 siblings, 1 reply; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-28  6:26 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

  Hi,

> Hi. This failed to build on my OpenBSD test box:
> 
>   CC      qga/guest-agent-command-state.o
> In file included from /home/qemu/include/qemu/osdep.h:30:0,
>                  from /home/qemu/qga/guest-agent-command-state.c:12:
> ./config-host.h:29:0: warning: "CONFIG_SDL" redefined
>  #define CONFIG_SDL m
>  ^
> ./config-host.h:17:0: note: this is the location of the previous definition
>  #define CONFIG_SDL 1
>  ^
> 
> (warning repeated for pretty much every object file)
> 
> and then linking of the final executables failed with
> 
> ../audio/audio.o:(.data.rel.ro+0x0): undefined reference to `sdl_audio_driver'

Oh, right, there is sdl audio, completely forgot about that ...

(this probably triggers on openbsd because sdl audio is the default
there).

I think modularizing SDL isn't that easy then.
Can you just drop the "sdl: build as ui module" patch?

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PULL 00/12] Ui 20180227 patches
  2018-02-28  6:26   ` Gerd Hoffmann
@ 2018-02-28 11:33     ` Peter Maydell
  2018-02-28 12:18       ` Gerd Hoffmann
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2018-02-28 11:33 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 28 February 2018 at 06:26, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
>> Hi. This failed to build on my OpenBSD test box:
>>
>>   CC      qga/guest-agent-command-state.o
>> In file included from /home/qemu/include/qemu/osdep.h:30:0,
>>                  from /home/qemu/qga/guest-agent-command-state.c:12:
>> ./config-host.h:29:0: warning: "CONFIG_SDL" redefined
>>  #define CONFIG_SDL m
>>  ^
>> ./config-host.h:17:0: note: this is the location of the previous definition
>>  #define CONFIG_SDL 1
>>  ^
>>
>> (warning repeated for pretty much every object file)
>>
>> and then linking of the final executables failed with
>>
>> ../audio/audio.o:(.data.rel.ro+0x0): undefined reference to `sdl_audio_driver'
>
> Oh, right, there is sdl audio, completely forgot about that ...
>
> (this probably triggers on openbsd because sdl audio is the default
> there).
>
> I think modularizing SDL isn't that easy then.
> Can you just drop the "sdl: build as ui module" patch?

I can't drop patches from signed pull requests -- you need
to respin it.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PULL 00/12] Ui 20180227 patches
  2018-02-28 11:33     ` Peter Maydell
@ 2018-02-28 12:18       ` Gerd Hoffmann
  0 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2018-02-28 12:18 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

> > I think modularizing SDL isn't that easy then.
> > Can you just drop the "sdl: build as ui module" patch?
> 
> I can't drop patches from signed pull requests -- you need
> to respin it.

Ah, right, that would invalidate the signature.  Pull resent.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-02-28 12:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27  8:07 [Qemu-devel] [PULL 00/12] Ui 20180227 patches Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 01/12] console: add qemu display registry, add gtk Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 02/12] sdl: switch over to new display registry Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 03/12] cocoa: " Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 04/12] curses: " Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 05/12] egl-headless: " Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 06/12] console: add and use qemu_display_find_default Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 07/12] console: add ui module loading support Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 08/12] configure: add X11 vars to config-host.mak Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 09/12] configure: opengl doesn't depend on x11 Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 10/12] sdl: build as ui module Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 11/12] gtk: " Gerd Hoffmann
2018-02-27  8:07 ` [Qemu-devel] [PULL 12/12] curses: " Gerd Hoffmann
2018-02-27 17:46 ` [Qemu-devel] [PULL 00/12] Ui 20180227 patches Peter Maydell
2018-02-28  6:26   ` Gerd Hoffmann
2018-02-28 11:33     ` Peter Maydell
2018-02-28 12:18       ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.