]> xenbits.xensource.com Git - qemu-xen-3.4-testing.git/commitdiff
graphical_console_init change (Stefano Stabellini)
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 10 Mar 2009 18:06:11 +0000 (18:06 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 10 Mar 2009 18:06:11 +0000 (18:06 +0000)
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>
As adapted by Stefano to qemu-xen-unstable in his posting:
 [Xen-devel] [PATCH 6 of 13] graphical_console_init change
which also contains several following fixes.

61 files changed:
console.c
console.h
curses.c
hw/an5206.c
hw/blizzard.c
hw/boards.h
hw/cirrus_vga.c
hw/devices.h
hw/dummy_m68k.c
hw/etraxfs.c
hw/g364fb.c
hw/gumstix.c
hw/i2c.h
hw/integratorcp.c
hw/jazz_led.c
hw/mainstone.c
hw/mcf5208.c
hw/mips.h
hw/mips_jazz.c
hw/mips_malta.c
hw/mips_mipssim.c
hw/mips_r4k.c
hw/musicpal.c
hw/nseries.c
hw/omap.h
hw/omap1.c
hw/omap2.c
hw/omap_dss.c
hw/omap_lcdc.c
hw/palm.c
hw/pc.c
hw/pc.h
hw/pci.h
hw/pl110.c
hw/ppc405_boards.c
hw/ppc_chrp.c
hw/ppc_oldworld.c
hw/ppc_prep.c
hw/primecell.h
hw/pxa.h
hw/pxa2xx.c
hw/pxa2xx_lcd.c
hw/r2d.c
hw/realview.c
hw/shix.c
hw/spitz.c
hw/ssd0303.c
hw/ssd0323.c
hw/stellaris.c
hw/sun4m.c
hw/sun4m.h
hw/sun4u.c
hw/tcx.c
hw/tosa.c
hw/versatilepb.c
hw/vga.c
hw/vga_int.h
hw/vmware_vga.c
hw/xen_machine_fv.c
hw/xenfb.c
vl.c

index 4dbdc912770be1beb2a5d50e7f1f636368120ac9..01913280485db4ffb8d6f0c52f4773a264f6ff6a 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1006,8 +1006,13 @@ void console_select(unsigned int index)
     if (s) {
         DisplayState *ds = s->ds;
         active_console = s;
-        ds->surface = qemu_resize_displaysurface(ds->surface, s->g_width,
-                                                s->g_height, 32, 4 * s->g_width);
+        if (ds_get_bits_per_pixel(s->ds)) {
+            ds->surface = qemu_resize_displaysurface(ds->surface, s->g_width,
+                    s->g_height, 32, 4 * s->g_width);
+        } else {
+            s->ds->surface->width = s->width;
+            s->ds->surface->height = s->height;
+        }
         dpy_resize(s->ds);
         vga_hw_invalidate();
     }
@@ -1116,7 +1121,11 @@ void kbd_put_keysym(int keysym)
 static void text_console_invalidate(void *opaque)
 {
     TextConsole *s = (TextConsole *) opaque;
-
+    if (!ds_get_bits_per_pixel(s->ds) && s->console_type == TEXT_CONSOLE) {
+        s->g_width = ds_get_width(s->ds);
+        s->g_height = ds_get_height(s->ds);
+        text_console_resize(s);
+    }
     console_refresh(s);
 }
 
@@ -1147,6 +1156,18 @@ static void text_console_update(void *opaque, console_ch_t *chardata)
     }
 }
 
+static TextConsole *get_graphic_console(DisplayState *ds)
+{
+    int i;
+    TextConsole *s;
+    for (i = 0; i < nb_consoles; i++) {
+        s = consoles[i];
+        if (s->console_type == GRAPHIC_CONSOLE && s->ds == ds)
+            return s;
+    }
+    return NULL;
+}
+
 static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
 {
     TextConsole *s;
@@ -1174,27 +1195,39 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
             consoles[i] = consoles[i - 1];
         }
         consoles[i] = s;
+        nb_consoles++;
     }
     return s;
 }
 
-TextConsole *graphic_console_init(DisplayState *ds, vga_hw_update_ptr update,
-                                  vga_hw_invalidate_ptr invalidate,
-                                  vga_hw_screen_dump_ptr screen_dump,
-                                  vga_hw_text_update_ptr text_update,
-                                  void *opaque)
+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,
+                                   void *opaque)
 {
     TextConsole *s;
+    DisplayState *ds;
+
+    ds = (DisplayState *) qemu_mallocz(sizeof(DisplayState));
+    if (ds == NULL)
+        return NULL;
+    ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
 
     s = new_console(ds, GRAPHIC_CONSOLE);
-    if (!s)
-      return NULL;
+    if (s == NULL) {
+        qemu_free_displaysurface(ds->surface);
+        qemu_free(ds);
+        return NULL;
+    }
     s->hw_update = update;
     s->hw_invalidate = invalidate;
     s->hw_screen_dump = screen_dump;
     s->hw_text_update = text_update;
     s->hw = opaque;
-    return s;
+
+    register_displaystate(ds);
+    return ds;
 }
 
 int is_graphic_console(void)
@@ -1218,19 +1251,19 @@ void console_color_init(DisplayState *ds)
     }
 }
 
-CharDriverState *text_console_init(DisplayState *ds, const char *p)
+static int n_text_consoles;
+static CharDriverState *text_consoles[128];
+static char *text_console_strs[128];
+
+static void text_console_do_init(CharDriverState *chr, DisplayState *ds, const char *p)
 {
-    CharDriverState *chr;
     TextConsole *s;
     static int color_inited;
 
-    chr = qemu_mallocz(sizeof(CharDriverState));
-    if (!chr)
-        return NULL;
     s = new_console(ds, (p == 0) ? TEXT_CONSOLE : TEXT_CONSOLE_FIXED_SIZE);
     if (!s) {
         free(chr);
-        return NULL;
+        return;
     }
     chr->opaque = s;
     chr->chr_write = console_puts;
@@ -1240,6 +1273,7 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p)
     s->out_fifo.buf = s->out_fifo_buf;
     s->out_fifo.buf_size = sizeof(s->out_fifo_buf);
     s->kbd_timer = qemu_new_timer(rt_clock, kbd_send_chars, s);
+    s->ds = ds;
 
     if (!color_inited) {
         color_inited = 1;
@@ -1267,26 +1301,57 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p)
     text_console_resize(s);
 
     qemu_chr_reset(chr);
+}
+
+CharDriverState *text_console_init(const char *p)
+{
+    CharDriverState *chr;
+
+    chr = qemu_mallocz(sizeof(CharDriverState));
+    if (!chr)
+        return NULL;
+
+    if (n_text_consoles == 128) {
+        fprintf(stderr, "Too many text consoles\n");
+        exit(1);
+    }
+    text_consoles[n_text_consoles] = chr;
+    text_console_strs[n_text_consoles] = p ? qemu_strdup(p) : NULL;
+    n_text_consoles++;
 
     return chr;
 }
 
-void qemu_console_resize(QEMUConsole *console, int width, int height)
+void text_consoles_set_display(DisplayState *ds)
 {
-    console->g_width = width;
-    console->g_height = height;
-    if (active_console == console) {
-        DisplayState *ds = console->ds;
+    int i;
+
+    for (i = 0; i < n_text_consoles; i++) {
+        text_console_do_init(text_consoles[i], ds, text_console_strs[i]);
+        qemu_free(text_console_strs[i]);
+    }
+
+    n_text_consoles = 0;
+}
+
+void qemu_console_resize(DisplayState *ds, int width, int height)
+{
+    TextConsole *s = get_graphic_console(ds);
+    if (!s) return;
+    s->g_width = width;
+    s->g_height = height;
+    if (is_graphic_console()) {
         ds->surface = qemu_resize_displaysurface(ds->surface, width, height, 32, 4 * width);
-        dpy_resize(console->ds);
+        dpy_resize(ds);
     }
 }
 
-void qemu_console_copy(QEMUConsole *console, int src_x, int src_y,
+void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
                 int dst_x, int dst_y, int w, int h)
 {
-    if (active_console == console)
-        dpy_copy(console->ds, src_x, src_y, dst_x, dst_y, w, h);
+    if (is_graphic_console()) {
+        dpy_copy(ds, src_x, src_y, dst_x, dst_y, w, h);
+    }
 }
 
 PixelFormat qemu_different_endianness_pixelformat(int bpp)
index 2d7ca730163d5c5f96f27503eeb02f8d0ae8e628..0006230d867bfe5fd87f8cf9984ee12457a41daa 100644 (file)
--- a/console.h
+++ b/console.h
@@ -117,8 +117,12 @@ struct DisplayState {
     void (*mouse_set)(int x, int y, int on);
     void (*cursor_define)(int width, int height, int bpp, int hot_x, int hot_y,
                           uint8_t *image, uint8_t *mask);
+
+    struct DisplayState *next;
 };
 
+void register_displaystate(DisplayState *ds);
+DisplayState *get_displaystate(void);
 DisplaySurface* qemu_create_displaysurface(int width, int height, int bpp, int linesize);
 DisplaySurface* qemu_resize_displaysurface(DisplaySurface *surface,
                                            int width, int height, int bpp, int linesize);
@@ -245,7 +249,7 @@ typedef void (*vga_hw_invalidate_ptr)(void *);
 typedef void (*vga_hw_screen_dump_ptr)(void *, const char *);
 typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *);
 
-TextConsole *graphic_console_init(DisplayState *ds, vga_hw_update_ptr update,
+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,
@@ -256,11 +260,12 @@ void vga_hw_screen_dump(const char *filename);
 
 int is_graphic_console(void);
 int is_fixedsize_console(void);
-CharDriverState *text_console_init(DisplayState *ds, const char *p);
+CharDriverState *text_console_init(const char *p);
+void text_consoles_set_display(DisplayState *ds);
 void console_select(unsigned int index);
 void console_color_init(DisplayState *ds);
-void qemu_console_resize(QEMUConsole *console, int width, int height);
-void qemu_console_copy(QEMUConsole *console, int src_x, int src_y,
+void qemu_console_resize(DisplayState *ds, int width, int height);
+void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
                 int dst_x, int dst_y, int w, int h);
 
 /* sdl.c */
index b3aa01192c4335f8cad7a01378af16ba63bd402c..97ab41263296df22be52f225c3aa8d259e4f0e3a 100644 (file)
--- a/curses.c
+++ b/curses.c
@@ -106,6 +106,8 @@ static void curses_resize(DisplayState *ds)
     gheight = ds_get_height(ds);
 
     curses_calc_pad();
+    ds->surface->width = width * FONT_WIDTH;
+    ds->surface->height = height * FONT_HEIGHT;
 }
 
 #ifndef _WIN32
@@ -367,7 +369,7 @@ void curses_display_init(DisplayState *ds, int full_screen)
     dcl->dpy_text_cursor = curses_cursor_position;
     register_displaychangelistener(ds, dcl);
     qemu_free_displaysurface(ds->surface);
-    ds->surface = qemu_create_displaysurface_from(80, 25, 0, 0, (uint8_t*) screen);
+    ds->surface = qemu_create_displaysurface_from(640, 400, 0, 0, (uint8_t*) screen);
 
     invalidate = 1;
 
index 862d0cf7289fc527d4fbc02431cba880ab962b91..cc1870be6c7eecf736f51106fff26354d800a2ca 100644 (file)
@@ -31,7 +31,7 @@ void DMA_run (void)
 /* Board init.  */
 
 static void an5206_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
index 30641f5dcd6c96ecd297ffef37cebac1d36868fb..041ef5f1ff549df65876a3d688dca54bff210648 100644 (file)
@@ -73,7 +73,6 @@ struct blizzard_s {
     uint8_t iformat;
     uint8_t source;
     DisplayState *state;
-    QEMUConsole *console;
     blizzard_fn_t *line_fn_tab[2];
     void *fb;
 
@@ -897,7 +896,7 @@ static void blizzard_update_display(void *opaque)
 
     if (s->x != ds_get_width(s->state) || s->y != ds_get_height(s->state)) {
         s->invalidate = 1;
-        qemu_console_resize(s->console, s->x, s->y);
+        qemu_console_resize(s->state, s->x, s->y);
     }
 
     if (s->invalidate) {
@@ -955,11 +954,10 @@ static void blizzard_screen_dump(void *opaque, const char *filename) {
 #define DEPTH 32
 #include "blizzard_template.h"
 
-void *s1d13745_init(qemu_irq gpio_int, DisplayState *ds)
+void *s1d13745_init(qemu_irq gpio_int)
 {
     struct blizzard_s *s = (struct blizzard_s *) qemu_mallocz(sizeof(*s));
 
-    s->state = ds;
     s->fb = qemu_malloc(0x180000);
 
     switch (ds_get_bits_per_pixel(s->state)) {
@@ -994,9 +992,9 @@ void *s1d13745_init(qemu_irq gpio_int, DisplayState *ds)
 
     blizzard_reset(s);
 
-    s->console = graphic_console_init(s->state, blizzard_update_display,
-                                      blizzard_invalidate_display,
-                                      blizzard_screen_dump, NULL, s);
+    s->state = graphic_console_init(blizzard_update_display,
+                                 blizzard_invalidate_display,
+                                 blizzard_screen_dump, NULL, s);
 
     return s;
 }
index c92c6da6a3ad17aff5a5df3bf112673bac49866f..b774fb15832857e9b4f67c193dafc8d08a9f8956 100644 (file)
@@ -4,7 +4,7 @@
 #define HW_BOARDS_H
 
 typedef void QEMUMachineInitFunc(ram_addr_t ram_size, int vga_ram_size,
-                                 const char *boot_device, DisplayState *ds,
+                                 const char *boot_device,
                                  const char *kernel_filename,
                                  const char *kernel_cmdline,
                                  const char *initrd_filename,
index 2c9dfad300198d9c3b7d55cb0e43181483767acc..796ee9095c5cb2bf6464e13266e047fbb852519c 100644 (file)
@@ -778,7 +778,7 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
                      s->cirrus_blt_width, s->cirrus_blt_height);
 
     if (notify)
-       qemu_console_copy(s->console,
+       qemu_console_copy(s->ds,
                          sx, sy, dx, dy,
                          s->cirrus_blt_width / depth,
                          s->cirrus_blt_height);
@@ -3280,7 +3280,7 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
  *
  ***************************************/
 
-void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
+void isa_cirrus_vga_init(uint8_t *vga_ram_base,
                          unsigned long vga_ram_offset, int vga_ram_size)
 {
     CirrusVGAState *s;
@@ -3293,7 +3293,7 @@ void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
     }
 
     vga_common_init((VGAState *)s,
-                    ds, vga_ram_base, vga_ram_offset, vga_ram_size);
+                    vga_ram_base, vga_ram_offset, vga_ram_size);
     cirrus_init_common(s, CIRRUS_ID_CLGD5430, 0);
     /* XXX ISA-LFB support */
 }
@@ -3331,7 +3331,7 @@ static void cirrus_pci_mmio_map(PCIDevice *d, int region_num,
                                 s->cirrus_mmio_io_addr);
 }
 
-void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
+void pci_cirrus_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
                          unsigned long vga_ram_offset, int vga_ram_size)
 {
     PCICirrusVGAState *d;
@@ -3366,8 +3366,9 @@ void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
         vga_ram_size = 4*1024*1024;
     }
     vga_common_init((VGAState *)s,
-                    ds, vga_ram_base, vga_ram_offset, vga_ram_size);
+                    vga_ram_base, vga_ram_offset, vga_ram_size);
     cirrus_init_common(s, device_id, 1);
+
     s->pci_dev = (PCIDevice *)d;
 
     /* setup memory space */
index 45fead9c27186c1d25dc368bfb902439c45723ee..bd0035182320af6095f4cd36dd29bc470b3a9da1 100644 (file)
@@ -8,7 +8,7 @@ void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
 
 /* ssd0323.c */
 int ssd0323_xfer_ssi(void *opaque, int data);
-void *ssd0323_init(DisplayState *ds, qemu_irq *cmd_p);
+void *ssd0323_init(qemu_irq *cmd_p);
 
 /* ads7846.c */
 struct ads7846_state_s;
@@ -37,7 +37,7 @@ void tsc2005_set_transform(void *opaque, struct mouse_transform_info_s *info);
 void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode);
 
 /* blizzard.c */
-void *s1d13745_init(qemu_irq gpio_int, DisplayState *ds);
+void *s1d13745_init(qemu_irq gpio_int);
 void s1d13745_write(void *opaque, int dc, uint16_t value);
 void s1d13745_write_block(void *opaque, int dc,
                 void *buf, size_t len, int pitch);
index f7a80afcf9a9df3acd3464cfc5536a5b120ff33e..4d52aa8cbc5289b2f0cc34b0946452ed510a4632 100644 (file)
@@ -15,7 +15,7 @@
 /* Board init.  */
 
 static void dummy_m68k_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
index 2987c8f717ee2d7cbc2192289aa03000007d9e13..e301e32a02b13338ba6c12503fe4f3a537b72af6 100644 (file)
@@ -48,7 +48,7 @@ static void main_cpu_reset(void *opaque)
 
 static
 void bareetraxfs_init (ram_addr_t ram_size, int vga_ram_size,
-                       const char *boot_device, DisplayState *ds,
+                       const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
 {
index ed690ea805ec07c96755cc65a450da3d0141b689..1087516e3353587053f8e36847555e89b7e4d033 100644 (file)
@@ -33,7 +33,6 @@ typedef struct G364State {
     uint8_t palette[256][3];
     /* display refresh support */
     DisplayState *ds;
-    QEMUConsole *console;
     int graphic_mode;
     uint32_t scr_width, scr_height; /* in pixels */
 } G364State;
@@ -132,7 +131,7 @@ static void g364fb_update_display(void *opaque)
         full_update = 1;
     }
     if (s->scr_width != ds_get_width(s->ds) || s->scr_height != ds_get_height(s->ds)) {
-        qemu_console_resize(s->console, s->scr_width, s->scr_height);
+        qemu_console_resize(s->ds, s->scr_width, s->scr_height);
         full_update = 1;
     }
     switch(graphic_mode) {
@@ -357,8 +356,7 @@ static CPUWriteMemoryFunc *g364fb_mem_write[3] = {
     g364fb_mem_writel,
 };
 
-int g364fb_mm_init(DisplayState *ds,
-                   int vram_size, int it_shift,
+int g364fb_mm_init(int vram_size, int it_shift,
                    target_phys_addr_t vram_base, target_phys_addr_t ctrl_base)
 {
     G364State *s;
@@ -374,12 +372,11 @@ int g364fb_mm_init(DisplayState *ds,
     qemu_register_reset(g364fb_reset, s);
     g364fb_reset(s);
 
-    s->ds = ds;
     s->vram_base = vram_base;
 
-    s->console = graphic_console_init(ds, g364fb_update_display,
-                                      g364fb_invalidate_display,
-                                      g364fb_screen_dump, NULL, s);
+    s->ds = graphic_console_init(g364fb_update_display,
+                                 g364fb_invalidate_display,
+                                 g364fb_screen_dump, NULL, s);
 
     io_vram = cpu_register_io_memory(0, g364fb_mem_read, g364fb_mem_write, s);
     cpu_register_physical_memory(s->vram_base, vram_size, io_vram);
index f184648e5637f529b242003aa542fb6e25e3458a..069aec07dbc9b897a15b811dfe8f28a2e7a9d5e7 100644 (file)
@@ -42,7 +42,7 @@
 static const int sector_len = 128 * 1024;
 
 static void connex_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
@@ -58,7 +58,7 @@ static void connex_init(ram_addr_t ram_size, int vga_ram_size,
         exit(1);
     }
 
-    cpu = pxa255_init(connex_ram, ds);
+    cpu = pxa255_init(connex_ram);
 
     index = drive_get_index(IF_PFLASH, 0, 0);
     if (index == -1) {
@@ -82,7 +82,7 @@ static void connex_init(ram_addr_t ram_size, int vga_ram_size,
 }
 
 static void verdex_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
@@ -98,7 +98,7 @@ static void verdex_init(ram_addr_t ram_size, int vga_ram_size,
         exit(1);
     }
 
-    cpu = pxa270_init(verdex_ram, ds, cpu_model ?: "pxa270-c0");
+    cpu = pxa270_init(verdex_ram, cpu_model ?: "pxa270-c0");
 
     index = drive_get_index(IF_PFLASH, 0, 0);
     if (index == -1) {
index d3e4352b1ffc040f6602cbf13c2607def4085e1b..b8026b16a09fbc2eeec64208f8aa1a79123fabcb 100644 (file)
--- a/hw/i2c.h
+++ b/hw/i2c.h
@@ -71,7 +71,7 @@ void wm8750_dac_commit(void *opaque);
 void wm8750_set_bclk_in(void *opaque, int hz);
 
 /* ssd0303.c */
-void ssd0303_init(DisplayState *ds, i2c_bus *bus, int address);
+void ssd0303_init(i2c_bus *bus, int address);
 
 /* twl92230.c */
 i2c_slave *twl92230_init(i2c_bus *bus, qemu_irq irq);
index 1ae5d2a8335745864cd5dbd61c976c1d47cbb4d5..f93e0c3f50d135cd57c4db7ad708f2ba6a79bd79 100644 (file)
@@ -475,7 +475,7 @@ static struct arm_boot_info integrator_binfo = {
 };
 
 static void integratorcp_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
@@ -530,7 +530,7 @@ static void integratorcp_init(ram_addr_t ram_size, int vga_ram_size,
             exit (1);
         }
     }
-    pl110_init(ds, 0xc0000000, pic[22], 0);
+    pl110_init(0xc0000000, pic[22], 0);
 
     integrator_binfo.ram_size = ram_size;
     integrator_binfo.kernel_filename = kernel_filename;
index c8ac26372f65175eb7cb2b14c1fc96a597795668..863d9ee4bc711735aeeacf71f15757c403526d65 100644 (file)
@@ -37,7 +37,6 @@ typedef struct LedState {
     target_phys_addr_t base;
     uint8_t segments;
     DisplayState *ds;
-    QEMUConsole *console;
     screen_state_t state;
 } LedState;
 
@@ -292,7 +291,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);
@@ -302,7 +301,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;
@@ -312,15 +311,14 @@ void jazz_led_init(DisplayState *ds, target_phys_addr_t base)
         return;
 
     s->base = base;
-    s->ds = ds;
     s->state = REDRAW_SEGMENTS | REDRAW_BACKGROUND;
 
     io = cpu_register_io_memory(0, led_read, led_write, s);
     cpu_register_physical_memory(s->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);
 }
index f4feb4fe2ae92a01e7612b80c7d8c2ad67d5593d..1cb08a5832bba87bee2dff7dcdee53c1c6140151 100644 (file)
@@ -69,7 +69,7 @@ static struct arm_boot_info mainstone_binfo = {
 };
 
 static void mainstone_common_init(ram_addr_t ram_size, int vga_ram_size,
-                DisplayState *ds, const char *kernel_filename,
+                const char *kernel_filename,
                 const char *kernel_cmdline, const char *initrd_filename,
                 const char *cpu_model, enum mainstone_model_e model, int arm_id)
 {
@@ -91,7 +91,7 @@ static void mainstone_common_init(ram_addr_t ram_size, int vga_ram_size,
         exit(1);
     }
 
-    cpu = pxa270_init(mainstone_binfo.ram_size, ds, cpu_model);
+    cpu = pxa270_init(mainstone_binfo.ram_size, cpu_model);
     cpu_register_physical_memory(0, MAINSTONE_ROM,
                     qemu_ram_alloc(MAINSTONE_ROM) | IO_MEM_ROM);
 
@@ -135,11 +135,11 @@ static void mainstone_common_init(ram_addr_t ram_size, int vga_ram_size,
 }
 
 static void mainstone_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
-    mainstone_common_init(ram_size, vga_ram_size, ds, kernel_filename,
+    mainstone_common_init(ram_size, vga_ram_size, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, mainstone, 0x196);
 }
 
index fe3566ee0f6b0e562cb9801debcd070e4a4d9647..9dd1410a374dae0898efa7586cc63f33c2b292e9 100644 (file)
@@ -203,7 +203,7 @@ static void mcf5208_sys_init(qemu_irq *pic)
 }
 
 static void mcf5208evb_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
index 1ebb107dbcf76345c1a7cb4c72210ee5b6c57298..09144275bd5fd53614f15d046965aacdc8202ef5 100644 (file)
--- a/hw/mips.h
+++ b/hw/mips.h
@@ -10,15 +10,14 @@ void *ds1225y_init(target_phys_addr_t mem_base, const char *filename);
 void ds1225y_set_protection(void *opaque, int protection);
 
 /* g364fb.c */
-int g364fb_mm_init(DisplayState *ds,
-                   int vram_size, int it_shift,
+int g364fb_mm_init(int vram_size, int it_shift,
                    target_phys_addr_t vram_base, target_phys_addr_t ctrl_base);
 
 /* mipsnet.c */
 void mipsnet_init(int base, qemu_irq irq, NICInfo *nd);
 
 /* jazz_led.c */
-extern void jazz_led_init(DisplayState *ds, target_phys_addr_t base);
+extern void jazz_led_init(target_phys_addr_t base);
 
 /* mips_int.c */
 extern void cpu_mips_irq_init_cpu(CPUState *env);
index 68e63ff436b5518cf340e2b029e84844679c5aff..5ea11545629b81d982b3b4f6004d5ebec3a20c67 100644 (file)
@@ -117,7 +117,7 @@ void espdma_memory_write(void *opaque, uint8_t *buf, int len)
 
 static
 void mips_jazz_init (ram_addr_t ram_size, int vga_ram_size,
-                     DisplayState *ds, const char *cpu_model,
+                     const char *cpu_model,
                      enum jazz_model_e jazz_model)
 {
     char buf[1024];
@@ -185,10 +185,10 @@ void mips_jazz_init (ram_addr_t ram_size, int vga_ram_size,
     /* Video card */
     switch (jazz_model) {
     case JAZZ_MAGNUM:
-        g364fb_mm_init(ds, vga_ram_size, 0, 0x40000000, 0x60000000);
+        g364fb_mm_init(vga_ram_size, 0, 0x40000000, 0x60000000);
         break;
     case JAZZ_PICA61:
-        isa_vga_mm_init(ds, phys_ram_base + ram_size, ram_size, vga_ram_size,
+        isa_vga_mm_init(phys_ram_base + ram_size, ram_size, vga_ram_size,
                         0x40000000, 0x60000000, 0);
         break;
     default:
@@ -251,25 +251,25 @@ void mips_jazz_init (ram_addr_t ram_size, int vga_ram_size,
     ds1225y_init(0x80009000, "nvram");
 
     /* LED indicator */
-    jazz_led_init(ds, 0x8000f000);
+    jazz_led_init(0x8000f000);
 }
 
 static
 void mips_magnum_init (ram_addr_t ram_size, int vga_ram_size,
-                       const char *boot_device, DisplayState *ds,
+                       const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
 {
-    mips_jazz_init(ram_size, vga_ram_size, ds, cpu_model, JAZZ_MAGNUM);
+    mips_jazz_init(ram_size, vga_ram_size, cpu_model, JAZZ_MAGNUM);
 }
 
 static
 void mips_pica61_init (ram_addr_t ram_size, int vga_ram_size,
-                       const char *boot_device, DisplayState *ds,
+                       const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
 {
-    mips_jazz_init(ram_size, vga_ram_size, ds, cpu_model, JAZZ_PICA61);
+    mips_jazz_init(ram_size, vga_ram_size, cpu_model, JAZZ_PICA61);
 }
 
 QEMUMachine mips_magnum_machine = {
index e1999d52e6af56ed08ff9bdf2228f8d947f9f3f8..e6c0003e1698eda2edaa42f1b8c826557dc3acf5 100644 (file)
@@ -765,7 +765,7 @@ static void main_cpu_reset(void *opaque)
 
 static
 void mips_malta_init (ram_addr_t ram_size, int vga_ram_size,
-                      const char *boot_device, DisplayState *ds,
+                      const char *boot_device,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
 {
@@ -940,7 +940,7 @@ void mips_malta_init (ram_addr_t ram_size, int vga_ram_size,
     network_init(pci_bus);
 
     /* Optional PCI video card */
-    pci_cirrus_vga_init(pci_bus, ds, phys_ram_base + ram_size,
+    pci_cirrus_vga_init(pci_bus, phys_ram_base + ram_size,
                         ram_size, vga_ram_size);
 }
 
index 4c636dbb5b361e69a0b878a4848c509410fdc027..466c585cf8156ec5d5c3c6b28446e48d1f71a1c7 100644 (file)
@@ -108,7 +108,7 @@ static void main_cpu_reset(void *opaque)
 
 static void
 mips_mipssim_init (ram_addr_t ram_size, int vga_ram_size,
-                   const char *boot_device, DisplayState *ds,
+                   const char *boot_device,
                    const char *kernel_filename, const char *kernel_cmdline,
                    const char *initrd_filename, const char *cpu_model)
 {
index 670a1eabac6b5c31d28cb3f57550eeeaf644cba8..109e71162902941dadcb0c9c6f57c9f1e134fec5 100644 (file)
@@ -148,7 +148,7 @@ static void main_cpu_reset(void *opaque)
 static const int sector_len = 32 * 1024;
 static
 void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size,
-                    const char *boot_device, DisplayState *ds,
+                    const char *boot_device,
                     const char *kernel_filename, const char *kernel_cmdline,
                     const char *initrd_filename, const char *cpu_model)
 {
@@ -244,7 +244,7 @@ void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size,
         }
     }
 
-    isa_vga_init(ds, phys_ram_base + ram_size, ram_size,
+    isa_vga_init(phys_ram_base + ram_size, ram_size,
                  vga_ram_size);
 
     if (nd_table[0].vlan) {
index 44a56598f953f424b450a6f5205fe4c1aeace8be..4cd9f3797e3312893ce491bcae0e7822d898bdf3 100644 (file)
@@ -758,7 +758,6 @@ typedef struct musicpal_lcd_state {
     int page;
     int page_off;
     DisplayState *ds;
-    QEMUConsole *console;
     uint8_t video_ram[128*64/8];
 } musicpal_lcd_state;
 
@@ -914,7 +913,7 @@ static CPUWriteMemoryFunc *musicpal_lcd_writefn[] = {
     musicpal_lcd_write
 };
 
-static void musicpal_lcd_init(DisplayState *ds, uint32_t base)
+static void musicpal_lcd_init(uint32_t base)
 {
     musicpal_lcd_state *s;
     int iomemtype;
@@ -923,14 +922,13 @@ static void musicpal_lcd_init(DisplayState *ds, uint32_t base)
     if (!s)
         return;
     s->base = base;
-    s->ds = ds;
     iomemtype = cpu_register_io_memory(0, musicpal_lcd_readfn,
                                        musicpal_lcd_writefn, s);
     cpu_register_physical_memory(base, MP_LCD_SIZE, iomemtype);
 
-    s->console = graphic_console_init(ds, lcd_refresh, lcd_invalidate,
-                                      NULL, NULL, s);
-    qemu_console_resize(s->console, 128*3, 64*3);
+    s->ds = graphic_console_init(lcd_refresh, lcd_invalidate,
+                                 NULL, NULL, s);
+    qemu_console_resize(s->ds, 128*3, 64*3);
 }
 
 /* PIC register offsets */
@@ -1427,7 +1425,7 @@ static struct arm_boot_info musicpal_binfo = {
 };
 
 static void musicpal_init(ram_addr_t ram_size, int vga_ram_size,
-               const char *boot_device, DisplayState *ds,
+               const char *boot_device,
                const char *kernel_filename, const char *kernel_cmdline,
                const char *initrd_filename, const char *cpu_model)
 {
@@ -1493,7 +1491,7 @@ static void musicpal_init(ram_addr_t ram_size, int vga_ram_size,
     }
     mv88w8618_flashcfg_init(MP_FLASHCFG_BASE);
 
-    musicpal_lcd_init(ds, MP_LCD_BASE);
+    musicpal_lcd_init(MP_LCD_BASE);
 
     qemu_add_kbd_event_handler(musicpal_key_event, pic[MP_GPIO_IRQ]);
 
index 1e60b5280c450ecf386f34f2fcdf6de383295bd5..7003b02a53dacebcbd496f0445604f2be9ea7bc5 100644 (file)
@@ -715,9 +715,9 @@ static void n800_dss_init(struct rfbi_chip_s *chip)
     free(fb_blank);
 }
 
-static void n8x0_dss_setup(struct n800_s *s, DisplayState *ds)
+static void n8x0_dss_setup(struct n800_s *s)
 {
-    s->blizzard.opaque = s1d13745_init(0, ds);
+    s->blizzard.opaque = s1d13745_init(0);
     s->blizzard.block = s1d13745_write_block;
     s->blizzard.write = s1d13745_write;
     s->blizzard.read = s1d13745_read;
@@ -1267,13 +1267,14 @@ static int n810_atag_setup(struct arm_boot_info *info, void *p)
 }
 
 static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
-                DisplayState *ds, const char *kernel_filename,
+                const char *kernel_filename,
                 const char *kernel_cmdline, const char *initrd_filename,
                 const char *cpu_model, struct arm_boot_info *binfo, int model)
 {
     struct n800_s *s = (struct n800_s *) qemu_mallocz(sizeof(*s));
     int sdram_size = binfo->ram_size;
     int onenandram_size = 0x00010000;
+    DisplayState *ds = get_displaystate();
 
     if (ram_size < sdram_size + onenandram_size + OMAP242X_SRAM_SIZE) {
         fprintf(stderr, "This architecture uses %i bytes of memory\n",
@@ -1281,7 +1282,7 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
         exit(1);
     }
 
-    s->cpu = omap2420_mpu_init(sdram_size, NULL, cpu_model);
+    s->cpu = omap2420_mpu_init(sdram_size, cpu_model);
 
     /* Setup peripherals
      *
@@ -1318,7 +1319,7 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
         n810_kbd_setup(s);
     }
     n8x0_spi_setup(s);
-    n8x0_dss_setup(s, ds);
+    n8x0_dss_setup(s);
     n8x0_cbus_setup(s);
     n8x0_uart_setup(s);
     if (usb_enabled)
@@ -1385,21 +1386,21 @@ static struct arm_boot_info n810_binfo = {
 };
 
 static void n800_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
-    return n8x0_init(ram_size, boot_device, ds,
+    return n8x0_init(ram_size, boot_device,
                     kernel_filename, kernel_cmdline, initrd_filename,
                     cpu_model, &n800_binfo, 800);
 }
 
 static void n810_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
-    return n8x0_init(ram_size, boot_device, ds,
+    return n8x0_init(ram_size, boot_device,
                     kernel_filename, kernel_cmdline, initrd_filename,
                     cpu_model, &n810_binfo, 810);
 }
index 4c30436a3edc06532fef24639c7329b8510bd1b5..f0a08bd02211fbe494058cd734fe725f184a7c72 100644 (file)
--- a/hw/omap.h
+++ b/hw/omap.h
@@ -747,7 +747,7 @@ struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
 struct omap_lcd_panel_s;
 void omap_lcdc_reset(struct omap_lcd_panel_s *s);
 struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq,
-                struct omap_dma_lcd_channel_s *dma, DisplayState *ds,
+                struct omap_dma_lcd_channel_s *dma,
                 ram_addr_t imif_base, ram_addr_t emiff_base, omap_clk clk);
 
 /* omap_dss.c */
@@ -760,7 +760,7 @@ struct rfbi_chip_s {
 struct omap_dss_s;
 void omap_dss_reset(struct omap_dss_s *s);
 struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
-                target_phys_addr_t l3_base, DisplayState *ds,
+                target_phys_addr_t l3_base,
                 qemu_irq irq, qemu_irq drq,
                 omap_clk fck1, omap_clk fck2, omap_clk ck54m,
                 omap_clk ick1, omap_clk ick2);
@@ -968,11 +968,11 @@ struct omap_mpu_state_s {
 
 /* omap1.c */
 struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,
-                DisplayState *ds, const char *core);
+                const char *core);
 
 /* omap2.c */
 struct omap_mpu_state_s *omap2420_mpu_init(unsigned long sdram_size,
-                DisplayState *ds, const char *core);
+                const char *core);
 
 # if TARGET_PHYS_ADDR_BITS == 32
 #  define OMAP_FMT_plx "%#08x"
index a32563bb8fa63a191370d08c52c66e7a62e72e71..7c3eb6aaba10544763272e158f1061b1e1581511 100644 (file)
@@ -4664,7 +4664,7 @@ static int omap_validate_tipb_mpui_addr(struct omap_mpu_state_s *s,
 }
 
 struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,
-                DisplayState *ds, const char *core)
+                const char *core)
 {
     int i;
     struct omap_mpu_state_s *s = (struct omap_mpu_state_s *)
@@ -4746,7 +4746,7 @@ struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,
                     omap_findclk(s, "clk32-kHz"));
 
     s->lcd = omap_lcdc_init(0xfffec000, s->irq[0][OMAP_INT_LCD_CTRL],
-                    omap_dma_get_lcdch(s->dma), ds, imif_base, emiff_base,
+                    omap_dma_get_lcdch(s->dma), imif_base, emiff_base,
                     omap_findclk(s, "lcd_ck"));
 
     omap_ulpd_pm_init(0xfffe0800, s);
index a5003834dd55fbccd2edc975311fcaeebf21ffea..d8648fe9487c5ea632bf6b0463d751eb62f3d5e2 100644 (file)
@@ -4538,7 +4538,7 @@ static const struct dma_irq_map omap2_dma_irq_map[] = {
 };
 
 struct omap_mpu_state_s *omap2420_mpu_init(unsigned long sdram_size,
-                DisplayState *ds, const char *core)
+                const char *core)
 {
     struct omap_mpu_state_s *s = (struct omap_mpu_state_s *)
             qemu_mallocz(sizeof(struct omap_mpu_state_s));
@@ -4716,7 +4716,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(unsigned long sdram_size,
                     omap_findclk(s, "spi2_fclk"),
                     omap_findclk(s, "spi2_iclk"));
 
-    s->dss = omap_dss_init(omap_l4ta(s->l4, 10), 0x68000800, ds,
+    s->dss = omap_dss_init(omap_l4ta(s->l4, 10), 0x68000800,
                     /* XXX wire M_IRQ_25, D_L2_IRQ_30 and I_IRQ_13 together */
                     s->irq[0][OMAP_INT_24XX_DSS_IRQ], s->drq[OMAP24XX_DMA_DSS],
                     omap_findclk(s, "dss_clk1"), omap_findclk(s, "dss_clk2"),
index ba7153f29bef6cdd93f475fb2a448968db0a8591..c9032fd9a9ac989aaf7d76dcebd519608ec85c2c 100644 (file)
@@ -1046,7 +1046,7 @@ static CPUWriteMemoryFunc *omap_im3_writefn[] = {
 };
 
 struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
-                target_phys_addr_t l3_base, DisplayState *ds,
+                target_phys_addr_t l3_base,
                 qemu_irq irq, qemu_irq drq,
                 omap_clk fck1, omap_clk fck2, omap_clk ck54m,
                 omap_clk ick1, omap_clk ick2)
@@ -1057,7 +1057,6 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
 
     s->irq = irq;
     s->drq = drq;
-    s->state = ds;
     omap_dss_reset(s);
 
     iomemtype[0] = l4_register_io_memory(0, omap_diss1_readfn,
@@ -1078,9 +1077,8 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
     cpu_register_physical_memory(s->im3_base, 0x1000, iomemtype[4]);
 
 #if 0
-    if (ds)
-        graphic_console_init(ds, omap_update_display,
-                        omap_invalidate_display, omap_screen_dump, s);
+    s->state = graphic_console_init(omap_update_display,
+                                    omap_invalidate_display, omap_screen_dump, s);
 #endif
 
     return s;
index 66cc8dfe232ef2b3e77a207b243441ec6575d2e7..331b8c9585c8bc839d77e43bce0050a4965e88f3 100644 (file)
@@ -26,7 +26,6 @@ struct omap_lcd_panel_s {
     target_phys_addr_t base;
     qemu_irq irq;
     DisplayState *state;
-    QEMUConsole *console;
     ram_addr_t imif_base;
     ram_addr_t emiff_base;
 
@@ -176,7 +175,7 @@ static void omap_update_display(void *opaque)
     width = omap_lcd->width;
     if (width != ds_get_width(omap_lcd->state) ||
             omap_lcd->height != ds_get_height(omap_lcd->state)) {
-        qemu_console_resize(omap_lcd->console,
+        qemu_console_resize(omap_lcd->state,
                             omap_lcd->width, omap_lcd->height);
         omap_lcd->invalidate = 1;
     }
@@ -476,7 +475,7 @@ void omap_lcdc_reset(struct omap_lcd_panel_s *s)
 }
 
 struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq,
-                struct omap_dma_lcd_channel_s *dma, DisplayState *ds,
+                struct omap_dma_lcd_channel_s *dma,
                 ram_addr_t imif_base, ram_addr_t emiff_base, omap_clk clk)
 {
     int iomemtype;
@@ -486,7 +485,6 @@ struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq,
     s->irq = irq;
     s->dma = dma;
     s->base = base;
-    s->state = ds;
     s->imif_base = imif_base;
     s->emiff_base = emiff_base;
     omap_lcdc_reset(s);
@@ -495,9 +493,9 @@ struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq,
                     omap_lcdc_writefn, s);
     cpu_register_physical_memory(s->base, 0x100, iomemtype);
 
-    s->console = graphic_console_init(ds, omap_update_display,
-                                      omap_invalidate_display,
-                                      omap_screen_dump, NULL, s);
+    s->state = graphic_console_init(omap_update_display,
+                                    omap_invalidate_display,
+                                    omap_screen_dump, NULL, s);
 
     return s;
 }
index 4f3b5bf00c24a2e8d9b6db53bb535ad48ebe4ed5..95176213c4f8129e0069ea2f70851eb4eb4f0a92 100644 (file)
--- a/hw/palm.c
+++ b/hw/palm.c
@@ -201,7 +201,7 @@ static struct arm_boot_info palmte_binfo = {
 };
 
 static void palmte_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
@@ -215,6 +215,7 @@ static void palmte_init(ram_addr_t ram_size, int vga_ram_size,
     static uint32_t cs3val = 0xe1a0e1a0;
     ram_addr_t phys_flash;
     int rom_size, rom_loaded = 0;
+    DisplayState *ds = get_displaystate();
 
     if (ram_size < flash_size + sdram_size + OMAP15XX_SRAM_SIZE) {
         fprintf(stderr, "This architecture uses %i bytes of memory\n",
@@ -222,7 +223,7 @@ static void palmte_init(ram_addr_t ram_size, int vga_ram_size,
         exit(1);
     }
 
-    cpu = omap310_mpu_init(sdram_size, ds, cpu_model);
+    cpu = omap310_mpu_init(sdram_size, cpu_model);
 
     /* External Flash (EMIFS) */
     cpu_register_physical_memory(OMAP_CS0_BASE, flash_size,
diff --git a/hw/pc.c b/hw/pc.c
index f0492c8abbeb9f882bcf071cdcac1636c5439aeb..9d1ad67862f47f7ca0cb4844cd46605dad8f471d 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -762,7 +762,7 @@ static void pc_init_ne2k_isa(NICInfo *nd, qemu_irq *pic)
 
 /* PC hardware initialisation */
 static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename,
                      int pci_enabled, const char *cpu_model,
@@ -959,24 +959,24 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
     if (cirrus_vga_enabled) {
         if (pci_enabled) {
             pci_cirrus_vga_init(pci_bus,
-                                ds, phys_ram_base + vga_ram_addr,
+                                phys_ram_base + vga_ram_addr,
                                 vga_ram_addr, vga_ram_size);
         } else {
-            isa_cirrus_vga_init(ds, phys_ram_base + vga_ram_addr,
+            isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
                                 vga_ram_addr, vga_ram_size);
         }
     } else if (vmsvga_enabled) {
         if (pci_enabled)
-            pci_vmsvga_init(pci_bus, ds, phys_ram_base + vga_ram_addr,
+            pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
                             vga_ram_addr, vga_ram_size);
         else
             fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
     } else {
         if (pci_enabled) {
-            pci_vga_init(pci_bus, ds, phys_ram_base + vga_ram_addr,
+            pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
                          vga_ram_addr, vga_ram_size, 0, 0);
         } else {
-            isa_vga_init(ds, phys_ram_base + vga_ram_addr,
+            isa_vga_init(phys_ram_base + vga_ram_addr,
                          vga_ram_addr, vga_ram_size);
         }
     }
@@ -1147,28 +1147,28 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
 }
 
 static void pc_init_pci(ram_addr_t ram_size, int vga_ram_size,
-                        const char *boot_device, DisplayState *ds,
+                        const char *boot_device,
                         const char *kernel_filename,
                         const char *kernel_cmdline,
                         const char *initrd_filename,
                         const char *cpu_model,
                         const char *direct_pci)
 {
-    pc_init1(ram_size, vga_ram_size, boot_device, ds,
+    pc_init1(ram_size, vga_ram_size, boot_device,
              kernel_filename, kernel_cmdline,
              initrd_filename, 1, cpu_model,
              direct_pci);
 }
 
 static void pc_init_isa(ram_addr_t ram_size, int vga_ram_size,
-                        const char *boot_device, DisplayState *ds,
+                        const char *boot_device,
                         const char *kernel_filename,
                         const char *kernel_cmdline,
                         const char *initrd_filename,
                         const char *cpu_model,
                         const char *direct_pci)
 {
-    pc_init1(ram_size, vga_ram_size, boot_device, ds,
+    pc_init1(ram_size, vga_ram_size, boot_device,
              kernel_filename, kernel_cmdline,
              initrd_filename, 0, cpu_model,
              direct_pci);
diff --git a/hw/pc.h b/hw/pc.h
index a6000003924e7bfce083d846b78683d1c7473803..04c9480a41a57acca66f7cae53d3ea52ea48c356 100644 (file)
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -119,20 +119,20 @@ enum vga_retrace_method {
 
 extern enum vga_retrace_method vga_retrace_method;
 
-int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
+int isa_vga_init(uint8_t *vga_ram_base,
                  unsigned long vga_ram_offset, int vga_ram_size);
-int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
+int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
                  unsigned long vga_ram_offset, int vga_ram_size,
                  unsigned long vga_bios_offset, int vga_bios_size);
-int isa_vga_mm_init(DisplayState *ds, uint8_t *vga_ram_base,
+int isa_vga_mm_init(uint8_t *vga_ram_base,
                     unsigned long vga_ram_offset, int vga_ram_size,
                     target_phys_addr_t vram_base, target_phys_addr_t ctrl_base,
                     int it_shift);
 
 /* cirrus_vga.c */
-void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
+void pci_cirrus_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
                          unsigned long vga_ram_offset, int vga_ram_size);
-void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
+void isa_cirrus_vga_init(uint8_t *vga_ram_base,
                          unsigned long vga_ram_offset, int vga_ram_size);
 
 /* ide.c */
index 2800499591ef75d593f96d6bb0ca8fec745afdb2..f2002fe7df874213c605eeaee470c0fecc9f9225 100644 (file)
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -128,7 +128,7 @@ void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id);
 void *lsi_scsi_init(PCIBus *bus, int devfn);
 
 /* vmware_vga.c */
-void pci_vmsvga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
+void pci_vmsvga_init(PCIBus *bus, uint8_t *vga_ram_base,
                      unsigned long vga_ram_offset, int vga_ram_size);
 
 /* usb-uhci.c */
index 06541aece8f285a7191bdda5435b081291c764d0..c150b50b485d14ceff2284af1e7c044d556dd742 100644 (file)
@@ -30,7 +30,6 @@ enum pl110_bppmode
 typedef struct {
     uint32_t base;
     DisplayState *ds;
-    QEMUConsole *console;
 
     /* The Versatile/PB uses a slightly modified PL110 controller.  */
     int versatile;
@@ -272,7 +271,7 @@ static void pl110_resize(pl110_state *s, int width, int height)
 {
     if (width != s->cols || height != s->rows) {
         if (pl110_enabled(s)) {
-            qemu_console_resize(s->console, width, height);
+            qemu_console_resize(s->ds, width, height);
         }
     }
     s->cols = width;
@@ -389,7 +388,7 @@ static void pl110_write(void *opaque, target_phys_addr_t offset,
         s->cr = val;
         s->bpp = (val >> 1) & 7;
         if (pl110_enabled(s)) {
-            qemu_console_resize(s->console, s->cols, s->rows);
+            qemu_console_resize(s->ds, s->cols, s->rows);
         }
         break;
     case 10: /* LCDICR */
@@ -413,8 +412,7 @@ static CPUWriteMemoryFunc *pl110_writefn[] = {
    pl110_write
 };
 
-void *pl110_init(DisplayState *ds, uint32_t base, qemu_irq irq,
-                 int versatile)
+void *pl110_init(uint32_t base, qemu_irq irq, int versatile)
 {
     pl110_state *s;
     int iomemtype;
@@ -424,12 +422,11 @@ void *pl110_init(DisplayState *ds, uint32_t base, qemu_irq irq,
                                        pl110_writefn, s);
     cpu_register_physical_memory(base, 0x00001000, iomemtype);
     s->base = base;
-    s->ds = ds;
     s->versatile = versatile;
     s->irq = irq;
-    s->console = graphic_console_init(ds, pl110_update_display,
-                                      pl110_invalidate_display,
-                                      NULL, NULL, s);
+    s->ds = graphic_console_init(pl110_update_display,
+                                 pl110_invalidate_display,
+                                 NULL, NULL, s);
     /* ??? Save/restore.  */
     return s;
 }
index a83f28e9b9b420bc3ce3cfbf4fe88fc0f0c16deb..8cba82c7685744ae252d5278745844411de6d613 100644 (file)
@@ -176,7 +176,7 @@ static void ref405ep_fpga_init (uint32_t base)
 }
 
 static void ref405ep_init (ram_addr_t ram_size, int vga_ram_size,
-                           const char *boot_device, DisplayState *ds,
+                           const char *boot_device,
                            const char *kernel_filename,
                            const char *kernel_cmdline,
                            const char *initrd_filename,
@@ -505,7 +505,7 @@ static void taihu_cpld_init (uint32_t base)
 }
 
 static void taihu_405ep_init(ram_addr_t ram_size, int vga_ram_size,
-                             const char *boot_device, DisplayState *ds,
+                             const char *boot_device,
                              const char *kernel_filename,
                              const char *kernel_cmdline,
                              const char *initrd_filename,
index da2a0faff162190982a04cd010de63f8eda1e2c5..f867de35703204437a5580ceeeb6240ac50c9a7e 100644 (file)
@@ -58,7 +58,7 @@ static CPUReadMemoryFunc *unin_read[] = {
 
 /* PowerPC Mac99 hardware initialisation */
 static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size,
-                             const char *boot_device, DisplayState *ds,
+                             const char *boot_device,
                              const char *kernel_filename,
                              const char *kernel_cmdline,
                              const char *initrd_filename,
@@ -255,7 +255,7 @@ static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size,
     pic = openpic_init(NULL, &pic_mem_index, smp_cpus, openpic_irqs, NULL);
     pci_bus = pci_pmac_init(pic);
     /* init basic PC hardware */
-    pci_vga_init(pci_bus, ds, phys_ram_base + ram_size,
+    pci_vga_init(pci_bus, phys_ram_base + ram_size,
                  ram_size, vga_ram_size,
                  vga_bios_offset, vga_bios_size);
 
index 510dd6ea5c4144d27d602853d329f4188670f5be..0963b0cc5471d0c3a17e800b51517324c6f54515 100644 (file)
@@ -104,7 +104,7 @@ static int vga_osi_call (CPUState *env)
 }
 
 static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size,
-                               const char *boot_device, DisplayState *ds,
+                               const char *boot_device,
                                const char *kernel_filename,
                                const char *kernel_cmdline,
                                const char *initrd_filename,
@@ -278,7 +278,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size,
     }
     pic = heathrow_pic_init(&pic_mem_index, 1, heathrow_irqs);
     pci_bus = pci_grackle_init(0xfec00000, pic);
-    pci_vga_init(pci_bus, ds, phys_ram_base + ram_size,
+    pci_vga_init(pci_bus, phys_ram_base + ram_size,
                  ram_size, vga_ram_size,
                  vga_bios_offset, vga_bios_size);
 
index 1e5b3b06255500aeb4ceaa9233085b04127dc45a..adb091ab171ae9315d34d8e2b2920b291200dc51 100644 (file)
@@ -534,7 +534,7 @@ CPUReadMemoryFunc *PPC_prep_io_read[] = {
 
 /* PowerPC PREP hardware initialisation */
 static void ppc_prep_init (ram_addr_t ram_size, int vga_ram_size,
-                           const char *boot_device, DisplayState *ds,
+                           const char *boot_device,
                            const char *kernel_filename,
                            const char *kernel_cmdline,
                            const char *initrd_filename,
@@ -658,7 +658,7 @@ static void ppc_prep_init (ram_addr_t ram_size, int vga_ram_size,
     cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
 
     /* init basic PC hardware */
-    pci_vga_init(pci_bus, ds, phys_ram_base + ram_size, ram_size,
+    pci_vga_init(pci_bus, phys_ram_base + ram_size, ram_size,
                  vga_ram_size, 0, 0);
     //    openpic = openpic_init(0x00000000, 0xF0000000, 1);
     //    pit = pit_init(0x40, i8259[0]);
index aa35adc027696929be32c781edc2ffa7fe09d0ba..09e73ed69fee1399573a63e1d455ed9a96dbd8e3 100644 (file)
@@ -9,7 +9,7 @@
 void pl031_init(uint32_t base, qemu_irq irq);
 
 /* pl110.c */
-void *pl110_init(DisplayState *ds, uint32_t base, qemu_irq irq, int);
+void *pl110_init(uint32_t base, qemu_irq irq, int);
 
 /* pl011.c */
 enum pl011_type {
index 16a68d936cf257fa05122fa9b527555414661dee..5ad6fa74790729eac3f64ce9b5e4effd12091a6a 100644 (file)
--- a/hw/pxa.h
+++ b/hw/pxa.h
@@ -89,7 +89,7 @@ void pxa2xx_dma_request(struct pxa2xx_dma_state_s *s, int req_num, int on);
 /* pxa2xx_lcd.c */
 struct pxa2xx_lcdc_s;
 struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base,
-                qemu_irq irq, DisplayState *ds);
+                qemu_irq irq);
 void pxa2xx_lcd_vsync_notifier(struct pxa2xx_lcdc_s *s, qemu_irq handler);
 void pxa2xx_lcdc_oritentation(void *opaque, int angle);
 
@@ -216,9 +216,8 @@ struct pxa2xx_i2s_s {
 # define PA_FMT                        "0x%08lx"
 # define REG_FMT               "0x" TARGET_FMT_plx
 
-struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size, DisplayState *ds,
-                const char *revision);
-struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size, DisplayState *ds);
+struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size, const char *revision);
+struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size);
 
 /* usb-ohci.c */
 void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
index 2c838e5e9d5924c119a96d9aef0117aab2cbb36d..264cdd2aa274a17359235eeda7976f2a3ee4623f 100644 (file)
@@ -2027,8 +2027,7 @@ static void pxa2xx_reset(void *opaque, int line, int level)
 }
 
 /* Initialise a PXA270 integrated chip (ARM based core).  */
-struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size,
-                DisplayState *ds, const char *revision)
+struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size, const char *revision)
 {
     struct pxa2xx_state_s *s;
     struct pxa2xx_ssp_s *ssp;
@@ -2084,8 +2083,7 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size,
         s->fir = pxa2xx_fir_init(0x40800000, s->pic[PXA2XX_PIC_ICP],
                         s->dma, serial_hds[i]);
 
-    if (ds)
-        s->lcd = pxa2xx_lcdc_init(0x44000000, s->pic[PXA2XX_PIC_LCD], ds);
+    s->lcd = pxa2xx_lcdc_init(0x44000000, s->pic[PXA2XX_PIC_LCD]);
 
     s->cm_base = 0x41300000;
     s->cm_regs[CCCR >> 2] = 0x02000210;        /* 416.0 MHz */
@@ -2157,8 +2155,7 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size,
 }
 
 /* Initialise a PXA255 integrated chip (ARM based core).  */
-struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size,
-                DisplayState *ds)
+struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size)
 {
     struct pxa2xx_state_s *s;
     struct pxa2xx_ssp_s *ssp;
@@ -2207,8 +2204,7 @@ struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size,
         s->fir = pxa2xx_fir_init(0x40800000, s->pic[PXA2XX_PIC_ICP],
                         s->dma, serial_hds[i]);
 
-    if (ds)
-        s->lcd = pxa2xx_lcdc_init(0x44000000, s->pic[PXA2XX_PIC_LCD], ds);
+    s->lcd = pxa2xx_lcdc_init(0x44000000, s->pic[PXA2XX_PIC_LCD]);
 
     s->cm_base = 0x41300000;
     s->cm_regs[CCCR >> 2] = 0x02000210;        /* 416.0 MHz */
index 715b2f1a48522b3b60ef2f56d020fb1a21af5bfd..2d893cdd480c270b09a48673194f86bc7b8087a4 100644 (file)
@@ -23,7 +23,6 @@ struct pxa2xx_lcdc_s {
 
     int invalidated;
     DisplayState *ds;
-    QEMUConsole *console;
     drawfn *line_fn[2];
     int dest_width;
     int xres, yres;
@@ -795,9 +794,9 @@ static void pxa2xx_lcdc_resize(struct pxa2xx_lcdc_s *s)
 
     if (width != s->xres || height != s->yres) {
         if (s->orientation)
-            qemu_console_resize(s->console, height, width);
+            qemu_console_resize(s->ds, height, width);
         else
-            qemu_console_resize(s->console, width, height);
+            qemu_console_resize(s->ds, width, height);
         s->invalidated = 1;
         s->xres = width;
         s->yres = height;
@@ -984,8 +983,7 @@ static int pxa2xx_lcdc_load(QEMUFile *f, void *opaque, int version_id)
 #define BITS 32
 #include "pxa2xx_template.h"
 
-struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq,
-                DisplayState *ds)
+struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq)
 {
     int iomemtype;
     struct pxa2xx_lcdc_s *s;
@@ -994,7 +992,6 @@ struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq,
     s->base = base;
     s->invalidated = 1;
     s->irq = irq;
-    s->ds = ds;
 
     pxa2xx_lcdc_orientation(s, graphic_rotate);
 
@@ -1002,9 +999,9 @@ struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq,
                     pxa2xx_lcdc_writefn, s);
     cpu_register_physical_memory(base, 0x00100000, iomemtype);
 
-    s->console = graphic_console_init(ds, pxa2xx_update_display,
-                                      pxa2xx_invalidate_display,
-                                      pxa2xx_screen_dump, NULL, s);
+    s->ds = graphic_console_init(pxa2xx_update_display,
+                                 pxa2xx_invalidate_display,
+                                 pxa2xx_screen_dump, NULL, s);
 
     switch (ds_get_bits_per_pixel(s->ds)) {
     case 0:
index 58c93e89932f4b988808356b95fb0a696159e94e..3b4d64d6bbc987b9060b6f2023f75054a5d7272c 100644 (file)
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -127,7 +127,7 @@ static void r2d_fpga_init(target_phys_addr_t base)
 }
 
 static void r2d_init(ram_addr_t ram_size, int vga_ram_size,
-              const char *boot_device, DisplayState * ds,
+              const char *boot_device,
              const char *kernel_filename, const char *kernel_cmdline,
              const char *initrd_filename, const char *cpu_model)
 {
index 14c001ecdd9bac25ae5367ba77216039df32d081..d2de9f2087e51f3b9066890a7dc4ae26d66a2e56 100644 (file)
@@ -24,7 +24,7 @@ static struct arm_boot_info realview_binfo = {
 };
 
 static void realview_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
@@ -93,7 +93,7 @@ static void realview_init(ram_addr_t ram_size, int vga_ram_size,
     sp804_init(0x10011000, pic[4]);
     sp804_init(0x10012000, pic[5]);
 
-    pl110_init(ds, 0x10020000, pic[23], 1);
+    pl110_init(0x10020000, pic[23], 1);
 
     index = drive_get_index(IF_SD, 0, 0);
     if (index == -1) {
index 3cc41fb830f3993ae6e599dcbe593f8bff9301dd..5eeb0a5840a6eb07497d01db77aed4749c2e1043 100644 (file)
--- a/hw/shix.c
+++ b/hw/shix.c
@@ -66,7 +66,7 @@ void vga_screen_dump(const char *filename)
 }
 
 static void shix_init(ram_addr_t ram_size, int vga_ram_size,
-               const char *boot_device, DisplayState * ds,
+               const char *boot_device,
               const char *kernel_filename, const char *kernel_cmdline,
               const char *initrd_filename, const char *cpu_model)
 {
index 36b490dce8518aa1e17cf6ae1587148a4e58acc8..c9efa409a3806d430894bac99732785ba58fd53a 100644 (file)
@@ -913,7 +913,7 @@ static struct arm_boot_info spitz_binfo = {
 };
 
 static void spitz_common_init(ram_addr_t ram_size, int vga_ram_size,
-                DisplayState *ds, const char *kernel_filename,
+                const char *kernel_filename,
                 const char *kernel_cmdline, const char *initrd_filename,
                 const char *cpu_model, enum spitz_model_e model, int arm_id)
 {
@@ -929,7 +929,7 @@ static void spitz_common_init(ram_addr_t ram_size, int vga_ram_size,
                         SPITZ_RAM + SPITZ_ROM + PXA2XX_INTERNAL_SIZE);
         exit(1);
     }
-    cpu = pxa270_init(spitz_binfo.ram_size, ds, cpu_model);
+    cpu = pxa270_init(spitz_binfo.ram_size, cpu_model);
 
     sl_flash_register(cpu, (model == spitz) ? FLASH_128M : FLASH_1024M);
 
@@ -974,38 +974,38 @@ static void spitz_common_init(ram_addr_t ram_size, int vga_ram_size,
 }
 
 static void spitz_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
-    spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename,
+    spitz_common_init(ram_size, vga_ram_size, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, spitz, 0x2c9);
 }
 
 static void borzoi_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
-    spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename,
+    spitz_common_init(ram_size, vga_ram_size, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, borzoi, 0x33f);
 }
 
 static void akita_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
-    spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename,
+    spitz_common_init(ram_size, vga_ram_size, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, akita, 0x2e8);
 }
 
 static void terrier_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
-    spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename,
+    spitz_common_init(ram_size, vga_ram_size, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, terrier, 0x33f);
 }
 
index d10371952be4b745f13e44e19ab3e985114926d4..56cf72d932654365a4da49e229508776fb45396e 100644 (file)
@@ -45,7 +45,6 @@ enum ssd0303_cmd {
 typedef struct {
     i2c_slave i2c;
     DisplayState *ds;
-    QEMUConsole *console;
     int row;
     int col;
     int start_line;
@@ -306,18 +305,17 @@ static int ssd0303_load(QEMUFile *f, void *opaque, int version_id)
     return 0;
 }
 
-void ssd0303_init(DisplayState *ds, i2c_bus *bus, int address)
+void ssd0303_init(i2c_bus *bus, int address)
 {
     ssd0303_state *s;
 
     s = (ssd0303_state *)i2c_slave_init(bus, address, sizeof(ssd0303_state));
-    s->ds = ds;
     s->i2c.event = ssd0303_event;
     s->i2c.recv = ssd0303_recv;
     s->i2c.send = ssd0303_send;
-    s->console = graphic_console_init(ds, ssd0303_update_display,
-                                      ssd0303_invalidate_display,
-                                      NULL, NULL, s);
-    qemu_console_resize(s->console, 96 * MAGNIFY, 16 * MAGNIFY);
+    s->ds = graphic_console_init(ssd0303_update_display,
+                                 ssd0303_invalidate_display,
+                                 NULL, NULL, s);
+    qemu_console_resize(s->ds, 96 * MAGNIFY, 16 * MAGNIFY);
     register_savevm("ssd0303_oled", -1, 1, ssd0303_save, ssd0303_load, s);
 }
index 29cd52c96a4d4184b04574e22072be4518995a12..b640dd093b4f8cf13aab2de516c1c84f487ff456 100644 (file)
@@ -44,7 +44,6 @@ enum ssd0323_mode
 
 typedef struct {
     DisplayState *ds;
-    QEMUConsole *console;
 
     int cmd_len;
     int cmd;
@@ -322,7 +321,7 @@ static int ssd0323_load(QEMUFile *f, void *opaque, int version_id)
     return 0;
 }
 
-void *ssd0323_init(DisplayState *ds, qemu_irq *cmd_p)
+void *ssd0323_init(qemu_irq *cmd_p)
 {
     ssd0323_state *s;
     qemu_irq *cmd;
@@ -330,11 +329,10 @@ void *ssd0323_init(DisplayState *ds, qemu_irq *cmd_p)
     s = (ssd0323_state *)qemu_mallocz(sizeof(ssd0323_state));
     s->col_end = 63;
     s->row_end = 79;
-    s->ds = ds;
-    s->console = graphic_console_init(ds, ssd0323_update_display,
-                                      ssd0323_invalidate_display,
-                                      NULL, NULL, s);
-    qemu_console_resize(s->console, 128 * MAGNIFY, 64 * MAGNIFY);
+    s->ds = graphic_console_init(ssd0323_update_display,
+                                 ssd0323_invalidate_display,
+                                 NULL, NULL, s);
+    qemu_console_resize(s->ds, 128 * MAGNIFY, 64 * MAGNIFY);
 
     cmd = qemu_allocate_irqs(ssd0323_cd, s, 1);
     *cmd_p = *cmd;
index 4645bd6fb4ff098a6eed5cf5a8d410fa33d2cf81..71f6375655e2cb42904b71323be96d6fe1578df2 100644 (file)
@@ -1298,7 +1298,7 @@ static stellaris_board_info stellaris_boards[] = {
 };
 
 static void stellaris_init(const char *kernel_filename, const char *cpu_model,
-                           DisplayState *ds, stellaris_board_info *board)
+                           stellaris_board_info *board)
 {
     static const int uart_irq[] = {5, 6, 33, 34};
     static const int timer_irq[] = {19, 21, 23, 35};
@@ -1345,7 +1345,7 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
         i2c = i2c_init_bus();
         stellaris_i2c_init(0x40020000, pic[8], i2c);
         if (board->peripherals & BP_OLED_I2C) {
-            ssd0303_init(ds, i2c, 0x3d);
+            ssd0303_init(i2c, 0x3d);
         }
     }
 
@@ -1362,7 +1362,7 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
             void *ssi_bus;
             int index;
 
-            oled = ssd0323_init(ds, &gpio_out[GPIO_C][7]);
+            oled = ssd0323_init(&gpio_out[GPIO_C][7]);
             index = drive_get_index(IF_SD, 0, 0);
             sd = ssi_sd_init(drives_table[index].bdrv);
 
@@ -1397,19 +1397,19 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
 
 /* FIXME: Figure out how to generate these from stellaris_boards.  */
 static void lm3s811evb_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
-    stellaris_init(kernel_filename, cpu_model, ds, &stellaris_boards[0]);
+    stellaris_init(kernel_filename, cpu_model, &stellaris_boards[0]);
 }
 
 static void lm3s6965evb_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
-    stellaris_init(kernel_filename, cpu_model, ds, &stellaris_boards[1]);
+    stellaris_init(kernel_filename, cpu_model, &stellaris_boards[1]);
 }
 
 QEMUMachine lm3s811evb_machine = {
index dd0433afca3876719f007a3af48797173955f8c1..5fd2028e6128acd455a19c8f196506d49319d54e 100644 (file)
@@ -397,7 +397,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename,
 
 static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
                           const char *boot_device,
-                          DisplayState *ds, const char *kernel_filename,
+                          const char *kernel_filename,
                           const char *kernel_cmdline,
                           const char *initrd_filename, const char *cpu_model)
 
@@ -503,7 +503,7 @@ static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
         fprintf(stderr, "qemu: Unsupported depth: %d\n", graphic_depth);
         exit (1);
     }
-    tcx_init(ds, hwdef->tcx_base, phys_ram_base + RAM_size, RAM_size,
+    tcx_init(hwdef->tcx_base, phys_ram_base + RAM_size, RAM_size,
              hwdef->vram_size, graphic_width, graphic_height, graphic_depth);
 
     if (nd_table[0].model == NULL
@@ -586,7 +586,7 @@ static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
 
 static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
                           const char *boot_device,
-                          DisplayState *ds, const char *kernel_filename,
+                          const char *kernel_filename,
                           const char *kernel_cmdline,
                           const char *initrd_filename, const char *cpu_model)
 {
@@ -667,7 +667,7 @@ static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
         fprintf(stderr, "qemu: Unsupported depth: %d\n", graphic_depth);
         exit (1);
     }
-    tcx_init(ds, hwdef->tcx_base, phys_ram_base + RAM_size, RAM_size,
+    tcx_init(hwdef->tcx_base, phys_ram_base + RAM_size, RAM_size,
              hwdef->vram_size, graphic_width, graphic_height, graphic_depth);
 
     if (nd_table[0].model == NULL
@@ -1189,7 +1189,7 @@ static void ss5_init(ram_addr_t RAM_size, int vga_ram_size,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[0], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[0], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1199,7 +1199,7 @@ static void ss10_init(ram_addr_t RAM_size, int vga_ram_size,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[1], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[1], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1210,7 +1210,7 @@ static void ss600mp_init(ram_addr_t RAM_size, int vga_ram_size,
                          const char *kernel_cmdline,
                          const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[2], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[2], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1220,7 +1220,7 @@ static void ss20_init(ram_addr_t RAM_size, int vga_ram_size,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[3], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[3], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1230,7 +1230,7 @@ static void ss2_init(ram_addr_t RAM_size, int vga_ram_size,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
-    sun4c_hw_init(&hwdefs[4], RAM_size, boot_device, ds, kernel_filename,
+    sun4c_hw_init(&hwdefs[4], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1240,7 +1240,7 @@ static void vger_init(ram_addr_t RAM_size, int vga_ram_size,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[5], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[5], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1250,7 +1250,7 @@ static void ss_lx_init(ram_addr_t RAM_size, int vga_ram_size,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[6], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[6], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1260,7 +1260,7 @@ static void ss4_init(ram_addr_t RAM_size, int vga_ram_size,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[7], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[7], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1270,7 +1270,7 @@ static void scls_init(ram_addr_t RAM_size, int vga_ram_size,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[8], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[8], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1280,7 +1280,7 @@ static void sbook_init(ram_addr_t RAM_size, int vga_ram_size,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
 {
-    sun4m_hw_init(&hwdefs[9], RAM_size, boot_device, ds, kernel_filename,
+    sun4m_hw_init(&hwdefs[9], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
@@ -1457,7 +1457,7 @@ static const struct sun4d_hwdef sun4d_hwdefs[] = {
 
 static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
                           const char *boot_device,
-                          DisplayState *ds, const char *kernel_filename,
+                          const char *kernel_filename,
                           const char *kernel_cmdline,
                           const char *initrd_filename, const char *cpu_model)
 {
@@ -1546,7 +1546,7 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
         fprintf(stderr, "qemu: Unsupported depth: %d\n", graphic_depth);
         exit (1);
     }
-    tcx_init(ds, hwdef->tcx_base, phys_ram_base + RAM_size, RAM_size,
+    tcx_init(hwdef->tcx_base, phys_ram_base + RAM_size, RAM_size,
              hwdef->vram_size, graphic_width, graphic_height, graphic_depth);
 
     if (nd_table[0].model == NULL
@@ -1605,21 +1605,21 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
 
 /* SPARCserver 1000 hardware initialisation */
 static void ss1000_init(ram_addr_t RAM_size, int vga_ram_size,
-                        const char *boot_device, DisplayState *ds,
+                        const char *boot_device,
                         const char *kernel_filename, const char *kernel_cmdline,
                         const char *initrd_filename, const char *cpu_model)
 {
-    sun4d_hw_init(&sun4d_hwdefs[0], RAM_size, boot_device, ds, kernel_filename,
+    sun4d_hw_init(&sun4d_hwdefs[0], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
 /* SPARCcenter 2000 hardware initialisation */
 static void ss2000_init(ram_addr_t RAM_size, int vga_ram_size,
-                        const char *boot_device, DisplayState *ds,
+                        const char *boot_device,
                         const char *kernel_filename, const char *kernel_cmdline,
                         const char *initrd_filename, const char *cpu_model)
 {
-    sun4d_hw_init(&sun4d_hwdefs[1], RAM_size, boot_device, ds, kernel_filename,
+    sun4d_hw_init(&sun4d_hwdefs[1], RAM_size, boot_device, kernel_filename,
                   kernel_cmdline, initrd_filename, cpu_model);
 }
 
index a208420f9f4ea150fce94c65c8a8b168315b66d0..270feac6d10494e4eccd051b3a0b79bb18b38efb 100644 (file)
@@ -22,7 +22,7 @@ static inline void sparc_iommu_memory_write(void *opaque,
 }
 
 /* tcx.c */
-void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
+void tcx_init(target_phys_addr_t addr, uint8_t *vram_base,
               unsigned long vram_offset, int vram_size, int width, int height,
               int depth);
 
index 216629f6f93eb759b8adb59b13d2ac34d3b05d67..3ea3ee498f574f1295ce303fd97300ecbc28fb1c 100644 (file)
@@ -335,7 +335,7 @@ static const int parallel_irq[MAX_PARALLEL_PORTS] = { 7, 7, 7 };
 static fdctrl_t *floppy_controller;
 
 static void sun4uv_init(ram_addr_t RAM_size, int vga_ram_size,
-                        const char *boot_devices, DisplayState *ds,
+                        const char *boot_devices,
                         const char *kernel_filename, const char *kernel_cmdline,
                         const char *initrd_filename, const char *cpu_model,
                         const struct hwdef *hwdef)
@@ -555,31 +555,31 @@ static const struct hwdef hwdefs[] = {
 
 /* Sun4u hardware initialisation */
 static void sun4u_init(ram_addr_t RAM_size, int vga_ram_size,
-                       const char *boot_devices, DisplayState *ds,
+                       const char *boot_devices,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
 {
-    sun4uv_init(RAM_size, vga_ram_size, boot_devices, ds, kernel_filename,
+    sun4uv_init(RAM_size, vga_ram_size, boot_devices, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, &hwdefs[0]);
 }
 
 /* Sun4v hardware initialisation */
 static void sun4v_init(ram_addr_t RAM_size, int vga_ram_size,
-                       const char *boot_devices, DisplayState *ds,
+                       const char *boot_devices,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
 {
-    sun4uv_init(RAM_size, vga_ram_size, boot_devices, ds, kernel_filename,
+    sun4uv_init(RAM_size, vga_ram_size, boot_devices, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, &hwdefs[1]);
 }
 
 /* Niagara hardware initialisation */
 static void niagara_init(ram_addr_t RAM_size, int vga_ram_size,
-                         const char *boot_devices, DisplayState *ds,
+                         const char *boot_devices,
                          const char *kernel_filename, const char *kernel_cmdline,
                          const char *initrd_filename, const char *cpu_model)
 {
-    sun4uv_init(RAM_size, vga_ram_size, boot_devices, ds, kernel_filename,
+    sun4uv_init(RAM_size, vga_ram_size, boot_devices, kernel_filename,
                 kernel_cmdline, initrd_filename, cpu_model, &hwdefs[2]);
 }
 
index dd3ac376cd62b09ce0bf75f6cc4d67489d82c57b..13925cacd53bfbd3cf22f5e94d5e481d3e6e4102 100644 (file)
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -36,7 +36,6 @@
 typedef struct TCXState {
     target_phys_addr_t addr;
     DisplayState *ds;
-    QEMUConsole *console;
     uint8_t *vram;
     uint32_t *vram24, *cplane;
     ram_addr_t vram_offset, vram24_offset, cplane_offset;
@@ -493,7 +492,7 @@ static CPUWriteMemoryFunc *tcx_dummy_write[3] = {
     tcx_dummy_writel,
 };
 
-void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
+void tcx_init(target_phys_addr_t addr, uint8_t *vram_base,
               unsigned long vram_offset, int vram_size, int width, int height,
               int depth)
 {
@@ -504,7 +503,6 @@ void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
     s = qemu_mallocz(sizeof(TCXState));
     if (!s)
         return;
-    s->ds = ds;
     s->addr = addr;
     s->vram_offset = vram_offset;
     s->width = width;
@@ -540,15 +538,15 @@ void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
         s->cplane = (uint32_t *)vram_base;
         s->cplane_offset = vram_offset;
         cpu_register_physical_memory(addr + 0x0a000000ULL, size, vram_offset);
-        s->console = graphic_console_init(s->ds, tcx24_update_display,
-                                          tcx24_invalidate_display,
-                                          tcx24_screen_dump, NULL, s);
+        s->ds = graphic_console_init(tcx24_update_display,
+                                     tcx24_invalidate_display,
+                                     tcx24_screen_dump, NULL, s);
     } else {
         cpu_register_physical_memory(addr + 0x00300000ULL, TCX_THC_NREGS_8,
                                      dummy_memory);
-        s->console = graphic_console_init(s->ds, tcx_update_display,
-                                          tcx_invalidate_display,
-                                          tcx_screen_dump, NULL, s);
+        s->ds = graphic_console_init(tcx_update_display,
+                                     tcx_invalidate_display,
+                                     tcx_screen_dump, NULL, s);
     }
     // NetBSD writes here even with 8-bit display
     cpu_register_physical_memory(addr + 0x00301000ULL, TCX_THC_NREGS_24,
@@ -557,7 +555,7 @@ void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
     register_savevm("tcx", addr, 4, tcx_save, tcx_load, s);
     qemu_register_reset(tcx_reset, s);
     tcx_reset(s);
-    qemu_console_resize(s->console, width, height);
+    qemu_console_resize(s->ds, width, height);
 }
 
 static void tcx_screen_dump(void *opaque, const char *filename)
index e7b2be31e45e6971db539fd7edf9195783cc95f6..3e029cca88a7e2366d2150cd14e64dc2639f3feb 100644 (file)
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -77,7 +77,7 @@ static struct arm_boot_info tosa_binfo = {
 };
 
 static void tosa_init(ram_addr_t ram_size, int vga_ram_size,
-                const char *boot_device, DisplayState *ds,
+                const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
@@ -93,7 +93,7 @@ static void tosa_init(ram_addr_t ram_size, int vga_ram_size,
     if (!cpu_model)
         cpu_model = "pxa255";
 
-    cpu = pxa255_init(tosa_binfo.ram_size, ds);
+    cpu = pxa255_init(tosa_binfo.ram_size);
 
     cpu_register_physical_memory(0, TOSA_ROM,
                     qemu_ram_alloc(TOSA_ROM) | IO_MEM_ROM);
index c4c867d0f6d3052376596afff5afbe6bf1cb294d..149c23a17d2ec451febaa81b727f79b6e02c1198 100644 (file)
@@ -160,7 +160,7 @@ static qemu_irq *vpb_sic_init(uint32_t base, qemu_irq *parent, int irq)
 static struct arm_boot_info versatile_binfo;
 
 static void versatile_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model,
                      int board_id)
@@ -232,7 +232,7 @@ static void versatile_init(ram_addr_t ram_size, int vga_ram_size,
 
     /* The versatile/PB actually has a modified Color LCD controller
        that includes hardware cursor support from the PL111.  */
-    pl110_init(ds, 0x10120000, pic[16], 1);
+    pl110_init(0x10120000, pic[16], 1);
 
     index = drive_get_index(IF_SD, 0, 0);
     if (index == -1) {
@@ -294,23 +294,23 @@ static void versatile_init(ram_addr_t ram_size, int vga_ram_size,
 }
 
 static void vpb_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
     versatile_init(ram_size, vga_ram_size,
-                   boot_device, ds,
+                   boot_device,
                    kernel_filename, kernel_cmdline,
                    initrd_filename, cpu_model, 0x183);
 }
 
 static void vab_init(ram_addr_t ram_size, int vga_ram_size,
-                     const char *boot_device, DisplayState *ds,
+                     const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
     versatile_init(ram_size, vga_ram_size,
-                   boot_device, ds,
+                   boot_device,
                    kernel_filename, kernel_cmdline,
                    initrd_filename, cpu_model, 0x25e);
 }
index 6cb63c1b8ac9b514c06939eb6b311852affdf667..033c75eadcd71c0cc625b5644a685a0417205614 100644 (file)
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1274,8 +1274,7 @@ static void vga_draw_text(VGAState *s, int full_update)
         cw != s->last_cw || cheight != s->last_ch || s->last_depth) {
         s->last_scr_width = width * cw;
         s->last_scr_height = height * cheight;
-        qemu_console_resize(s->console, s->last_scr_width, s->last_scr_height);
-        dpy_resize(s->ds);
+        qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height);
         s->last_depth = 0;
         s->last_width = width;
         s->last_height = height;
@@ -1344,7 +1343,7 @@ static void vga_draw_text(VGAState *s, int full_update)
         cw != s->last_cw || cheight != s->last_ch) {
         s->last_scr_width = width * cw;
         s->last_scr_height = height * cheight;
-        qemu_console_resize(s->console, s->last_scr_width, s->last_scr_height);
+        qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height);
         s->last_width = width;
         s->last_height = height;
         s->last_ch = cheight;
@@ -1638,10 +1637,10 @@ static void vga_draw_graphic(VGAState *s, int full_update)
 #endif
                 dpy_resize(s->ds);
             } else {
-                qemu_console_resize(s->console, disp_width, height);
+                qemu_console_resize(s->ds, disp_width, height);
             }
         } else {
-            qemu_console_resize(s->console, disp_width, height);
+            qemu_console_resize(s->ds, disp_width, height);
         }
         s->last_scr_width = disp_width;
         s->last_scr_height = height;
@@ -2503,7 +2502,7 @@ void xen_vga_vram_map(uint64_t vram_addr, uint32_t vga_ram_size)
 }
 
 /* when used on xen environment, the vga_ram_base is not used */
-void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
+void vga_common_init(VGAState *s, uint8_t *vga_ram_base,
                      unsigned long vga_ram_offset, int vga_ram_size)
 {
     int i, j, v, b;
@@ -2536,7 +2535,6 @@ void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
     xen_vga_state = s;
     s->vram_offset = vga_ram_offset;
     s->vram_size = vga_ram_size;
-    s->ds = ds;
     s->get_bpp = vga_get_bpp;
     s->get_offsets = vga_get_offsets;
     s->get_resolution = vga_get_resolution;
@@ -2546,8 +2544,8 @@ void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
         s->vram_gmfn = VRAM_RESERVED_ADDRESS;
     }
 
-    graphic_console_init(s->ds, vga_update_display, vga_invalidate_display,
-                         vga_screen_dump, vga_update_text, s);
+    s->ds = graphic_console_init(vga_update_display, vga_invalidate_display,
+                                 vga_screen_dump, vga_update_text, s);
 
     vga_bios_init(s);
     switch (vga_retrace_method) {
@@ -2616,7 +2614,7 @@ static void vga_init(VGAState *s)
                                  vga_io_memory);
 }
 
-int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
+int isa_vga_init(uint8_t *vga_ram_base,
                  unsigned long vga_ram_offset, int vga_ram_size)
 {
     VGAState *s;
@@ -2630,7 +2628,7 @@ int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
         vga_ram_size = 16*1024*1024;
     }
 
-    vga_common_init(s, ds, vga_ram_base, vga_ram_offset, vga_ram_size);
+    vga_common_init(s, vga_ram_base, vga_ram_offset, vga_ram_size);
     vga_init(s);
 
 #ifdef CONFIG_BOCHS_VBE
@@ -2641,7 +2639,7 @@ int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
     return 0;
 }
 
-int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
+int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
                  unsigned long vga_ram_offset, int vga_ram_size,
                  unsigned long vga_bios_offset, int vga_bios_size)
 {
@@ -2661,7 +2659,7 @@ int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
         vga_ram_size = 16*1024*1024;
     }
 
-    vga_common_init(s, ds, vga_ram_base, vga_ram_offset, vga_ram_size);
+    vga_common_init(s, vga_ram_base, vga_ram_offset, vga_ram_size);
     vga_init(s);
     s->pci_dev = &d->dev;
 
index d914b62ee842eb9aeb22e021694b0d6b75b8e957..80ed901c54e52c920a9eb9db83fe3c219c134db3 100644 (file)
@@ -144,7 +144,6 @@ typedef void (* vga_update_retrace_info_fn)(struct VGAState *s);
     VGA_STATE_COMMON_BOCHS_VBE                                          \
     /* display refresh support */                                       \
     DisplayState *ds;                                                   \
-    QEMUConsole *console;                                               \
     uint32_t font_offsets[2];                                           \
     int graphic_mode;                                                   \
     uint8_t shift_control;                                              \
@@ -187,7 +186,7 @@ static inline int c6_to_8(int v)
     return (v << 2) | (b << 1) | b;
 }
 
-void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
+void vga_common_init(VGAState *s, uint8_t *vga_ram_base,
                      unsigned long vga_ram_offset, int vga_ram_size);
 uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr);
 void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val);
index 8a970ceb7aee948488c006a75b62f0ca8581d813..1ebd4febd5801b78cc7b0a86750572015cfc238e 100644 (file)
@@ -59,7 +59,6 @@ struct vmsvga_state_s {
 
 #ifndef EMBED_STDVGA
     DisplayState *ds;
-    QEMUConsole *console;
     int vram_size;
     ram_addr_t vram_offset;
 #endif
@@ -386,7 +385,7 @@ static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,
 
 # ifdef DIRECT_VRAM
     if (s->ds->dpy_copy)
-        qemu_console_copy(s->console, x0, y0, x1, y1, w, h);
+        qemu_console_copy(s->ds, x0, y0, x1, y1, w, h);
     else
 # endif
     {
@@ -879,7 +878,7 @@ static inline void vmsvga_size(struct vmsvga_state_s *s)
     if (s->new_width != s->width || s->new_height != s->height) {
         s->width = s->new_width;
         s->height = s->new_height;
-        qemu_console_resize(s->console, s->width, s->height);
+        qemu_console_resize(s->ds, s->width, s->height);
         s->invalidated = 1;
     }
 }
@@ -917,7 +916,7 @@ static void vmsvga_reset(struct vmsvga_state_s *s)
     s->width = -1;
     s->height = -1;
     s->svgaid = SVGA_ID;
-    s->depth = ds_get_bits_per_pixel(s->ds) ? ds_get_bits_per_pixel(s->ds) : 24;
+    s->depth = 24;
     s->bypp = (s->depth + 7) >> 3;
     s->cursor.on = 0;
     s->redraw_fifo_first = 0;
@@ -1118,11 +1117,10 @@ static int vmsvga_load(struct vmsvga_state_s *s, QEMUFile *f)
     return 0;
 }
 
-static void vmsvga_init(struct vmsvga_state_s *s, DisplayState *ds,
+static void vmsvga_init(struct vmsvga_state_s *s,
                 uint8_t *vga_ram_base, unsigned long vga_ram_offset,
                 int vga_ram_size)
 {
-    s->ds = ds;
     s->vram = vga_ram_base;
     s->vram_size = vga_ram_size;
     s->vram_offset = vga_ram_offset;
@@ -1133,15 +1131,15 @@ static void vmsvga_init(struct vmsvga_state_s *s, DisplayState *ds,
     vmsvga_reset(s);
 
 #ifdef EMBED_STDVGA
-    vga_common_init((VGAState *) s, ds,
+    vga_common_init((VGAState *) s,
                     vga_ram_base, vga_ram_offset, vga_ram_size);
     vga_init((VGAState *) s);
 #endif
 
-    s->console = graphic_console_init(ds, vmsvga_update_display,
-                                      vmsvga_invalidate_display,
-                                      vmsvga_screen_dump,
-                                      vmsvga_text_update, s);
+    s->ds = graphic_console_init(vmsvga_update_display,
+                                 vmsvga_invalidate_display,
+                                 vmsvga_screen_dump,
+                                 vmsvga_text_update, s);
 
 #ifdef CONFIG_BOCHS_VBE
     /* XXX: use optimized standard vga accesses */
@@ -1221,7 +1219,7 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int region_num,
 #define PCI_CLASS_SUB_VGA              0x00
 #define PCI_CLASS_HEADERTYPE_00h       0x00
 
-void pci_vmsvga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
+void pci_vmsvga_init(PCIBus *bus, uint8_t *vga_ram_base,
                      unsigned long vga_ram_offset, int vga_ram_size)
 {
     struct pci_vmsvga_state_s *s;
@@ -1251,13 +1249,13 @@ void pci_vmsvga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
     pci_register_io_region(&s->card, 1, vga_ram_size,
                     PCI_ADDRESS_SPACE_MEM_PREFETCH, pci_vmsvga_map_mem);
 
-    vmsvga_init(&s->chip, ds, vga_ram_base, vga_ram_offset, vga_ram_size);
+    vmsvga_init(&s->chip, vga_ram_base, vga_ram_offset, vga_ram_size);
 
     register_savevm("vmware_vga", 0, 0, pci_vmsvga_save, pci_vmsvga_load, s);
 }
 
 #else /*CONFIG_DM*/
-void pci_vmsvga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
+void pci_vmsvga_init(PCIBus *bus, uint8_t *vga_ram_base,
                      unsigned long vga_ram_offset, int vga_ram_size) {
 }
 #endif
index 976e7e7399324406dca1da67dde3ed837e1c5947..419c31532f4c30266cf07c4f4af8c185213baf7a 100644 (file)
@@ -187,7 +187,7 @@ void qemu_invalidate_map_cache(void)
 
 
 static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
-                       const char *boot_device, DisplayState *ds,
+                       const char *boot_device,
                        const char *kernel_filename,const char *kernel_cmdline,
                         const char *initrd_filename, const char *cpu_model,
                         const char *direct_pci)
@@ -279,7 +279,7 @@ static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
     timeoffset_get();
 
 
-    pc_machine.init(ram_size, vga_ram_size, boot_device, ds,
+    pc_machine.init(ram_size, vga_ram_size, boot_device,
                    kernel_filename, kernel_cmdline, initrd_filename,
                    cpu_model, direct_pci);
 }
index 68740e81c1e9011bb09d0e4d5aac9c3b9b4cdf30..fe035b73eb02e8663049e02d6c71500aaf4ec971 100644 (file)
@@ -742,9 +742,7 @@ static void xenfb_update(void *opaque)
     if (xenfb->width != ds_get_width(xenfb->c.ds) || xenfb->height != ds_get_height(xenfb->c.ds)) {
         xen_be_printf(&xenfb->c.xendev, 1, "update: resizing: %dx%d\n",
                       xenfb->width, xenfb->height);
-        xenfb->c.ds->surface->width = xenfb->width;
-        xenfb->c.ds->surface->height = xenfb->height;
-        dpy_resize(xenfb->c.ds);
+        qemu_console_resize(xenfb->c.ds, xenfb->width, xenfb->height);
         xenfb->up_fullscreen = 1;
     }
 
@@ -883,12 +881,11 @@ static int fb_connect(struct XenDevice *xendev)
        return rc;
 
     if (!fb->have_console) {
-        graphic_console_init(fb->c.ds,
-                             xenfb_update,
-                             xenfb_invalidate,
-                             NULL,
-                             NULL,
-                             fb);
+        fb->c.ds = graphic_console_init(xenfb_update,
+                                        xenfb_invalidate,
+                                        NULL,
+                                        NULL,
+                                        fb);
         fb->have_console = 1;
     }
 
diff --git a/vl.c b/vl.c
index 37defd818de904e6a599aec94cec46d7c2ea0cb2..e59a15f230519e3e0e6b15d761d319fcb18aa7c2 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -192,7 +192,7 @@ int nb_drives;
 /* point to the block driver where the snapshots are managed */
 static BlockDriverState *bs_snapshots;
 enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
-static DisplayState display_state;
+static DisplayState *display_state;
 int nographic;
 static int curses;
 static int sdl;
@@ -3842,10 +3842,10 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename)
     CharDriverState *chr;
 
     if (!strcmp(filename, "vc")) {
-        chr = text_console_init(&display_state, 0);
+        chr = text_console_init(0);
     } else
     if (strstart(filename, "vc:", &p)) {
-        chr = text_console_init(&display_state, p);
+        chr = text_console_init(p);
     } else
     if (!strcmp(filename, "null")) {
         chr = qemu_chr_open_null();
@@ -6240,34 +6240,34 @@ void pcmcia_info(void)
 }
 
 /***********************************************************/
-/* dumb display */
+/* register display */
 
-static void dumb_update(DisplayState *ds, int x, int y, int w, int h)
+void register_displaystate(DisplayState *ds)
 {
+    DisplayState **s;
+    s = &display_state;
+    while (*s != NULL)
+        s = &(*s)->next;
+    ds->next = NULL;
+    *s = ds;
 }
 
-static void dumb_resize(DisplayState *ds)
+DisplayState *get_displaystate(void)
 {
+    return display_state;
 }
 
-static void dumb_refresh(DisplayState *ds)
-{
-#if defined(CONFIG_SDL)
-    vga_hw_update();
-#endif
-}
+/* dumb display */
 
-static void dumb_display_init(DisplayState *ds)
+static void dumb_display_init(void)
 {
-    DisplayChangeListener *dcl = qemu_mallocz(sizeof(DisplayChangeListener));
-    if (!dcl)
+    DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
+    if (ds == NULL) {
+        fprintf(stderr, "dumb_display_init: DisplayState allocation failed\n");
         exit(1);
-    dcl->dpy_update = dumb_update;
-    dcl->dpy_resize = dumb_resize;
-    dcl->dpy_refresh = NULL;
-    dcl->idle = 1;
-    dcl->gui_timer_interval = 500;
-    register_displaychangelistener(ds, dcl);
+    }
+    ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
+    register_displaystate(ds);
 }
 
 /***********************************************************/
@@ -9058,7 +9058,7 @@ int main(int argc, char **argv)
     const char *initrd_filename;
     const char *kernel_filename, *kernel_cmdline;
     const char *boot_devices = "";
-    DisplayState *ds = &display_state;
+    DisplayState *ds;
     DisplayChangeListener *dcl;
     int cyls, heads, secs, translation;
     const char *net_clients[MAX_NET_CLIENTS];
@@ -9066,7 +9066,7 @@ int main(int argc, char **argv)
     int hda_index;
     int optind;
     const char *r, *optarg;
-    CharDriverState *monitor_hd;
+    CharDriverState *monitor_hd = NULL;
     const char *monitor_device;
     const char *serial_devices[MAX_SERIAL_PORTS];
     int serial_device_index;
@@ -10046,9 +10046,81 @@ int main(int argc, char **argv)
     register_savevm("timer", 0, 2, timer_save, timer_load, NULL);
     register_savevm_live("ram", 0, 3, ram_save_live, NULL, ram_load, NULL);
 
+#ifndef _WIN32
+    /* must be after terminal init, SDL library changes signal handlers */
+    termsig_setup();
+#endif
+
+    /* Maintain compatibility with multiple stdio monitors */
+    if (!strcmp(monitor_device,"stdio")) {
+        for (i = 0; i < MAX_SERIAL_PORTS; i++) {
+            const char *devname = serial_devices[i];
+            if (devname && !strcmp(devname,"mon:stdio")) {
+                monitor_device = NULL;
+                break;
+            } else if (devname && !strcmp(devname,"stdio")) {
+                monitor_device = NULL;
+                serial_devices[i] = "mon:stdio";
+                break;
+            }
+        }
+    }
+
+    if (monitor_device) {
+        monitor_hd = qemu_chr_open("monitor", monitor_device);
+        if (!monitor_hd) {
+            fprintf(stderr, "qemu: could not open monitor device '%s'\n", monitor_device);
+            exit(1);
+        }
+    }
+
+    for(i = 0; i < MAX_SERIAL_PORTS; i++) {
+        const char *devname = serial_devices[i];
+        if (devname && strcmp(devname, "none")) {
+            char label[32];
+            snprintf(label, sizeof(label), "serial%d", i);
+            serial_hds[i] = qemu_chr_open(label, devname);
+            if (!serial_hds[i]) {
+                fprintf(stderr, "qemu: could not open serial device '%s'\n",
+                        devname);
+                exit(1);
+            }
+        }
+    }
+
+    for(i = 0; i < MAX_PARALLEL_PORTS; i++) {
+        const char *devname = parallel_devices[i];
+        if (devname && strcmp(devname, "none")) {
+            char label[32];
+            snprintf(label, sizeof(label), "parallel%d", i);
+            parallel_hds[i] = qemu_chr_open(label, devname);
+            if (!parallel_hds[i]) {
+                fprintf(stderr, "qemu: could not open parallel device '%s'\n",
+                        devname);
+                exit(1);
+            }
+        }
+    }
+
+    machine->init(ram_size, vga_ram_size, boot_devices,
+                  kernel_filename, kernel_cmdline, initrd_filename, cpu_model,
+                 direct_pci);
+
+    /* init USB devices */
+    if (usb_enabled) {
+        for(i = 0; i < usb_devices_index; i++) {
+            if (usb_device_add(usb_devices[i]) < 0) {
+                fprintf(stderr, "Warning: could not add USB device %s\n",
+                        usb_devices[i]);
+            }
+        }
+    }
+
+    if (!display_state)
+        dumb_display_init();
+    /* just use the first displaystate for the moment */
+    ds = display_state;
     /* terminal init */
-    memset(&display_state, 0, sizeof(display_state));
-    ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
 #ifdef CONFIG_STUBDOM
     if (xenfb_pv_display_init(ds) == 0) {
     } else
@@ -10088,31 +10160,18 @@ int main(int argc, char **argv)
     }
     dpy_resize(ds);
 
-#ifndef _WIN32
-    /* must be after terminal init, SDL library changes signal handlers */
-    termsig_setup();
-#endif
-
-    /* Maintain compatibility with multiple stdio monitors */
-    if (!strcmp(monitor_device,"stdio")) {
-        for (i = 0; i < MAX_SERIAL_PORTS; i++) {
-            const char *devname = serial_devices[i];
-            if (devname && !strcmp(devname,"mon:stdio")) {
-                monitor_device = NULL;
-                break;
-            } else if (devname && !strcmp(devname,"stdio")) {
-                monitor_device = NULL;
-                serial_devices[i] = "mon:stdio";
-                break;
-            }
+    dcl = ds->listeners;
+    while (dcl != NULL) {
+        if (dcl->dpy_refresh != NULL) {
+            ds->gui_timer = qemu_new_timer(rt_clock, gui_update, ds);
+            qemu_mod_timer(ds->gui_timer, qemu_get_clock(rt_clock));
         }
+        dcl = dcl->next;
     }
-    if (monitor_device) {
-        monitor_hd = qemu_chr_open("monitor", monitor_device);
-        if (!monitor_hd) {
-            fprintf(stderr, "qemu: could not open monitor device '%s'\n", monitor_device);
-            exit(1);
-        }
+
+    text_consoles_set_display(display_state);
+
+    if (monitor_device && monitor_hd) {
         monitor_init(monitor_hd, !nographic);
     }
 
@@ -10121,12 +10180,6 @@ int main(int argc, char **argv)
         if (devname && strcmp(devname, "none")) {
             char label[32];
             snprintf(label, sizeof(label), "serial%d", i);
-            serial_hds[i] = qemu_chr_open(label, devname);
-            if (!serial_hds[i]) {
-                fprintf(stderr, "qemu: could not open serial device '%s'\n",
-                        devname);
-                exit(1);
-            }
             if (strstart(devname, "vc", 0))
                 qemu_chr_printf(serial_hds[i], "serial%d console\r\n", i);
            xenstore_store_serial_port_info(i, serial_hds[i], devname);
@@ -10138,12 +10191,6 @@ int main(int argc, char **argv)
         if (devname && strcmp(devname, "none")) {
             char label[32];
             snprintf(label, sizeof(label), "parallel%d", i);
-            parallel_hds[i] = qemu_chr_open(label, devname);
-            if (!parallel_hds[i]) {
-                fprintf(stderr, "qemu: could not open parallel device '%s'\n",
-                        devname);
-                exit(1);
-            }
             if (strstart(devname, "vc", 0))
                 qemu_chr_printf(parallel_hds[i], "parallel%d console\r\n", i);
         }
@@ -10159,29 +10206,6 @@ int main(int argc, char **argv)
     if (strlen(direct_pci_str) > 0)
         direct_pci = direct_pci_str;
 
-    machine->init(ram_size, vga_ram_size, boot_devices, ds,
-                  kernel_filename, kernel_cmdline, initrd_filename, cpu_model,
-                 direct_pci);
-
-    /* init USB devices */
-    if (usb_enabled) {
-        for(i = 0; i < usb_devices_index; i++) {
-            if (usb_device_add(usb_devices[i]) < 0) {
-                fprintf(stderr, "Warning: could not add USB device %s\n",
-                        usb_devices[i]);
-            }
-        }
-    }
-
-    dcl = ds->listeners;
-    while (dcl != NULL) {
-        if (dcl->dpy_refresh != NULL) {
-            display_state.gui_timer = qemu_new_timer(rt_clock, gui_update, &display_state);
-            qemu_mod_timer(display_state.gui_timer, qemu_get_clock(rt_clock));
-        }
-        dcl = dcl->next;
-    }
-
 #ifdef CONFIG_GDBSTUB
     if (use_gdbstub) {
         /* XXX: use standard host:port notation and modify options