Skip to contentSkip to conversation

qxl: don't render stuff when the vm is stopped.

PATCH In review Gerd Hoffmann 2 participants 3 messages Feb 15, 2012 – Feb 16, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qxl: don't render stuff when the vm is stopped.

This patch fixes the local qxl renderer to not kick spice-server in case the vm is stopped. First it is largely pointless because we ask spice-server to process all not-yet processed commands when the vm is stopped, so there isn't much do do anyway. Second we avoid triggering an assert in spice-server.

The patch makes sure we still honor redraw requests, even if we don't ask spice-server for updates. This is needed to handle displaysurface changes with a stopped vm correctly.

With this patch applied it is possible to take screen shots (via screendump monitor command) from a qxl gpu even in case the guest is stopped.

---
 hw/qxl-render.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
hw/qxl-render.c +5 -7
index 133d093..7084143 100644
@@ -121,19 +121,17 @@ void qxl_render_update(PCIQXLDevice *qxl)
         dpy_resize(vga->ds);
     }
 
-    if (!qxl->guest_primary.commands) {
-        return;
-    }
-    qxl->guest_primary.commands = 0;
-
     update.left   = 0;
     update.right  = qxl->guest_primary.surface.width;
     update.top    = 0;
     update.bottom = qxl->guest_primary.surface.height;
 
     memset(dirty, 0, sizeof(dirty));
-    qxl_spice_update_area(qxl, 0, &update,
-                          dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
+    if (runstate_is_running() && qxl->guest_primary.commands) {
+        qxl->guest_primary.commands = 0;
+        qxl_spice_update_area(qxl, 0, &update,
+                              dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
+    }
     if (redraw) {
         memset(dirty, 0, sizeof(dirty));
         dirty[0] = update;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 6 lines · Gerd Hoffmann

This patch fixes the local qxl renderer to not kick spice-server in case the vm is stopped. First it is largely pointless because we ask spice-server to process all not-yet processed commands when the vm is stopped, so there isn't much do do anyway. Second we avoid triggering an assert in spice-server.

Quoted 8 lines

The patch makes sure we still honor redraw requests, even if we don't ask spice-server for updates. This is needed to handle displaysurface changes with a stopped vm correctly.

With this patch applied it is possible to take screen shots (via screendump monitor command) from a qxl gpu even in case the guest is stopped.

ACK.

Quoted 41 lines
---
 hw/qxl-render.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
hw/qxl-render.c +5 -7
index 133d093..7084143 100644
@@ -121,19 +121,17 @@ void qxl_render_update(PCIQXLDevice *qxl)
         dpy_resize(vga->ds);
     }
 
-    if (!qxl->guest_primary.commands) {
-        return;
-    }
-    qxl->guest_primary.commands = 0;
-
     update.left   = 0;
     update.right  = qxl->guest_primary.surface.width;
     update.top    = 0;
     update.bottom = qxl->guest_primary.surface.height;
 
     memset(dirty, 0, sizeof(dirty));
-    qxl_spice_update_area(qxl, 0, &update,
-                          dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
+    if (runstate_is_running() && qxl->guest_primary.commands) {
+        qxl->guest_primary.commands = 0;
+        qxl_spice_update_area(qxl, 0, &update,
+                              dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
+    }
     if (redraw) {
         memset(dirty, 0, sizeof(dirty));
         dirty[0] = update;
Signature · 6 lines
1.7.1

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel
#2 lore raw
Quoted 11 lines · Alon Levy
Quoted 10 lines · Gerd Hoffmann

This patch fixes the local qxl renderer to not kick spice-server in case the vm is stopped. First it is largely pointless because we ask spice-server to process all not-yet processed commands when the vm is stopped, so there isn't much do do anyway. Second we avoid triggering an assert in spice-server.

The patch makes sure we still honor redraw requests, even if we don't ask spice-server for updates. This is needed to handle displaysurface changes with a stopped vm correctly.

Quoted 6 lines
Quoted 4 lines

With this patch applied it is possible to take screen shots (via screendump monitor command) from a qxl gpu even in case the guest is stopped.

ACK.

But please mention RHBZ 748810.

Quoted 46 lines
Quoted 42 lines
---
 hw/qxl-render.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
hw/qxl-render.c +5 -7
index 133d093..7084143 100644
@@ -121,19 +121,17 @@ void qxl_render_update(PCIQXLDevice *qxl)
         dpy_resize(vga->ds);
     }
 
-    if (!qxl->guest_primary.commands) {
-        return;
-    }
-    qxl->guest_primary.commands = 0;
-
     update.left   = 0;
     update.right  = qxl->guest_primary.surface.width;
     update.top    = 0;
     update.bottom = qxl->guest_primary.surface.height;
 
     memset(dirty, 0, sizeof(dirty));
-    qxl_spice_update_area(qxl, 0, &update,
-                          dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
+    if (runstate_is_running() && qxl->guest_primary.commands) {
+        qxl->guest_primary.commands = 0;
+        qxl_spice_update_area(qxl, 0, &update,
+                              dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
+    }
     if (redraw) {
         memset(dirty, 0, sizeof(dirty));
         dirty[0] = update;
Signature · 6 lines
1.7.1

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel