summaryrefslogtreecommitdiff
path: root/hw
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
parent167351020420c285b67cdf0603501b3d3b15e3f7 (diff)
downloadqemu-45efb16124efef51de5157afc31984b5a47700f9.tar.gz
qemu-45efb16124efef51de5157afc31984b5a47700f9.tar.bz2
qemu-45efb16124efef51de5157afc31984b5a47700f9.zip
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')
-rw-r--r--hw/blizzard.c8
-rw-r--r--hw/g364fb.c2
-rw-r--r--hw/omap_lcdc.c7
-rw-r--r--hw/qxl.c4
-rw-r--r--hw/tcx.c8
-rw-r--r--hw/vga.c10
-rw-r--r--hw/vmware_vga.c4
7 files changed, 26 insertions, 17 deletions
diff --git a/hw/blizzard.c b/hw/blizzard.c
index b2c1b22844..c7d844d105 100644
--- a/hw/blizzard.c
+++ b/hw/blizzard.c
@@ -932,10 +932,14 @@ static void blizzard_update_display(void *opaque)
s->my[1] = 0;
}
-static void blizzard_screen_dump(void *opaque, const char *filename) {
+static void blizzard_screen_dump(void *opaque, const char *filename,
+ bool cswitch)
+{
BlizzardState *s = (BlizzardState *) opaque;
- blizzard_update_display(opaque);
+ if (cswitch) {
+ blizzard_update_display(opaque);
+ }
if (s && ds_get_data(s->state))
ppm_save(filename, s->state->surface);
}
diff --git a/hw/g364fb.c b/hw/g364fb.c
index 9c63bddc59..3a0b68fbae 100644
--- a/hw/g364fb.c
+++ b/hw/g364fb.c
@@ -289,7 +289,7 @@ static void g364fb_reset(G364State *s)
g364fb_invalidate_display(s);
}
-static void g364fb_screen_dump(void *opaque, const char *filename)
+static void g364fb_screen_dump(void *opaque, const char *filename, bool cswitch)
{
G364State *s = opaque;
int y, x;
diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c
index f265306556..f172093876 100644
--- a/hw/omap_lcdc.c
+++ b/hw/omap_lcdc.c
@@ -264,9 +264,12 @@ static int ppm_save(const char *filename, uint8_t *data,
return 0;
}
-static void omap_screen_dump(void *opaque, const char *filename) {
+static void omap_screen_dump(void *opaque, const char *filename, bool cswitch)
+{
struct omap_lcd_panel_s *omap_lcd = opaque;
- omap_update_display(opaque);
+ if (cswitch) {
+ omap_update_display(opaque);
+ }
if (omap_lcd && ds_get_data(omap_lcd->state))
ppm_save(filename, ds_get_data(omap_lcd->state),
omap_lcd->width, omap_lcd->height,
diff --git a/hw/qxl.c b/hw/qxl.c
index 87ad49ad8b..f643667205 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1436,7 +1436,7 @@ static void qxl_hw_invalidate(void *opaque)
vga->invalidate(vga);
}
-static void qxl_hw_screen_dump(void *opaque, const char *filename)
+static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch)
{
PCIQXLDevice *qxl = opaque;
VGACommonState *vga = &qxl->vga;
@@ -1448,7 +1448,7 @@ 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);
+ vga->screen_dump(vga, filename, cswitch);
break;
default:
break;
diff --git a/hw/tcx.c b/hw/tcx.c
index 2b66d8619e..ac7dcb428c 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -56,8 +56,8 @@ typedef struct TCXState {
uint8_t dac_index, dac_state;
} TCXState;
-static void tcx_screen_dump(void *opaque, const char *filename);
-static void tcx24_screen_dump(void *opaque, const char *filename);
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch);
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch);
static void tcx_set_dirty(TCXState *s)
{
@@ -574,7 +574,7 @@ static int tcx_init1(SysBusDevice *dev)
return 0;
}
-static void tcx_screen_dump(void *opaque, const char *filename)
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch)
{
TCXState *s = opaque;
FILE *f;
@@ -601,7 +601,7 @@ static void tcx_screen_dump(void *opaque, const char *filename)
return;
}
-static void tcx24_screen_dump(void *opaque, const char *filename)
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch)
{
TCXState *s = opaque;
FILE *f;
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);
}
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index f8afa3c367..142d9f4ea0 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1003,11 +1003,11 @@ static void vmsvga_invalidate_display(void *opaque)
/* save the vga display in a PPM image even if no display is
available */
-static void vmsvga_screen_dump(void *opaque, const char *filename)
+static void vmsvga_screen_dump(void *opaque, const char *filename, bool cswitch)
{
struct vmsvga_state_s *s = opaque;
if (!s->enable) {
- s->vga.screen_dump(&s->vga, filename);
+ s->vga.screen_dump(&s->vga, filename, cswitch);
return;
}