aboutsummaryrefslogtreecommitdiff
path: root/include/ui/spice-display.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-10-13 15:39:34 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-02-23 12:04:39 +0100
commit474114b7305cc1be7c2ee8ba5267be159a9d56e3 (patch)
tree339f6ec47224eb4106fa8134d24a37e40915bdd8 /include/ui/spice-display.h
parent58c7b618f3889f53308142403117d5ae24bda9bc (diff)
downloadqemu-474114b7305cc1be7c2ee8ba5267be159a9d56e3.zip
qemu-474114b7305cc1be7c2ee8ba5267be159a9d56e3.tar.gz
qemu-474114b7305cc1be7c2ee8ba5267be159a9d56e3.tar.bz2
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 'include/ui/spice-display.h')
-rw-r--r--include/ui/spice-display.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h
index b25328a..48dc8c4 100644
--- a/include/ui/spice-display.h
+++ b/include/ui/spice-display.h
@@ -24,6 +24,14 @@
#include "ui/console.h"
#include "sysemu/sysemu.h"
+#if defined(CONFIG_OPENGL_DMABUF)
+# if SPICE_SERVER_VERSION >= 0x000d00 /* release 0.13.0 */
+# define HAVE_SPICE_GL 1
+# include "ui/egl-helpers.h"
+# include "ui/egl-context.h"
+# endif
+#endif
+
#define NUM_MEMSLOTS 8
#define MEMSLOT_GENERATION_BITS 8
#define MEMSLOT_SLOT_BITS 8
@@ -50,6 +58,7 @@ enum {
QXL_COOKIE_TYPE_IO,
QXL_COOKIE_TYPE_RENDER_UPDATE_AREA,
QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
+ QXL_COOKIE_TYPE_GL_DRAW_DONE,
};
typedef struct QXLCookie {
@@ -104,6 +113,12 @@ struct SimpleSpiceDisplay {
QEMUCursor *cursor;
int mouse_x, mouse_y;
QEMUBH *cursor_bh;
+
+#ifdef HAVE_SPICE_GL
+ /* opengl rendering */
+ QEMUBH *gl_unblock_bh;
+ int dmabuf_fd;
+#endif
};
struct SimpleSpiceUpdate {