Revision b473df6e vl.c

b/vl.c
2585 2585
    defaultallocator_free_displaysurface
2586 2586
};
2587 2587

  
2588
/* dumb display */
2589

  
2590
static void dumb_display_init(void)
2591
{
2592
    DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
2593
    ds->allocator = &default_allocator;
2594
    ds->surface = qemu_create_displaysurface(ds, 640, 480);
2595
    register_displaystate(ds);
2596
}
2597

  
2588 2598
void register_displaystate(DisplayState *ds)
2589 2599
{
2590 2600
    DisplayState **s;
......
2597 2607

  
2598 2608
DisplayState *get_displaystate(void)
2599 2609
{
2610
    if (!display_state) {
2611
        dumb_display_init();
2612
    }
2600 2613
    return display_state;
2601 2614
}
2602 2615

  
......
2606 2619
    return ds->allocator;
2607 2620
}
2608 2621

  
2609
/* dumb display */
2610

  
2611
static void dumb_display_init(void)
2612
{
2613
    DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
2614
    ds->allocator = &default_allocator;
2615
    ds->surface = qemu_create_displaysurface(ds, 640, 480);
2616
    register_displaystate(ds);
2617
}
2618

  
2619 2622
/***********************************************************/
2620 2623
/* I/O handling */
2621 2624

  
......
5899 5902

  
5900 5903
    net_check_clients();
5901 5904

  
5902
    if (!display_state)
5903
        dumb_display_init();
5904 5905
    /* just use the first displaystate for the moment */
5905
    ds = display_state;
5906
    ds = get_displaystate();
5906 5907

  
5907 5908
    if (display_type == DT_DEFAULT) {
5908 5909
#if defined(CONFIG_SDL) || defined(CONFIG_COCOA)
......
5960 5961
        qemu_mod_timer(nographic_timer, qemu_get_clock(rt_clock));
5961 5962
    }
5962 5963

  
5963
    text_consoles_set_display(display_state);
5964
    text_consoles_set_display(ds);
5964 5965

  
5965 5966
    if (qemu_opts_foreach(&qemu_mon_opts, mon_init_func, NULL, 1) != 0)
5966 5967
        exit(1);

Also available in: Unified diff