diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-03-13 14:04:18 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-04-16 09:03:49 +0200 |
commit | 380cd056ec0e7fc8bbd553cdcb061d3ca612bb82 (patch) | |
tree | e8097697817029ca6d545b8f68ba9761fb0f8164 /hw/display/tcx.c | |
parent | 27be55872dd747c733a42a3d90864d9f59272d26 (diff) |
console: add GraphicHwOps
Pass a single GraphicHwOps struct pointer to graphic_console_init,
instead of a bunch of function pointers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/display/tcx.c')
-rw-r--r-- | hw/display/tcx.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/hw/display/tcx.c b/hw/display/tcx.c index ba3857a25b..77c7191c76 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -510,6 +510,16 @@ static const MemoryRegionOps dummy_ops = { }, }; +static const GraphicHwOps tcx_ops = { + .invalidate = tcx_invalidate_display, + .gfx_update = tcx_update_display, +}; + +static const GraphicHwOps tcx24_ops = { + .invalidate = tcx24_invalidate_display, + .gfx_update = tcx24_update_display, +}; + static int tcx_init1(SysBusDevice *dev) { TCXState *s = FROM_SYSBUS(TCXState, dev); @@ -562,18 +572,14 @@ static int tcx_init1(SysBusDevice *dev) &s->vram_mem, vram_offset, size); sysbus_init_mmio(dev, &s->vram_cplane); - s->con = graphic_console_init(tcx24_update_display, - tcx24_invalidate_display, - NULL, s); + s->con = graphic_console_init(&tcx24_ops, s); } else { /* THC 8 bit (dummy) */ memory_region_init_io(&s->thc8, &dummy_ops, s, "tcx.thc8", TCX_THC_NREGS_8); sysbus_init_mmio(dev, &s->thc8); - s->con = graphic_console_init(tcx_update_display, - tcx_invalidate_display, - NULL, s); + s->con = graphic_console_init(&tcx_ops, s); } qemu_console_resize(s->con, s->width, s->height); |