From 2c62f08ddbf3fa80dc7202eb9a2ea60ae44e2cc5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 12 Mar 2013 14:48:31 +0100 Subject: console: simplify screendump Screendumps are alot simpler as we can update non-active QemuConsoles now. So we only need to update the QemuConsole we want write out, then dump the DisplaySurface content into a ppm file. Done. No console switching needed. No special support code in the gfx card emulation needed. Zap it all. Also move ppm_save out of the vga code and next to the qmp_screendump function. For now screen dumping is limited to console #0 (like it used to be), even though it is dead simple to extend it to other consoles. I wanna finish the console cleanup before setting new qapi interfaces into stone. Signed-off-by: Gerd Hoffmann Tested-by: Igor Mitsyanko --- hw/display/qxl.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'hw/display/qxl.c') diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 247209d6d2..3b09d208fd 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1772,26 +1772,6 @@ static void qxl_hw_invalidate(void *opaque) vga->invalidate(vga); } -static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch, - Error **errp) -{ - PCIQXLDevice *qxl = opaque; - VGACommonState *vga = &qxl->vga; - - switch (qxl->mode) { - case QXL_MODE_COMPAT: - case QXL_MODE_NATIVE: - qxl_render_update(qxl); - ppm_save(filename, qxl->ssd.ds, errp); - break; - case QXL_MODE_VGA: - vga->screen_dump(vga, filename, cswitch, errp); - break; - default: - break; - } -} - static void qxl_hw_text_update(void *opaque, console_ch_t *chardata) { PCIQXLDevice *qxl = opaque; @@ -2075,7 +2055,7 @@ static int qxl_init_primary(PCIDevice *dev) portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0); vga->con = graphic_console_init(qxl_hw_update, qxl_hw_invalidate, - qxl_hw_screen_dump, qxl_hw_text_update, + qxl_hw_text_update, qxl); qxl->ssd.con = vga->con, qemu_spice_display_init_common(&qxl->ssd); -- cgit 1.4.1