diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-16 10:28:43 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-16 10:28:43 -0500 |
commit | 100c533220d70ae9732ba63142d71d1c48688f54 (patch) | |
tree | f71fd975474f159fbb366cd915b3765825a555b4 /hw/display/qxl.c | |
parent | 398973fe1f92e65f39f6a26dacc07baa0da632fc (diff) | |
parent | bfe528b9b99d52693a55f2b803039d68a97bcfb2 (diff) |
Merge remote-tracking branch 'kraxel/pixman.v11' into staging
# By Gerd Hoffmann (22) and Igor Mitsyanko (2)
# Via Gerd Hoffmann
* kraxel/pixman.v11: (24 commits)
qxl: register QemuConsole for secondary cards
gtk: custom cursor support
console: allow pinning displaychangelisteners to consoles
console: add qemu_console_is_*
xen: re-enable refresh interval reporting for xenfb
console: gui timer fixes
console: add GraphicHwOps
console: make DisplayState private to console.c
console: move gui_update+gui_setup_refresh from vl.c into console.c
console: zap g_width + g_height
console: simplify screendump
console: give each QemuConsole its own DisplaySurface
console: rename vga_hw_*, add QemuConsole param
console: displaystate init revamp
console: add trace events
console: switch color_table_rgb to pixman_color_t
console: use pixman for font rendering
console: use pixman for fill+blit
pixman: render vgafont glyphs into pixman images
pixman: add qemu_pixman_color()
...
Message-id: 1366105178-26744-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/display/qxl.c')
-rw-r--r-- | hw/display/qxl.c | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 930b7cf2ad..437f8d0eee 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1074,7 +1074,7 @@ static void qxl_enter_vga_mode(PCIQXLDevice *d) qemu_spice_create_host_primary(&d->ssd); d->mode = QXL_MODE_VGA; vga_dirty_log_start(&d->vga); - vga_hw_update(); + graphic_hw_update(d->vga.con); } static void qxl_exit_vga_mode(PCIQXLDevice *d) @@ -1753,7 +1753,7 @@ static void qxl_hw_update(void *opaque) switch (qxl->mode) { case QXL_MODE_VGA: - vga->update(vga); + vga->hw_ops->gfx_update(vga); break; case QXL_MODE_COMPAT: case QXL_MODE_NATIVE: @@ -1769,26 +1769,9 @@ static void qxl_hw_invalidate(void *opaque) PCIQXLDevice *qxl = opaque; VGACommonState *vga = &qxl->vga; - 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; + if (qxl->mode == QXL_MODE_VGA) { + vga->hw_ops->invalidate(vga); + return; } } @@ -1798,7 +1781,7 @@ static void qxl_hw_text_update(void *opaque, console_ch_t *chardata) VGACommonState *vga = &qxl->vga; if (qxl->mode == QXL_MODE_VGA) { - vga->text_update(vga, chardata); + vga->hw_ops->text_update(vga, chardata); return; } } @@ -2058,6 +2041,12 @@ static int qxl_init_common(PCIQXLDevice *qxl) return 0; } +static const GraphicHwOps qxl_ops = { + .invalidate = qxl_hw_invalidate, + .gfx_update = qxl_hw_update, + .text_update = qxl_hw_text_update, +}; + static int qxl_init_primary(PCIDevice *dev) { PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev); @@ -2074,10 +2063,7 @@ static int qxl_init_primary(PCIDevice *dev) portio_list_init(qxl_vga_port_list, qxl_vga_portio_list, vga, "vga"); 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); - qxl->ssd.con = vga->con, + vga->con = graphic_console_init(&qxl_ops, qxl); qemu_spice_display_init_common(&qxl->ssd); rc = qxl_init_common(qxl); @@ -2086,6 +2072,7 @@ static int qxl_init_primary(PCIDevice *dev) } qxl->ssd.dcl.ops = &display_listener_ops; + qxl->ssd.dcl.con = vga->con; ds = qemu_console_displaystate(vga->con); register_displaychangelistener(ds, &qxl->ssd.dcl); return rc; @@ -2101,6 +2088,7 @@ static int qxl_init_secondary(PCIDevice *dev) memory_region_init_ram(&qxl->vga.vram, "qxl.vgavram", qxl->vga.vram_size); vmstate_register_ram(&qxl->vga.vram, &qxl->pci.qdev); qxl->vga.vram_ptr = memory_region_get_ram_ptr(&qxl->vga.vram); + qxl->vga.con = graphic_console_init(&qxl_ops, qxl); return qxl_init_common(qxl); } |