summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qapi/ui.json17
-rw-r--r--qemu-options.hx6
-rw-r--r--ui/egl-headless.c2
3 files changed, 22 insertions, 3 deletions
diff --git a/qapi/ui.json b/qapi/ui.json
index bf9e157d5a..e0000248d3 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1037,6 +1037,20 @@
'data' : { '*grab-on-hover' : 'bool',
'*zoom-to-fit' : 'bool' } }
+##
+# @DisplayEGLHeadless:
+#
+# EGL headless display options.
+#
+# @rendernode: Which DRM render node should be used. Default is the first
+# available node on the host.
+#
+# Since: 3.1
+#
+##
+{ 'struct' : 'DisplayEGLHeadless',
+ 'data' : { '*rendernode' : 'str' } }
+
##
# @DisplayGLMode:
#
@@ -1086,4 +1100,5 @@
'*window-close' : 'bool',
'*gl' : 'DisplayGLMode' },
'discriminator' : 'type',
- 'data' : { 'gtk' : 'DisplayGTK' } }
+ 'data' : { 'gtk' : 'DisplayGTK',
+ 'egl-headless' : 'DisplayEGLHeadless'} }
diff --git a/qemu-options.hx b/qemu-options.hx
index ee379b32e3..f7df472f43 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1216,7 +1216,8 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
"-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
"-display vnc=<display>[,<optargs>]\n"
"-display curses\n"
- "-display none"
+ "-display none\n"
+ "-display egl-headless[,rendernode=<file>]"
" select display type\n"
"The default display is equivalent to\n"
#if defined(CONFIG_GTK)
@@ -1258,6 +1259,9 @@ menus and other UI elements to configure and control the VM during
runtime.
@item vnc
Start a VNC server on display <arg>
+@item egl-headless
+Offload all OpenGL operations to a local DRI device. For any graphical display,
+this display needs to be paired with either VNC or SPICE displays.
@end table
ETEXI
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index 42a41310b0..4cf3bbc0e4 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -176,7 +176,7 @@ static void egl_headless_init(DisplayState *ds, DisplayOptions *opts)
egl_dpy *edpy;
int idx;
- if (egl_rendernode_init(NULL, mode) < 0) {
+ if (egl_rendernode_init(opts->u.egl_headless.rendernode, mode) < 0) {
error_report("egl: render node init failed");
exit(1);
}