<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From c8d5ce2d19d4bd90d884437ab3a9775a18e73d80 Mon Sep 17 00:00:00 2001
From: Alon Levy &lt;alevy@redhat.com&gt;
Date: Sun, 18 Mar 2012 12:17:46 +0100
Subject: [PATCH 3/9] qxl: fix spice+sdl no cursor regression
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RH-Author: Alon Levy &lt;alevy@redhat.com&gt;
Message-id: &lt;1332073072-27934-3-git-send-email-alevy@redhat.com&gt;
Patchwork-id: 38600
O-Subject: [PATCHv2 RHEL-6.3 qemu-kvm 2/8] qxl: fix spice+sdl no cursor regression
Bugzilla: 747011
RH-Acked-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
RH-Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
RH-Acked-by: Yonit Halperin &lt;yhalperi@redhat.com&gt;

regression introduced by 075360945860ad9bdd491921954b383bf762b0e5,

v2: lock around qemu_spice_cursor_refresh_unlocked

Reported-by: Fabiano FidÃªncio &lt;fabiano@fidencio.org&gt;
Signed-off-by: Alon Levy &lt;alevy@redhat.com&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
(cherry picked from commit bb5a8cd5b0aec0286c5e749803083de22c2b0be6)
---
 hw/qxl.c           |    4 ++++
 ui/spice-display.c |   23 ++++++++++++++---------
 ui/spice-display.h |    1 +
 3 files changed, 19 insertions(+), 9 deletions(-)

Signed-off-by: Michal Novotny &lt;minovotn@redhat.com&gt;
---
 hw/qxl.c           |    4 ++++
 ui/spice-display.c |   23 ++++++++++++++---------
 ui/spice-display.h |    1 +
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index f51a732..b75cea2 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1591,6 +1591,10 @@ static void display_refresh(struct DisplayState *ds)
 {
     if (qxl0-&gt;mode == QXL_MODE_VGA) {
         qemu_spice_display_refresh(&amp;qxl0-&gt;ssd);
+    } else {
+        qemu_mutex_lock(&amp;qxl0-&gt;ssd.lock);
+        qemu_spice_cursor_refresh_unlocked(&amp;qxl0-&gt;ssd);
+        qemu_mutex_unlock(&amp;qxl0-&gt;ssd.lock);
     }
 }
 
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 402d04c..4d81bb7 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -315,16 +315,8 @@ void qemu_spice_display_resize(SimpleSpiceDisplay *ssd)
     ssd-&gt;notify++;
 }
 
-void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
+void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd)
 {
-    dprint(3, "%s:\n", __FUNCTION__);
-    vga_hw_update();
-
-    qemu_mutex_lock(&amp;ssd-&gt;lock);
-    if (ssd-&gt;update == NULL) {
-        ssd-&gt;update = qemu_spice_create_update(ssd);
-        ssd-&gt;notify++;
-    }
     if (ssd-&gt;cursor) {
         ssd-&gt;ds-&gt;cursor_define(ssd-&gt;cursor);
         cursor_put(ssd-&gt;cursor);
@@ -335,6 +327,19 @@ void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
         ssd-&gt;mouse_x = -1;
         ssd-&gt;mouse_y = -1;
     }
+}
+
+void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
+{
+    dprint(3, "%s:\n", __func__);
+    vga_hw_update();
+
+    qemu_mutex_lock(&amp;ssd-&gt;lock);
+    if (ssd-&gt;update == NULL) {
+        ssd-&gt;update = qemu_spice_create_update(ssd);
+        ssd-&gt;notify++;
+    }
+    qemu_spice_cursor_refresh_unlocked(ssd);
     qemu_mutex_unlock(&amp;ssd-&gt;lock);
 
     if (ssd-&gt;notify) {
diff --git a/ui/spice-display.h b/ui/spice-display.h
index 019baad..85a3622 100644
--- a/ui/spice-display.h
+++ b/ui/spice-display.h
@@ -97,6 +97,7 @@ void qemu_spice_display_update(SimpleSpiceDisplay *ssd,
                                int x, int y, int w, int h);
 void qemu_spice_display_resize(SimpleSpiceDisplay *ssd);
 void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd);
+void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd);
 
 void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot,
                             qxl_async_io async);
-- 
1.7.7.6

</pre></body></html>