]> git.proxmox.com Git - mirror_qemu.git/commitdiff
egl-headless: use DisplayOptions
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 2 Feb 2018 11:10:17 +0000 (12:10 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 20 Feb 2018 11:12:04 +0000 (12:12 +0100)
Switch egl-headless ui to use qapi DisplayOptions for configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-8-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
include/ui/console.h
qapi/ui.json
ui/egl-headless.c
vl.c

index 4e4d0279361822628be12174c7570f8c83ee2a84..183d9f2913e16e950e7d6538208fea3587396d70 100644 (file)
@@ -505,6 +505,6 @@ static inline void early_gtk_display_init(DisplayOptions *opts)
 #endif
 
 /* egl-headless.c */
-void egl_headless_init(void);
+void egl_headless_init(DisplayOptions *opts);
 
 #endif
index 2efe9675b713cbb37f30bb57341ae149c8b1d670..43de75fa27d6a5f90db874400c492c1871207061 100644 (file)
 #
 ##
 { 'enum'    : 'DisplayType',
-  'data'    : [ 'none', 'gtk', 'sdl' ] }
+  'data'    : [ 'none', 'gtk', 'sdl', 'egl-headless' ] }
 
 ##
 # @DisplayOptions:
   'discriminator' : 'type',
   'data'    : { 'none'           : 'DisplayNoOpts',
                 'gtk'            : 'DisplayGTK',
-                'sdl'            : 'DisplayNoOpts' } }
+                'sdl'            : 'DisplayNoOpts',
+                'egl-headless'   : 'DisplayNoOpts' } }
index 5d50226869b4bce090aba4f9a1753cd03b99dc5f..38b3766548b6f1c36a982788252d28cc07134351 100644 (file)
@@ -154,7 +154,7 @@ static const DisplayChangeListenerOps egl_ops = {
     .dpy_gl_update           = egl_scanout_flush,
 };
 
-void egl_headless_init(void)
+void egl_headless_init(DisplayOptions *opts)
 {
     QemuConsole *con;
     egl_dpy *edpy;
diff --git a/vl.c b/vl.c
index f52bc3b87973123028e26debd080095767562c9f..38c18ef2e6193d1be062eb5ff243c8e107787cb0 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -2178,6 +2178,7 @@ static LegacyDisplayType select_display(const char *p)
         request_opengl = 1;
         display_opengl = 1;
         display = DT_EGL;
+        dpy.type = DISPLAY_TYPE_EGL_HEADLESS;
 #else
         error_report("egl support is disabled");
         exit(1);
@@ -4726,7 +4727,7 @@ int main(int argc, char **argv, char **envp)
 
 #ifdef CONFIG_OPENGL_DMABUF
     if (display_type == DT_EGL) {
-        egl_headless_init();
+        egl_headless_init(&dpy);
     }
 #endif