From: Keir Fraser Date: Fri, 28 Mar 2008 11:15:43 +0000 (+0000) Subject: ioemu: Fall back to SDL rendering when GLX fails. X-Git-Tag: 3.3.0-rc1~246^2~21 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=df79af62428fa1f6a28af4395422384ce5e57cf2;p=xen.git ioemu: Fall back to SDL rendering when GLX fails. From: Stefano Stabellini Signed-off-by: Keir Fraser --- diff --git a/tools/ioemu/sdl.c b/tools/ioemu/sdl.c index aacc54f041..f3aa5e367c 100644 --- a/tools/ioemu/sdl.c +++ b/tools/ioemu/sdl.c @@ -210,21 +210,32 @@ static void sdl_resize(DisplayState *ds, int w, int h, int linesize) again: screen = SDL_SetVideoMode(w, h, 0, flags); -#ifndef CONFIG_OPENGL + if (!screen) { fprintf(stderr, "Could not open SDL display: %s\n", SDL_GetError()); + if (opengl_enabled) { + /* Fallback to SDL */ + opengl_enabled = 0; + ds->dpy_update = sdl_update; + ds->dpy_setdata = sdl_setdata; + sdl_resize(ds, w, h, linesize); + return; + } exit(1); } - if (!screen->pixels && (flags & SDL_HWSURFACE) && (flags & SDL_FULLSCREEN)) { - flags &= ~SDL_HWSURFACE; - goto again; - } - if (!screen->pixels) { - fprintf(stderr, "Could not open SDL display: %s\n", SDL_GetError()); - exit(1); + if (!opengl_enabled) { + if (!screen->pixels && (flags & SDL_HWSURFACE) && (flags & SDL_FULLSCREEN)) { + flags &= ~SDL_HWSURFACE; + goto again; + } + + if (!screen->pixels) { + fprintf(stderr, "Could not open SDL display: %s\n", SDL_GetError()); + exit(1); + } } -#endif + ds->width = w; ds->height = h; if (!ds->shared_buf) {