aboutsummaryrefslogtreecommitdiff
path: root/ui/egl-headless.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/egl-headless.c')
-rw-r--r--ui/egl-headless.c20
1 files changed, 19 insertions, 1 deletions
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);