ia64/xen-unstable

changeset 17809:6ec700f46c4e

stubdom: simplify xenfb resize handler

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jun 09 11:45:10 2008 +0100 (2008-06-09)
parents f6520678755a
children 5e5f3970f66f
files tools/ioemu/hw/xenfb.c
line diff
     1.1 --- a/tools/ioemu/hw/xenfb.c	Mon Jun 09 10:44:09 2008 +0100
     1.2 +++ b/tools/ioemu/hw/xenfb.c	Mon Jun 09 11:45:10 2008 +0100
     1.3 @@ -1353,8 +1353,6 @@ static char *kbd_path, *fb_path;
     1.4  
     1.5  static unsigned char linux2scancode[KEY_MAX + 1];
     1.6  
     1.7 -static void xenfb_pv_colourdepth(DisplayState *ds, int depth);
     1.8 -
     1.9  int xenfb_connect_vkbd(const char *path)
    1.10  {
    1.11      kbd_path = strdup(path);
    1.12 @@ -1381,10 +1379,17 @@ static void xenfb_pv_resize_shared(Displ
    1.13      XenFBState *xs = ds->opaque;
    1.14      struct fbfront_dev *fb_dev = xs->fb_dev;
    1.15      int offset;
    1.16 -    fprintf(stderr,"resize to %dx%d, %d required\n", w, h, linesize);
    1.17 -    xenfb_pv_colourdepth(ds, depth);
    1.18 +
    1.19 +    fprintf(stderr,"resize to %dx%d@%d, %d required\n", w, h, depth, linesize);
    1.20      ds->width = w;
    1.21      ds->height = h;
    1.22 +    if (!depth) {
    1.23 +        ds->shared_buf = 0;
    1.24 +        ds->depth = 32;
    1.25 +    } else {
    1.26 +        ds->shared_buf = 1;
    1.27 +        ds->depth = depth;
    1.28 +    }
    1.29      if (!linesize)
    1.30          ds->shared_buf = 0;
    1.31      if (!ds->shared_buf)
    1.32 @@ -1407,31 +1412,6 @@ static void xenfb_pv_resize(DisplayState
    1.33      xenfb_pv_resize_shared(ds, w, h, 0, 0, NULL);
    1.34  }
    1.35  
    1.36 -static void xenfb_pv_colourdepth(DisplayState *ds, int depth)
    1.37 -{
    1.38 -    XenFBState *xs = ds->opaque;
    1.39 -    struct fbfront_dev *fb_dev = xs->fb_dev;
    1.40 -    static int lastdepth = -1;
    1.41 -    if (!depth) {
    1.42 -        ds->shared_buf = 0;
    1.43 -        ds->depth = 32;
    1.44 -    } else {
    1.45 -        ds->shared_buf = 1;
    1.46 -        ds->depth = depth;
    1.47 -    }
    1.48 -    if (depth != lastdepth) {
    1.49 -        fprintf(stderr,"redepth to %d required\n", depth);
    1.50 -        lastdepth = depth;
    1.51 -    } else return;
    1.52 -    if (!fb_dev)
    1.53 -        return;
    1.54 -    if (ds->shared_buf) {
    1.55 -        ds->data = NULL;
    1.56 -    } else {
    1.57 -        ds->data = xs->nonshared_vram;
    1.58 -    }
    1.59 -}
    1.60 -
    1.61  static void xenfb_pv_setdata(DisplayState *ds, void *pixels)
    1.62  {
    1.63      XenFBState *xs = ds->opaque;