Diff for /qemu/console.c between versions 1.1.1.10 and 1.1.1.11

version 1.1.1.10, 2018/04/24 18:33:40 version 1.1.1.11, 2018/04/24 18:55:58
Line 180  void vga_hw_screen_dump(const char *file Line 180  void vga_hw_screen_dump(const char *file
     active_console = consoles[0];      active_console = consoles[0];
     /* There is currently no way of specifying which screen we want to dump,      /* There is currently no way of specifying which screen we want to dump,
        so always dump the first one.  */         so always dump the first one.  */
     if (consoles[0]->hw_screen_dump)      if (consoles[0] && consoles[0]->hw_screen_dump)
         consoles[0]->hw_screen_dump(consoles[0]->hw, filename);          consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
     active_console = previous_active_console;      active_console = previous_active_console;
 }  }
Line 1135  static void kbd_send_chars(void *opaque) Line 1135  static void kbd_send_chars(void *opaque)
     /* characters are pending: we send them a bit later (XXX:      /* characters are pending: we send them a bit later (XXX:
        horrible, should change char device API) */         horrible, should change char device API) */
     if (s->out_fifo.count > 0) {      if (s->out_fifo.count > 0) {
         qemu_mod_timer(s->kbd_timer, qemu_get_clock(rt_clock) + 1);          qemu_mod_timer(s->kbd_timer, qemu_get_clock_ms(rt_clock) + 1);
     }      }
 }  }
   
Line 1278  static DisplaySurface* defaultallocator_ Line 1278  static DisplaySurface* defaultallocator_
 {  {
     DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface));      DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface));
   
     surface->width = width;      int linesize = width * 4;
     surface->height = height;      qemu_alloc_display(surface, width, height, linesize,
     surface->linesize = width * 4;                         qemu_default_pixelformat(32), 0);
     surface->pf = qemu_default_pixelformat(32);  
 #ifdef HOST_WORDS_BIGENDIAN  
     surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;  
 #else  
     surface->flags = QEMU_ALLOCATED_FLAG;  
 #endif  
     surface->data = (uint8_t*) qemu_mallocz(surface->linesize * surface->height);  
   
     return surface;      return surface;
 }  }
   
 static DisplaySurface* defaultallocator_resize_displaysurface(DisplaySurface *surface,  static DisplaySurface* defaultallocator_resize_displaysurface(DisplaySurface *surface,
                                           int width, int height)                                            int width, int height)
 {  {
       int linesize = width * 4;
       qemu_alloc_display(surface, width, height, linesize,
                          qemu_default_pixelformat(32), 0);
       return surface;
   }
   
   void qemu_alloc_display(DisplaySurface *surface, int width, int height,
                           int linesize, PixelFormat pf, int newflags)
   {
       void *data;
     surface->width = width;      surface->width = width;
     surface->height = height;      surface->height = height;
     surface->linesize = width * 4;      surface->linesize = linesize;
     surface->pf = qemu_default_pixelformat(32);      surface->pf = pf;
     if (surface->flags & QEMU_ALLOCATED_FLAG)      if (surface->flags & QEMU_ALLOCATED_FLAG) {
         surface->data = (uint8_t*) qemu_realloc(surface->data, surface->linesize * surface->height);          data = qemu_realloc(surface->data,
     else                              surface->linesize * surface->height);
         surface->data = (uint8_t*) qemu_malloc(surface->linesize * surface->height);      } else {
           data = qemu_malloc(surface->linesize * surface->height);
       }
       surface->data = (uint8_t *)data;
       surface->flags = newflags | QEMU_ALLOCATED_FLAG;
 #ifdef HOST_WORDS_BIGENDIAN  #ifdef HOST_WORDS_BIGENDIAN
     surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;      surface->flags |= QEMU_BIG_ENDIAN_FLAG;
 #else  
     surface->flags = QEMU_ALLOCATED_FLAG;  
 #endif  #endif
   
     return surface;  
 }  }
   
 DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,  DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,
Line 1347  static struct DisplayAllocator default_a Line 1349  static struct DisplayAllocator default_a
 static void dumb_display_init(void)  static void dumb_display_init(void)
 {  {
     DisplayState *ds = qemu_mallocz(sizeof(DisplayState));      DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
       int width = 640;
       int height = 480;
   
     ds->allocator = &default_allocator;      ds->allocator = &default_allocator;
     ds->surface = qemu_create_displaysurface(ds, 640, 480);      if (is_fixedsize_console()) {
           width = active_console->g_width;
           height = active_console->g_height;
       }
       ds->surface = qemu_create_displaysurface(ds, width, height);
     register_displaystate(ds);      register_displaystate(ds);
 }  }
   
Line 1457  static void text_console_do_init(CharDri Line 1466  static void text_console_do_init(CharDri
   
     s->out_fifo.buf = s->out_fifo_buf;      s->out_fifo.buf = s->out_fifo_buf;
     s->out_fifo.buf_size = sizeof(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->kbd_timer = qemu_new_timer_ms(rt_clock, kbd_send_chars, s);
     s->ds = ds;      s->ds = ds;
   
     if (!color_inited) {      if (!color_inited) {
Line 1505  static void text_console_do_init(CharDri Line 1514  static void text_console_do_init(CharDri
         chr->init(chr);          chr->init(chr);
 }  }
   
 CharDriverState *text_console_init(QemuOpts *opts)  int text_console_init(QemuOpts *opts, CharDriverState **_chr)
 {  {
     CharDriverState *chr;      CharDriverState *chr;
     TextConsole *s;      TextConsole *s;
Line 1537  CharDriverState *text_console_init(QemuO Line 1546  CharDriverState *text_console_init(QemuO
   
     if (!s) {      if (!s) {
         free(chr);          free(chr);
         return NULL;          return -EBUSY;
     }      }
   
     s->chr = chr;      s->chr = chr;
Line 1545  CharDriverState *text_console_init(QemuO Line 1554  CharDriverState *text_console_init(QemuO
     s->g_height = height;      s->g_height = height;
     chr->opaque = s;      chr->opaque = s;
     chr->chr_set_echo = text_console_set_echo;      chr->chr_set_echo = text_console_set_echo;
     return chr;  
       *_chr = chr;
       return 0;
 }  }
   
 void text_consoles_set_display(DisplayState *ds)  void text_consoles_set_display(DisplayState *ds)

Removed from v.1.1.1.10  
changed lines
  Added in v.1.1.1.11


unix.superglobalmegacorp.com