diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-10-13 15:39:34 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-02-23 12:04:39 +0100 |
commit | 474114b7305cc1be7c2ee8ba5267be159a9d56e3 (patch) | |
tree | 339f6ec47224eb4106fa8134d24a37e40915bdd8 /ui/spice-core.c | |
parent | 58c7b618f3889f53308142403117d5ae24bda9bc (diff) |
spice: add opengl/virgl/dmabuf support
This adds support for dma-buf passing to spice. This makes virtio-gpu
with 3d acceleration work with spice.
Workflow:
* virglrenderer renders the guest command stream into a texture.
* qemu exports the texture as dma-buf and passes on that dma-buf
to spice-server.
* spice-server passes the dma-buf to spice-client, using unix
socket file descriptor passing.
* spice-client asks the window systems composer to render the
dma-buf to the screen.
Requires cutting edge spice (server) and spice-gtk (client) builds,
from git master branch.
Also requires libvirt managing your qemu instance, and using
"virt-viewer --attach $guest". libvirt will connect spice-server and
spice-client using unix sockets instead of tcp sockets then, which
is required for file descriptor passing.
Works for the local case (spice server and client on the same machine)
only. Supporting remote too is planned (by feeding the dma-bufs into
gpu-assisted video encoder), but not there yet.
gl mode is turned off by default, use "-spice gl=on,$otherargs" to
enable it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/spice-core.c')
-rw-r--r-- | ui/spice-core.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ui/spice-core.c b/ui/spice-core.c index 4dbd99ab19..5abec1721a 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -494,9 +494,14 @@ static QemuOptsList qemu_spice_opts = { },{ .name = "playback-compression", .type = QEMU_OPT_BOOL, - }, { + },{ .name = "seamless-migration", .type = QEMU_OPT_BOOL, +#ifdef HAVE_SPICE_GL + },{ + .name = "gl", + .type = QEMU_OPT_BOOL, +#endif }, { /* end of list */ } }, @@ -819,6 +824,14 @@ void qemu_spice_init(void) #if SPICE_SERVER_VERSION >= 0x000c02 qemu_spice_register_ports(); #endif + +#ifdef HAVE_SPICE_GL + if (qemu_opt_get_bool(opts, "gl", 0)) { + if (egl_rendernode_init() == 0) { + display_opengl = 1; + } + } +#endif } int qemu_spice_add_interface(SpiceBaseInstance *sin) |