diff mbox

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

Message ID 1329860377-6284-5-git-send-email-alevy@redhat.com
State New
Headers show

Commit Message

Alon Levy Feb. 21, 2012, 9:39 p.m. UTC
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 <alevy@redhat.com>
---
 hw/qxl.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Comments

Gerd Hoffmann Feb. 22, 2012, 11:10 a.m. UTC | #1
On 02/21/12 22:39, Alon Levy wrote:
> Using vga->screen_dump results in a number of calls to ppm_save,
> instead of a single one.

Can you investigate why?

> 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.

I'd prefer to fix the root cause instead of adding workarounds.

cheers,
  Gerd
diff mbox

Patch

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;