Commit 8f391ab41ac02d6f7d94113161883f3ff92cc144

Authored by aliguori
1 parent 65e1d81b

Remove dumb_display (Stefan Stabellini)

However I think the following fix is cleaner: we do not need a
dumb_display_init that creates an empty DisplayChangeListener any more.
We do need a dumb_display_init that allocates a zeroed DisplayState
structure if none else does it.

Tested-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6369 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 5 additions and 22 deletions
... ... @@ -2775,25 +2775,10 @@ DisplayState *get_displaystate(void)
2775 2775  
2776 2776 /* dumb display */
2777 2777  
2778   -static void dumb_update(DisplayState *ds, int x, int y, int w, int h)
  2778 +static void dumb_display_init(void)
2779 2779 {
2780   -}
2781   -
2782   -static void dumb_resize(DisplayState *ds)
2783   -{
2784   -}
2785   -
2786   -static void dumb_display_init(DisplayState *ds)
2787   -{
2788   - DisplayChangeListener *dcl = qemu_mallocz(sizeof(DisplayChangeListener));
2789   - if (!dcl)
2790   - exit(1);
2791   - dcl->dpy_update = dumb_update;
2792   - dcl->dpy_resize = dumb_resize;
2793   - dcl->dpy_refresh = NULL;
2794   - dcl->idle = 1;
2795   - dcl->gui_timer_interval = 500;
2796   - register_displaychangelistener(ds, dcl);
  2780 + DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
  2781 + register_displaystate(ds);
2797 2782 }
2798 2783  
2799 2784 /***********************************************************/
... ... @@ -5535,6 +5520,8 @@ int main(int argc, char **argv, char **envp)
5535 5520 }
5536 5521 }
5537 5522  
  5523 + if (!display_state)
  5524 + dumb_display_init();
5538 5525 /* just use the first displaystate for the moment */
5539 5526 ds = display_state;
5540 5527 /* terminal init */
... ... @@ -5543,8 +5530,6 @@ int main(int argc, char **argv, char **envp)
5543 5530 fprintf(stderr, "fatal: -nographic can't be used with -curses\n");
5544 5531 exit(1);
5545 5532 }
5546   - /* nearly nothing to do */
5547   - dumb_display_init(ds);
5548 5533 } else {
5549 5534 #if defined(CONFIG_CURSES)
5550 5535 if (curses) {
... ... @@ -5563,8 +5548,6 @@ int main(int argc, char **argv, char **envp)
5563 5548 sdl_display_init(ds, full_screen, no_frame);
5564 5549 #elif defined(CONFIG_COCOA)
5565 5550 cocoa_display_init(ds, full_screen);
5566   -#else
5567   - dumb_display_init(ds);
5568 5551 #endif
5569 5552 }
5570 5553 }
... ...