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/milkymist-vgafb.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/milkymist-vgafb.c')
-rw-r--r-- | hw/display/milkymist-vgafb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c index 9bdb5c7e99..716997caa2 100644 --- a/hw/display/milkymist-vgafb.c +++ b/hw/display/milkymist-vgafb.c @@ -270,6 +270,11 @@ static void milkymist_vgafb_reset(DeviceState *d) s->regs[R_BASEADDRESS] = 0; } +static const GraphicHwOps vgafb_ops = { + .invalidate = vgafb_invalidate_display, + .gfx_update = vgafb_update_display, +}; + static int milkymist_vgafb_init(SysBusDevice *dev) { MilkymistVgafbState *s = FROM_SYSBUS(typeof(*s), dev); @@ -278,9 +283,7 @@ static int milkymist_vgafb_init(SysBusDevice *dev) "milkymist-vgafb", R_MAX * 4); sysbus_init_mmio(dev, &s->regs_region); - s->con = graphic_console_init(vgafb_update_display, - vgafb_invalidate_display, - NULL, s); + s->con = graphic_console_init(&vgafb_ops, s); return 0; } |