All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH][TRIVIAL] spice: fix checking for surface bpp match
@ 2015-08-06 15:36 Leo Grange
  2015-09-17 16:18 ` Léo Grange
  0 siblings, 1 reply; 8+ messages in thread
From: Leo Grange @ 2015-08-06 15:36 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Leo Grange, kraxel

Spice surface_switch fast-path was checking only width/height matching,
which leads to a crash when surface bpp has been increased but size
didn't change (and probably other issues if bpp has been decreased).

Signed-off-by: Leo Grange <grangeleo@gmail.com>
---
 ui/spice-display.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index 0360abf..d1e0972 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -406,10 +406,11 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
     SimpleSpiceUpdate *update;
     bool need_destroy;
 
-    if (surface && ssd->surface &&
+    if (surface && ssd->surface && ssd->ds &&
         surface_width(surface) == pixman_image_get_width(ssd->surface) &&
-        surface_height(surface) == pixman_image_get_height(ssd->surface)) {
-        /* no-resize fast path: just swap backing store */
+        surface_height(surface) == pixman_image_get_height(ssd->surface) &&
+		surface_bits_per_pixel(surface) == surface_bits_per_pixel(ssd->ds)) {
+        /* no-resize and no bpp change fast path: just swap backing store */
         dprint(1, "%s/%d: fast (%dx%d)\n", __func__, ssd->qxl.id,
                surface_width(surface), surface_height(surface));
         qemu_mutex_lock(&ssd->lock);
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-29  9:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-06 15:36 [Qemu-trivial] [PATCH][TRIVIAL] spice: fix checking for surface bpp match Leo Grange
2015-09-17 16:18 ` Léo Grange
2015-09-22  7:41   ` Michael Tokarev
2015-09-22  7:41     ` [Qemu-devel] " Michael Tokarev
2015-10-29  8:10     ` [Qemu-trivial] " Michael Tokarev
2015-10-29  8:10       ` [Qemu-devel] " Michael Tokarev
2015-10-29  9:27       ` [Qemu-trivial] " Gerd Hoffmann
2015-10-29  9:27         ` [Qemu-devel] " Gerd Hoffmann

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.