qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] qxl: don't render stuff when the vm is stopped.
@ 2012-02-15 14:45 Gerd Hoffmann
  2012-02-15 16:28 ` [Qemu-devel] [Spice-devel] " Alon Levy
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2012-02-15 14:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: spice-devel, 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.

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.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl-render.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/hw/qxl-render.c b/hw/qxl-render.c
index 133d093..7084143 100644
--- a/hw/qxl-render.c
+++ b/hw/qxl-render.c
@@ -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;
-- 
1.7.1

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

end of thread, other threads:[~2012-02-16  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 14:45 [Qemu-devel] [PATCH v2] qxl: don't render stuff when the vm is stopped Gerd Hoffmann
2012-02-15 16:28 ` [Qemu-devel] [Spice-devel] " Alon Levy
2012-02-16  9:21   ` Alon Levy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).