Re: [libvirt] [PATCH v4 04/10] qemu: Introduce a new graphics display type 'headless'

2018-07-18 Thread Ján Tomko

On Wed, Jul 18, 2018 at 02:31:40PM +0200, Erik Skultety wrote:

Since 2.10 QEMU supports a new display type egl-headless which uses the
drm nodes for OpenGL rendering copying back the rendered bits back to
QEMU into a dma-buf which can be accessed by standard "display" apps
like VNC or SPICE. Although this display type can be used on its own,
for any practical use case it makes sense to pair it with either VNC or
SPICE display. The clear benefit of this display is that VNC gains
OpenGL support, which it natively doesn't have, and SPICE gains remote
OpenGL support (native OpenGL support only works locally through a UNIX
socket, i.e. listen type=socket/none)

Signed-off-by: Erik Skultety 
---
docs/formatdomain.html.in  | 33 +++-
docs/schemas/domaincommon.rng  |  3 ++
src/conf/domain_conf.c |  6 ++-
src/conf/domain_conf.h |  1 +
src/libxl/libxl_conf.c |  1 +
src/qemu/qemu_command.c| 14 -
src/qemu/qemu_domain.c | 60 +-
src/qemu/qemu_driver.c |  2 +
src/qemu/qemu_hotplug.c|  1 +
src/qemu/qemu_process.c|  4 ++
src/vmx/vmx.c  |  1 +
tests/domaincapsschemadata/full.xml|  1 +
tests/qemuxml2argvdata/graphics-egl-headless.args  | 26 ++
tests/qemuxml2argvdata/graphics-egl-headless.xml   | 31 +++
.../qemuxml2argvdata/graphics-sdl-egl-headless.xml | 35 +
.../graphics-spice-egl-headless.args   | 31 +++
.../graphics-spice-egl-headless.xml| 36 +
.../graphics-spice-invalid-egl-headless.xml| 37 +
.../graphics-vnc-egl-headless.args | 28 ++
.../qemuxml2argvdata/graphics-vnc-egl-headless.xml | 37 +
tests/qemuxml2argvtest.c   | 17 ++
.../graphics-spice-egl-headless.xml| 44 
.../graphics-vnc-egl-headless.xml  | 42 +++
tests/qemuxml2xmltest.c|  2 +
24 files changed, 488 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless.args
create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless.xml
create mode 100644 tests/qemuxml2argvdata/graphics-sdl-egl-headless.xml
create mode 100644 tests/qemuxml2argvdata/graphics-spice-egl-headless.args
create mode 100644 tests/qemuxml2argvdata/graphics-spice-egl-headless.xml
create mode 100644 
tests/qemuxml2argvdata/graphics-spice-invalid-egl-headless.xml
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-egl-headless.args
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-egl-headless.xml
create mode 100644 tests/qemuxml2xmloutdata/graphics-spice-egl-headless.xml
create mode 100644 tests/qemuxml2xmloutdata/graphics-vnc-egl-headless.xml



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH v4 04/10] qemu: Introduce a new graphics display type 'headless'

2018-07-18 Thread Erik Skultety
Since 2.10 QEMU supports a new display type egl-headless which uses the
drm nodes for OpenGL rendering copying back the rendered bits back to
QEMU into a dma-buf which can be accessed by standard "display" apps
like VNC or SPICE. Although this display type can be used on its own,
for any practical use case it makes sense to pair it with either VNC or
SPICE display. The clear benefit of this display is that VNC gains
OpenGL support, which it natively doesn't have, and SPICE gains remote
OpenGL support (native OpenGL support only works locally through a UNIX
socket, i.e. listen type=socket/none)

Signed-off-by: Erik Skultety 
---
 docs/formatdomain.html.in  | 33 +++-
 docs/schemas/domaincommon.rng  |  3 ++
 src/conf/domain_conf.c |  6 ++-
 src/conf/domain_conf.h |  1 +
 src/libxl/libxl_conf.c |  1 +
 src/qemu/qemu_command.c| 14 -
 src/qemu/qemu_domain.c | 60 +-
 src/qemu/qemu_driver.c |  2 +
 src/qemu/qemu_hotplug.c|  1 +
 src/qemu/qemu_process.c|  4 ++
 src/vmx/vmx.c  |  1 +
 tests/domaincapsschemadata/full.xml|  1 +
 tests/qemuxml2argvdata/graphics-egl-headless.args  | 26 ++
 tests/qemuxml2argvdata/graphics-egl-headless.xml   | 31 +++
 .../qemuxml2argvdata/graphics-sdl-egl-headless.xml | 35 +
 .../graphics-spice-egl-headless.args   | 31 +++
 .../graphics-spice-egl-headless.xml| 36 +
 .../graphics-spice-invalid-egl-headless.xml| 37 +
 .../graphics-vnc-egl-headless.args | 28 ++
 .../qemuxml2argvdata/graphics-vnc-egl-headless.xml | 37 +
 tests/qemuxml2argvtest.c   | 17 ++
 .../graphics-spice-egl-headless.xml| 44 
 .../graphics-vnc-egl-headless.xml  | 42 +++
 tests/qemuxml2xmltest.c|  2 +
 24 files changed, 488 insertions(+), 5 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless.args
 create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless.xml
 create mode 100644 tests/qemuxml2argvdata/graphics-sdl-egl-headless.xml
 create mode 100644 tests/qemuxml2argvdata/graphics-spice-egl-headless.args
 create mode 100644 tests/qemuxml2argvdata/graphics-spice-egl-headless.xml
 create mode 100644 
tests/qemuxml2argvdata/graphics-spice-invalid-egl-headless.xml
 create mode 100644 tests/qemuxml2argvdata/graphics-vnc-egl-headless.args
 create mode 100644 tests/qemuxml2argvdata/graphics-vnc-egl-headless.xml
 create mode 100644 tests/qemuxml2xmloutdata/graphics-spice-egl-headless.xml
 create mode 100644 tests/qemuxml2xmloutdata/graphics-vnc-egl-headless.xml

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index d08ede9ab5..091888c879 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -6321,7 +6321,8 @@ qemu-kvm -net nic,model=? /dev/null
 
   The graphics element has a mandatory type
   attribute which takes the value sdl, vnc,
-  spice, rdp or desktop:
+  spice, rdp, desktop or
+  egl-headless:
 
 
   sdl
@@ -6380,6 +6381,11 @@ qemu-kvm -net nic,model=? /dev/null
   auto-allocation and autoport having no effect due to
   security reasons) Since 1.0.6.
 
+
+  Although VNC doesn't support OpenGL natively, it can be paired
+  with graphics type egl-headless (see below) which
+  will instruct QEMU to open and use drm nodes for OpenGL 
rendering.
+
   
   spice Since 0.8.6
   
@@ -6485,6 +6491,12 @@ qemu-kvm -net nic,model=? /dev/null
   You can enable or disable OpenGL support explicitly with
   the gl element, by setting the enable
   property. (QEMU only, since 1.3.3).
+  Note that this only works locally, since this requires usage of
+  UNIX sockets, i.e. using listen types 'socket' or
+  'none'. For accelerated OpenGL with remote support, consider
+  pairing this element with type egl-headless
+  (see below). However, this will deliver weaker performance
+  compared to native Spice OpenGL support.
 
 
   By default, QEMU will pick the first available GPU DRM render 
node.
@@ -6520,6 +6532,25 @@ qemu-kvm -net nic,model=? /dev/null
   fullscreen.
 
   
+  egl-headlessSince 
4.6.0
+  
+
+  This display type provides support for an OpenGL accelerated
+