summaryrefslogtreecommitdiffstats
path: root/hw/jazz_led.c
diff options
context:
space:
mode:
authoraliguori2009-01-16 20:04:14 +0100
committeraliguori2009-01-16 20:04:14 +0100
commit3023f3329d87a6203d03a0e9ccb948772940da96 (patch)
tree2e1bea1fcce30aa15940275277f52022d7325341 /hw/jazz_led.c
parentFix false positive for AIO on OpenBSD (diff)
downloadqemu-3023f3329d87a6203d03a0e9ccb948772940da96.tar.gz
qemu-3023f3329d87a6203d03a0e9ccb948772940da96.tar.xz
qemu-3023f3329d87a6203d03a0e9ccb948772940da96.zip
graphical_console_init change (Stefano Stabellini)
Patch 5/7 This patch changes the graphical_console_init function to return an allocated DisplayState instead of a QEMUConsole. This patch contains just the graphical_console_init change and few other modifications mainly in console.c and vl.c. It was necessary to move the display frontends (e.g. sdl and vnc) initialization after machine->init in vl.c. This patch does *not* include any required changes to any device, these changes come with the following patches. Patch 6/7 This patch changes the QEMUMachine init functions not to take a DisplayState as an argument because is not needed any more; In few places the graphic hardware initialization function was called only if DisplayState was not NULL, now they are always called. Apart from these cases, the rest are all mechanical substitutions. Patch 7/7 This patch updates the graphic device code to use the new graphical_console_init function. As for the previous patch, in few places graphical_console_init was called only if DisplayState was not NULL, now it is always called. Apart from these cases, the rest are all mechanical substitutions. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6344 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/jazz_led.c')
-rw-r--r--hw/jazz_led.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/hw/jazz_led.c b/hw/jazz_led.c
index a3aaec7a0c..fdef9d8150 100644
--- a/hw/jazz_led.c
+++ b/hw/jazz_led.c
@@ -36,7 +36,6 @@ typedef enum {
typedef struct LedState {
uint8_t segments;
DisplayState *ds;
- QEMUConsole *console;
screen_state_t state;
} LedState;
@@ -289,7 +288,7 @@ static void jazz_led_text_update(void *opaque, console_ch_t *chardata)
char buf[2];
dpy_cursor(s->ds, -1, -1);
- qemu_console_resize(s->console, 2, 1);
+ qemu_console_resize(s->ds, 2, 1);
/* TODO: draw the segments */
snprintf(buf, 2, "%02hhx\n", s->segments);
@@ -299,7 +298,7 @@ static void jazz_led_text_update(void *opaque, console_ch_t *chardata)
dpy_update(s->ds, 0, 0, 2, 1);
}
-void jazz_led_init(DisplayState *ds, target_phys_addr_t base)
+void jazz_led_init(target_phys_addr_t base)
{
LedState *s;
int io;
@@ -308,15 +307,14 @@ void jazz_led_init(DisplayState *ds, target_phys_addr_t base)
if (!s)
return;
- s->ds = ds;
s->state = REDRAW_SEGMENTS | REDRAW_BACKGROUND;
io = cpu_register_io_memory(0, led_read, led_write, s);
cpu_register_physical_memory(base, 1, io);
- s->console = graphic_console_init(ds, jazz_led_update_display,
- jazz_led_invalidate_display,
- jazz_led_screen_dump,
- jazz_led_text_update, s);
- qemu_console_resize(s->console, 60, 80);
+ s->ds = graphic_console_init(jazz_led_update_display,
+ jazz_led_invalidate_display,
+ jazz_led_screen_dump,
+ jazz_led_text_update, s);
+ qemu_console_resize(s->ds, 60, 80);
}