aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-03-08 10:06:16 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-03-12 09:01:53 +0100
commitcd2452b279b217d7e6ee48478d6bb3109f388fcb (patch)
treecc6b4abc6c38443fb4edc71ac1f77cb317de1c2e
parente181f8bbd011dbe9f30a58145215f47c4bb6ac6b (diff)
spice: add scanout_dmabuf support
Add support for scanout dmabufs. Just pass them through to spice-server. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20180308090618.30147-3-kraxel@redhat.com
-rw-r--r--ui/spice-display.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 79ea4df02c..4c33c92ae5 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -936,6 +936,20 @@ static void qemu_spice_gl_scanout_texture(DisplayChangeListener *dcl,
ssd->have_scanout = true;
}
+static void qemu_spice_gl_scanout_dmabuf(DisplayChangeListener *dcl,
+ QemuDmaBuf *dmabuf)
+{
+ SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);
+
+ /* note: spice server will close the fd, so hand over a dup */
+ spice_qxl_gl_scanout(&ssd->qxl, dup(dmabuf->fd),
+ dmabuf->width, dmabuf->height,
+ dmabuf->stride, dmabuf->fourcc, false);
+ qemu_spice_gl_monitor_config(ssd, 0, 0, dmabuf->width, dmabuf->height);
+ ssd->have_surface = false;
+ ssd->have_scanout = true;
+}
+
static void qemu_spice_gl_update(DisplayChangeListener *dcl,
uint32_t x, uint32_t y, uint32_t w, uint32_t h)
{
@@ -969,6 +983,7 @@ static const DisplayChangeListenerOps display_listener_gl_ops = {
.dpy_gl_scanout_disable = qemu_spice_gl_scanout_disable,
.dpy_gl_scanout_texture = qemu_spice_gl_scanout_texture,
+ .dpy_gl_scanout_dmabuf = qemu_spice_gl_scanout_dmabuf,
.dpy_gl_update = qemu_spice_gl_update,
};