All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: spice-devel@lists.freedesktop.org,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 8/8] spice/gl: create dummy primary surface (RfC)
Date: Thu, 18 Feb 2016 10:26:50 +0100	[thread overview]
Message-ID: <1455787610-31787-9-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1455787610-31787-1-git-send-email-kraxel@redhat.com>

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 <kraxel@redhat.com>
---
 ui/spice-display.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index b222984..54702bb 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

  parent reply	other threads:[~2016-02-18  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18  9:26 [Qemu-devel] [PATCH 0/8] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-18  9:26 ` [Qemu-devel] [PATCH 1/8] configure: add dma-buf support detection Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18  9:26 ` [Qemu-devel] [PATCH 2/8] egl-helpers: add functions for render nodes and dma-buf passing Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18  9:26 ` [Qemu-devel] [PATCH 3/8] console: track gl_block state in QemuConsole Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18  9:26 ` [Qemu-devel] [PATCH 4/8] spice: reset cursor on resize Gerd Hoffmann
2016-02-18  9:26 ` [Qemu-devel] [PATCH 5/8] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18 16:30   ` Eric Blake
2016-02-18 16:55     ` Marc-André Lureau
2016-02-18  9:26 ` [Qemu-devel] [PATCH 6/8] spice: tweak debug messages Gerd Hoffmann
2016-02-18  9:26 ` [Qemu-devel] [PATCH 7/8] spice/gl: render DisplaySurface via opengl Gerd Hoffmann
2016-02-18  9:26 ` Gerd Hoffmann [this message]
2016-02-18 12:20 ` [Qemu-devel] [PATCH 0/8] spice: add opengl/virgl/dmabuf support Marc-André Lureau

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=1455787610-31787-9-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=spice-devel@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.