mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
58c7b618f3
commit
474114b730
4 changed files with 140 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue