mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
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>
This commit is contained in:
parent
1673510204
commit
45efb16124
9 changed files with 34 additions and 21 deletions
10
hw/vga.c
10
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue