From: Keir Fraser Date: Mon, 9 Jun 2008 10:45:10 +0000 (+0100) Subject: stubdom: simplify xenfb resize handler X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14200^2~75 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4780a0ef28dad2bca1a4dc60df9e10d0e2655330;p=xen.git stubdom: simplify xenfb resize handler Signed-off-by: Samuel Thibault --- diff --git a/tools/ioemu/hw/xenfb.c b/tools/ioemu/hw/xenfb.c index 6a5540daad..43dfa49eb5 100644 --- a/tools/ioemu/hw/xenfb.c +++ b/tools/ioemu/hw/xenfb.c @@ -1353,8 +1353,6 @@ static char *kbd_path, *fb_path; static unsigned char linux2scancode[KEY_MAX + 1]; -static void xenfb_pv_colourdepth(DisplayState *ds, int depth); - int xenfb_connect_vkbd(const char *path) { kbd_path = strdup(path); @@ -1381,10 +1379,17 @@ static void xenfb_pv_resize_shared(DisplayState *ds, int w, int h, int depth, in XenFBState *xs = ds->opaque; struct fbfront_dev *fb_dev = xs->fb_dev; int offset; - fprintf(stderr,"resize to %dx%d, %d required\n", w, h, linesize); - xenfb_pv_colourdepth(ds, depth); + + fprintf(stderr,"resize to %dx%d@%d, %d required\n", w, h, depth, linesize); ds->width = w; ds->height = h; + if (!depth) { + ds->shared_buf = 0; + ds->depth = 32; + } else { + ds->shared_buf = 1; + ds->depth = depth; + } if (!linesize) ds->shared_buf = 0; if (!ds->shared_buf) @@ -1407,31 +1412,6 @@ static void xenfb_pv_resize(DisplayState *ds, int w, int h) xenfb_pv_resize_shared(ds, w, h, 0, 0, NULL); } -static void xenfb_pv_colourdepth(DisplayState *ds, int depth) -{ - XenFBState *xs = ds->opaque; - struct fbfront_dev *fb_dev = xs->fb_dev; - static int lastdepth = -1; - if (!depth) { - ds->shared_buf = 0; - ds->depth = 32; - } else { - ds->shared_buf = 1; - ds->depth = depth; - } - if (depth != lastdepth) { - fprintf(stderr,"redepth to %d required\n", depth); - lastdepth = depth; - } else return; - if (!fb_dev) - return; - if (ds->shared_buf) { - ds->data = NULL; - } else { - ds->data = xs->nonshared_vram; - } -} - static void xenfb_pv_setdata(DisplayState *ds, void *pixels) { XenFBState *xs = ds->opaque;