Introduce 'rendernode' option for egl-headless display type
v2 cover Introduce 'rendernode' option for egl-headless display type
https://bugzilla.redhat.com/show_bug.cgi?id=1648236
Changes since v1:
- adjusted the QAPI version and description commentaries for egl-headless
Erik Skultety (3):
qapi: Add "rendernode" display option for egl-headless
ui: Allow specifying 'rendernode' display option for egl-headless
help: Provide help for egl-headless
qapi/ui.json | 17 ++++++++++++++++- qemu-options.hx | 6 +++++- ui/egl-headless.c | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-)
--
2.19.1
PATCH v2 1/3 qapi: Add "rendernode" display option for egl-headless
Unlike SPICE, egl-headless doesn't offer a way of specifying the DRM node used for OpenGL, hence QEMU always selecting the first one that is available. Thus, add the 'rendernode' option for egl-headless to QAPI.
--- qapi/ui.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
qapi/ui.json +16 -1
@@ -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'} }
Signature · 1 line
2.19.1
PATCH v2 2/3 ui: Allow specifying 'rendernode' display option for egl-headless
In reply to Erik SkultetyAs libvirt can't predict which rendernode QEMU would pick, it won't adjust the permissions on the device, hence QEMU getting "Permission denied" when opening the DRI device. Therefore, enable 'rendernode' option for egl-headless display type.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1648236
--- ui/egl-headless.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ui/egl-headless.c +1 -1
@@ -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 ); }
Signature · 1 line
2.19.1
PATCH v2 3/3 help: Provide help for egl-headless
In reply to Erik SkultetyEGL headless has been missing from QEMU's help or man page, we should mention that such a thing exists, especially since projects like libvirt might rely on that. This patch also adds the newly introduced option for egl-headless 'rendernode'.
--- qemu-options.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
qemu-options.hx +5 -1
@@ -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
Signature · 1 line
2.19.1