qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 12/14] spice: add scanout_dmabuf support
Date: Mon, 12 Mar 2018 10:14:03 +0100	[thread overview]
Message-ID: <20180312091405.19610-13-kraxel@redhat.com> (raw)
In-Reply-To: <20180312091405.19610-1-kraxel@redhat.com>

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
---
 ui/spice-display.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

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,
 };
 
-- 
2.9.3

  parent reply	other threads:[~2018-03-12  9:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12  9:13 [Qemu-devel] [PULL 00/14] Ui 20180312 patches Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 01/14] build: try improve handling of clang warnings Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 02/14] make: switch language file build to be gtk module aware Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 03/14] sdl: workaround bug in sdl 2.0.8 headers Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 04/14] ui/gtk: make GtkGlArea usage a runtime option Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 05/14] ui/gtk: group gtk.mo declarations in Makefile Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 06/14] ui/opengl: Makefile cleanup Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 07/14] ui/gtk: use GtkGlArea on wayland only Gerd Hoffmann
2018-03-12  9:13 ` [Qemu-devel] [PULL 08/14] ui/gtk-egl: add scanout_dmabuf support Gerd Hoffmann
2018-03-12  9:14 ` [Qemu-devel] [PULL 09/14] ui/gtk-egl: add cursor_dmabuf support Gerd Hoffmann
2018-03-12  9:14 ` [Qemu-devel] [PULL 10/14] vnc: deal with surface NULL pointers Gerd Hoffmann
2018-03-12  9:14 ` [Qemu-devel] [PULL 11/14] spice: drop dprint() debug logging Gerd Hoffmann
2018-03-12  9:14 ` Gerd Hoffmann [this message]
2018-03-12  9:14 ` [Qemu-devel] [PULL 13/14] spice: add cursor_dmabuf support Gerd Hoffmann
2018-04-27 13:12   ` Peter Maydell
2018-04-27 13:16   ` Peter Maydell
2018-07-06 11:54     ` Peter Maydell
2018-07-19 10:54       ` Peter Maydell
2018-03-12  9:14 ` [Qemu-devel] [PULL 14/14] qapi: Add device ID and head parameters to screendump Gerd Hoffmann
2018-03-12 16:14 ` [Qemu-devel] [PULL 00/14] Ui 20180312 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180312091405.19610-13-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).