From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWh9S-000600-JT for qemu-devel@nongnu.org; Fri, 19 Feb 2016 04:15:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWh9O-0003CM-Rd for qemu-devel@nongnu.org; Fri, 19 Feb 2016 04:15:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWh9O-0003Bv-LQ for qemu-devel@nongnu.org; Fri, 19 Feb 2016 04:14:58 -0500 From: Gerd Hoffmann Date: Fri, 19 Feb 2016 10:14:47 +0100 Message-Id: <1455873289-349-11-git-send-email-kraxel@redhat.com> In-Reply-To: <1455873289-349-1-git-send-email-kraxel@redhat.com> References: <1455873289-349-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH v2 10/12] spice/gl: create dummy primary surface (RfC) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: spice-devel@lists.freedesktop.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Current spice client expects we create a primary surface, even if we do display updates using dma-bufs exclusively. So just do that to get things going. Not fully clear whenever that is intentional or a bug on the spice side, so I keep this as separate patch for now. I think this should either be squashed into the previous patch, or dropped after fixing things on the spice side. Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ui/spice-display.c b/ui/spice-display.c index 15d7906..96beb02 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -856,13 +856,27 @@ static void spice_gl_switch(DisplayChangeListener *dcl, { SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl); EGLint stride, fourcc; + bool resize = true; int fd; + if (ssd->ds && new_surface && + surface_width(ssd->ds) == surface_width(new_surface) && + surface_height(ssd->ds) == surface_height(new_surface) && + surface_format(ssd->ds) == surface_format(new_surface)) { + resize = false; + } + if (ssd->ds) { surface_gl_destroy_texture(ssd->gls, ssd->ds); + if (resize) { + qemu_spice_destroy_host_primary(ssd); + } } ssd->ds = new_surface; if (ssd->ds) { + if (resize) { + qemu_spice_create_host_primary(ssd); + } surface_gl_create_texture(ssd->gls, ssd->ds); fd = egl_get_fd_for_texture(ssd->ds->texture, &stride, &fourcc); -- 1.8.3.1