@@ -124,6 +124,7 @@ struct TextConsole {
vga_hw_update_ptr hw_update;
vga_hw_invalidate_ptr hw_invalidate;
vga_hw_screen_dump_ptr hw_screen_dump;
+ vga_hw_screen_dump_async_ptr hw_screen_dump_async;
vga_hw_text_update_ptr hw_text_update;
void *hw;
@@ -1403,6 +1404,8 @@ DisplayState *graphic_console_init(vga_hw_update_ptr update,
vga_hw_invalidate_ptr invalidate,
vga_hw_screen_dump_ptr screen_dump,
vga_hw_text_update_ptr text_update,
+ vga_hw_screen_dump_async_ptr
+ screen_dump_async,
void *opaque)
{
TextConsole *s;
@@ -1421,6 +1424,7 @@ DisplayState *graphic_console_init(vga_hw_update_ptr update,
s->hw_update = update;
s->hw_invalidate = invalidate;
s->hw_screen_dump = screen_dump;
+ s->hw_screen_dump_async = screen_dump_async;
s->hw_text_update = text_update;
s->hw = opaque;
@@ -341,17 +341,25 @@ static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
typedef void (*vga_hw_update_ptr)(void *);
typedef void (*vga_hw_invalidate_ptr)(void *);
typedef void (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch);
+typedef void (*vga_hw_screen_dump_async_cb_ptr)(void *opaque);
+typedef void (*vga_hw_screen_dump_async_ptr)(void *, const char *filename,
+ bool cswitch,
+ vga_hw_screen_dump_async_cb_ptr cb,
+ void *cb_opaque);
typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *);
DisplayState *graphic_console_init(vga_hw_update_ptr update,
vga_hw_invalidate_ptr invalidate,
vga_hw_screen_dump_ptr screen_dump,
vga_hw_text_update_ptr text_update,
+ vga_hw_screen_dump_async_ptr
+ screen_dump_async,
void *opaque);
void vga_hw_update(void);
void vga_hw_invalidate(void);
void vga_hw_screen_dump(const char *filename);
+void vga_hw_screen_dump_async(const char *filename);
void vga_hw_text_update(console_ch_t *chardata);
void monitor_protocol_screen_dump_complete_event(const char *filename);
@@ -963,7 +963,7 @@ void *s1d13745_init(qemu_irq gpio_int)
s->state = graphic_console_init(blizzard_update_display,
blizzard_invalidate_display,
- blizzard_screen_dump, NULL, s);
+ blizzard_screen_dump, NULL, NULL, s);
switch (ds_get_bits_per_pixel(s->state)) {
case 0:
@@ -2900,7 +2900,7 @@ static int vga_initfn(ISADevice *dev)
isa_address_space(dev));
s->ds = graphic_console_init(s->update, s->invalidate,
s->screen_dump, s->text_update,
- s);
+ s->screen_dump_async, s);
rom_add_vga(VGABIOS_CIRRUS_FILENAME);
/* XXX ISA-LFB support */
/* FIXME not qdev yet */
@@ -2941,7 +2941,7 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
cirrus_init_common(s, device_id, 1, pci_address_space(dev));
s->vga.ds = graphic_console_init(s->vga.update, s->vga.invalidate,
s->vga.screen_dump, s->vga.text_update,
- &s->vga);
+ s->vga.screen_dump_async, &s->vga);
/* setup PCI */
@@ -1898,7 +1898,8 @@ static int exynos4210_fimd_init(SysBusDevice *dev)
"exynos4210.fimd", FIMD_REGS_SIZE);
sysbus_init_mmio(dev, &s->iomem);
s->console = graphic_console_init(exynos4210_fimd_update,
- exynos4210_fimd_invalidate, NULL, NULL, s);
+ exynos4210_fimd_invalidate,
+ NULL, NULL, NULL, s);
return 0;
}
@@ -517,7 +517,7 @@ static void g364fb_init(DeviceState *dev, G364State *s)
s->ds = graphic_console_init(g364fb_update_display,
g364fb_invalidate_display,
- g364fb_screen_dump, NULL, s);
+ g364fb_screen_dump, NULL, NULL, s);
memory_region_init_io(&s->mem_ctrl, &g364fb_ctrl_ops, s, "ctrl", 0x180000);
memory_region_init_ram_ptr(&s->mem_vram, "vram",
@@ -251,7 +251,8 @@ static int jazz_led_init(SysBusDevice *dev)
s->ds = graphic_console_init(jazz_led_update_display,
jazz_led_invalidate_display,
NULL,
- jazz_led_text_update, s);
+ jazz_led_text_update,
+ NULL, s);
return 0;
}
@@ -276,7 +276,7 @@ static int milkymist_vgafb_init(SysBusDevice *dev)
s->ds = graphic_console_init(vgafb_update_display,
vgafb_invalidate_display,
- NULL, NULL, s);
+ NULL, NULL, NULL, s);
return 0;
}
@@ -611,7 +611,7 @@ static int musicpal_lcd_init(SysBusDevice *dev)
sysbus_init_mmio(dev, &s->iomem);
s->ds = graphic_console_init(lcd_refresh, lcd_invalidate,
- NULL, NULL, s);
+ NULL, NULL, NULL, s);
qemu_console_resize(s->ds, 128*3, 64*3);
qdev_init_gpio_in(&dev->qdev, musicpal_lcd_gpio_brigthness_in, 3);
@@ -1072,7 +1072,9 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
#if 0
s->state = graphic_console_init(omap_update_display,
- omap_invalidate_display, omap_screen_dump, s);
+ omap_invalidate_display,
+ omap_screen_dump,
+ NULL, NULL, s);
#endif
return s;
@@ -452,7 +452,7 @@ struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem,
s->state = graphic_console_init(omap_update_display,
omap_invalidate_display,
- omap_screen_dump, NULL, s);
+ omap_screen_dump, NULL, NULL, s);
return s;
}
@@ -451,7 +451,7 @@ static int pl110_init(SysBusDevice *dev)
qdev_init_gpio_in(&s->busdev.qdev, pl110_mux_ctrl_set, 1);
s->ds = graphic_console_init(pl110_update_display,
pl110_invalidate_display,
- NULL, NULL, s);
+ NULL, NULL, NULL, s);
return 0;
}
@@ -1004,7 +1004,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem,
s->ds = graphic_console_init(pxa2xx_update_display,
pxa2xx_invalidate_display,
- NULL, NULL, s);
+ NULL, NULL, NULL, s);
switch (ds_get_bits_per_pixel(s->ds)) {
case 0:
@@ -1763,7 +1763,8 @@ static int qxl_init_primary(PCIDevice *dev)
portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);
vga->ds = graphic_console_init(qxl_hw_update, qxl_hw_invalidate,
- qxl_hw_screen_dump, qxl_hw_text_update, qxl);
+ qxl_hw_screen_dump, qxl_hw_text_update,
+ NULL, qxl);
qemu_spice_display_init_common(&qxl->ssd, vga->ds);
qxl0 = qxl;
@@ -1442,6 +1442,6 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
}
/* create qemu graphic console */
- s->ds = graphic_console_init(sm501_update_display, NULL,
- NULL, NULL, s);
+ s->ds = graphic_console_init(sm501_update_display,
+ NULL, NULL, NULL, NULL, s);
}
@@ -289,7 +289,7 @@ static int ssd0303_init(I2CSlave *i2c)
s->ds = graphic_console_init(ssd0303_update_display,
ssd0303_invalidate_display,
- NULL, NULL, s);
+ NULL, NULL, NULL, s);
qemu_console_resize(s->ds, 96 * MAGNIFY, 16 * MAGNIFY);
return 0;
}
@@ -330,7 +330,7 @@ static int ssd0323_init(SSISlave *dev)
s->row_end = 79;
s->ds = graphic_console_init(ssd0323_update_display,
ssd0323_invalidate_display,
- NULL, NULL, s);
+ NULL, NULL, NULL, s);
qemu_console_resize(s->ds, 128 * MAGNIFY, 64 * MAGNIFY);
qdev_init_gpio_in(&dev->qdev, ssd0323_cd, 1);
@@ -581,6 +581,7 @@ TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq)
NULL, /* invalidate */
NULL, /* screen_dump */
NULL, /* text_update */
+ NULL, /* screen_dump_async */
s);
return s;
@@ -558,7 +558,7 @@ static int tcx_init1(SysBusDevice *dev)
s->ds = graphic_console_init(tcx24_update_display,
tcx24_invalidate_display,
- tcx24_screen_dump, NULL, s);
+ tcx24_screen_dump, NULL, NULL, s);
} else {
/* THC 8 bit (dummy) */
memory_region_init_io(&s->thc8, &dummy_ops, s, "tcx.thc8",
@@ -567,7 +567,7 @@ static int tcx_init1(SysBusDevice *dev)
s->ds = graphic_console_init(tcx_update_display,
tcx_invalidate_display,
- tcx_screen_dump, NULL, s);
+ tcx_screen_dump, NULL, NULL, s);
}
qemu_console_resize(s->ds, s->width, s->height);
@@ -132,7 +132,8 @@ int isa_vga_mm_init(target_phys_addr_t vram_base,
vga_mm_init(s, vram_base, ctrl_base, it_shift, address_space);
s->vga.ds = graphic_console_init(s->vga.update, s->vga.invalidate,
- s->vga.screen_dump, s->vga.text_update, s);
+ s->vga.screen_dump, s->vga.text_update,
+ s->vga.screen_dump_async, s);
vga_init_vbe(&s->vga, address_space);
return 0;
@@ -61,7 +61,8 @@ static int vga_initfn(ISADevice *dev)
vga_io_memory, 1);
memory_region_set_coalescing(vga_io_memory);
s->ds = graphic_console_init(s->update, s->invalidate,
- s->screen_dump, s->text_update, s);
+ s->screen_dump, s->text_update,
+ s->screen_dump_async, s);
vga_init_vbe(s, isa_address_space(dev));
/* ROM BIOS */
@@ -57,7 +57,8 @@ static int pci_vga_initfn(PCIDevice *dev)
vga_init(s, pci_address_space(dev), pci_address_space_io(dev), true);
s->ds = graphic_console_init(s->update, s->invalidate,
- s->screen_dump, s->text_update, s);
+ s->screen_dump, s->text_update,
+ s->screen_dump_async, s);
/* XXX: VGA_RAM_SIZE must be a power of two */
pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->vram);
@@ -161,6 +161,7 @@ typedef struct VGACommonState {
vga_hw_invalidate_ptr invalidate;
vga_hw_screen_dump_ptr screen_dump;
vga_hw_text_update_ptr text_update;
+ vga_hw_screen_dump_async_ptr screen_dump_async;
/* hardware mouse cursor support */
uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32];
void (*cursor_invalidate)(struct VGACommonState *s);
@@ -1087,7 +1087,8 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size,
s->vga.ds = graphic_console_init(vmsvga_update_display,
vmsvga_invalidate_display,
vmsvga_screen_dump,
- vmsvga_text_update, s);
+ vmsvga_text_update,
+ NULL, s);
s->fifo_size = SVGA_FIFO_SIZE;
@@ -906,6 +906,7 @@ static int fb_initialise(struct XenDevice *xendev)
xenfb_invalidate,
NULL,
NULL,
+ NULL,
fb);
fb->have_console = 1;
}
@@ -1015,6 +1016,7 @@ wait_more:
xenfb_invalidate,
NULL,
NULL,
+ NULL,
fb);
fb->have_console = 1;
adds a handler for the following qmp screendump-async command. graphics_console_init signature change required touching every user, but no implementation of the new vga_hw_screen_dump_async_ptr is provided in this patch. Signed-off-by: Alon Levy <alevy@redhat.com> --- console.c | 4 ++++ console.h | 8 ++++++++ hw/blizzard.c | 2 +- hw/cirrus_vga.c | 4 ++-- hw/exynos4210_fimd.c | 3 ++- hw/g364fb.c | 2 +- hw/jazz_led.c | 3 ++- hw/milkymist-vgafb.c | 2 +- hw/musicpal.c | 2 +- hw/omap_dss.c | 4 +++- hw/omap_lcdc.c | 2 +- hw/pl110.c | 2 +- hw/pxa2xx_lcd.c | 2 +- hw/qxl.c | 3 ++- hw/sm501.c | 4 ++-- hw/ssd0303.c | 2 +- hw/ssd0323.c | 2 +- hw/tc6393xb.c | 1 + hw/tcx.c | 4 ++-- hw/vga-isa-mm.c | 3 ++- hw/vga-isa.c | 3 ++- hw/vga-pci.c | 3 ++- hw/vga_int.h | 1 + hw/vmware_vga.c | 3 ++- hw/xenfb.c | 2 ++ 25 files changed, 48 insertions(+), 23 deletions(-)