From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqdc2-000640-Gn for qemu-devel@nongnu.org; Tue, 27 Feb 2018 06:40:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqdc0-0001f6-Ip for qemu-devel@nongnu.org; Tue, 27 Feb 2018 06:40:02 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34280 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eqdc0-0001eW-Dr for qemu-devel@nongnu.org; Tue, 27 Feb 2018 06:40:00 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03D2417CEDA for ; Tue, 27 Feb 2018 11:40:00 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 27 Feb 2018 12:39:56 +0100 Message-Id: <20180227113957.17461-3-kraxel@redhat.com> In-Reply-To: <20180227113957.17461-1-kraxel@redhat.com> References: <20180227113957.17461-1-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] spice: add scanout_dmabuf support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Add support for scanout dmabufs. Just pass them through to spice-server. Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ui/spice-display.c b/ui/spice-display.c index f3ae6beb3d..a494db1196 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