aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-02-24 12:43:45 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-24 13:36:05 -0600
commit45efb16124efef51de5157afc31984b5a47700f9 (patch)
tree3f391912a9c7d6172c3abf861bf2e56accdf8aae /hw/vga.c
parent167351020420c285b67cdf0603501b3d3b15e3f7 (diff)
optimize screendump for the common non-switch case
switch console only if needed, also pass down whenever the console was switched or not because a displaysurface redraw is only needed in case the console was switched. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/vga.c b/hw/vga.c
index f8f30f8003..5994f43b75 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -162,7 +162,7 @@ static uint32_t expand4[256];
static uint16_t expand2[256];
static uint8_t expand4to8[16];
-static void vga_screen_dump(void *opaque, const char *filename);
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch);
static void vga_update_memory_access(VGACommonState *s)
{
@@ -2407,11 +2407,13 @@ int ppm_save(const char *filename, struct DisplaySurface *ds)
/* save the vga display in a PPM image even if no display is
available */
-static void vga_screen_dump(void *opaque, const char *filename)
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch)
{
VGACommonState *s = opaque;
- vga_invalidate_display(s);
- vga_hw_update();
+ if (cswitch) {
+ vga_invalidate_display(s);
+ vga_hw_update();
+ }
ppm_save(filename, s->ds->surface);
}