qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v4 4/9] qxl: screen_dump in vga: do a single ppm_save


From: Alon Levy
Subject: [Qemu-devel] [RFC v4 4/9] qxl: screen_dump in vga: do a single ppm_save
Date: Tue, 21 Feb 2012 23:39:32 +0200

Using vga->screen_dump results in a number of calls to ppm_save,
instead of a single one. Lacking time to test all the possible users of
vga->screen_dump, avoid the redundant calls by doing the vga_hw_update+
ppm_save in qxl_hw_screen_dump.

Signed-off-by: Alon Levy <address@hidden>
---
 hw/qxl.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index ac69125..8bdc510 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1438,7 +1438,6 @@ static void qxl_hw_invalidate(void *opaque)
 static void qxl_hw_screen_dump(void *opaque, const char *filename)
 {
     PCIQXLDevice *qxl = opaque;
-    VGACommonState *vga = &qxl->vga;
 
     switch (qxl->mode) {
     case QXL_MODE_COMPAT:
@@ -1447,7 +1446,14 @@ static void qxl_hw_screen_dump(void *opaque, const char 
*filename)
         ppm_save(filename, qxl->ssd.ds->surface);
         break;
     case QXL_MODE_VGA:
-        vga->screen_dump(vga, filename);
+        /*
+         * TODO: vga_hw_screen_dump needless does a number of ppm_save calls
+         * fix it instead of redoing it correctly here (needs testing which is
+         * why it isn't yet done)
+         */
+        qxl->vga.invalidate(&qxl->vga);
+        vga_hw_update();
+        ppm_save(filename, qxl->ssd.ds->surface);
         break;
     default:
         break;
-- 
1.7.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]