[Qemu-devel] [PULL 1/3] qapi: Add "rendernode" display option for egl-headless

Gerd Hoffmann posted 3 patches 6 years, 11 months ago
[Qemu-devel] [PULL 1/3] qapi: Add "rendernode" display option for egl-headless
Posted by Gerd Hoffmann 6 years, 11 months ago
From: Erik Skultety <eskultet@redhat.com>

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.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Message-id: 7658e15eca72d520e7a5fb1c2e724702d83d4f7f.1542362949.git.eskultet@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qapi/ui.json | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

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'} }
-- 
2.9.3


Re: [Qemu-devel] [PULL 1/3] qapi: Add "rendernode" display option for egl-headless
Posted by Eric Blake 6 years, 11 months ago
On 11/16/18 7:29 AM, Gerd Hoffmann wrote:
> From: Erik Skultety <eskultet@redhat.com>
> 
> 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.
> 
> Signed-off-by: Erik Skultety <eskultet@redhat.com>
> Message-id: 7658e15eca72d520e7a5fb1c2e724702d83d4f7f.1542362949.git.eskultet@redhat.com
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   qapi/ui.json | 17 ++++++++++++++++-
>   1 file changed, 16 insertions(+), 1 deletion(-)

This has already landed, but I noticed via an off-list discussion that 
it is not introspectible through query-qmp-schema, because 
DisplayOptions is currently used only for command line handling. I don't 
know off-hand whether query-command-line-options even exposes the 
existence of DisplayOptions (not all of our command line options can be 
queried), but even if it does, I also know that our current command line 
queries are not detailed enough to readily expose the addition of a new 
optional member.  I think it would be appropriate for the 3.1 timeframe 
to add a new QMP command that exposes the display configuration set up 
at runtime, if only so that the DisplayOptions becomes visible through 
query-qmp-commands as a bug fix for making this change easier to use.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PULL 1/3] qapi: Add "rendernode" display option for egl-headless
Posted by Erik Skultety 6 years, 11 months ago
On Mon, Nov 19, 2018 at 07:10:21AM -0600, Eric Blake wrote:
> On 11/16/18 7:29 AM, Gerd Hoffmann wrote:
> > From: Erik Skultety <eskultet@redhat.com>
> >
> > 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.
> >
> > Signed-off-by: Erik Skultety <eskultet@redhat.com>
> > Message-id: 7658e15eca72d520e7a5fb1c2e724702d83d4f7f.1542362949.git.eskultet@redhat.com
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >   qapi/ui.json | 17 ++++++++++++++++-
> >   1 file changed, 16 insertions(+), 1 deletion(-)
>
> This has already landed, but I noticed via an off-list discussion that it is
> not introspectible through query-qmp-schema, because DisplayOptions is
> currently used only for command line handling. I don't know off-hand whether
> query-command-line-options even exposes the existence of DisplayOptions (not

It does not...

> all of our command line options can be queried), but even if it does, I also
> know that our current command line queries are not detailed enough to
> readily expose the addition of a new optional member.  I think it would be
> appropriate for the 3.1 timeframe to add a new QMP command that exposes the
> display configuration set up at runtime, if only so that the DisplayOptions
> becomes visible through query-qmp-commands as a bug fix for making this
> change easier to use.

That would be awesome

Erik