All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fixing Bug 1194: Fallback to SDL if GLX fails
@ 2008-03-28 10:33 Stefano Stabellini
  0 siblings, 0 replies; only message in thread
From: Stefano Stabellini @ 2008-03-28 10:33 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]

Hi all,
sorry for the delay fixing this bug.
I am attaching a simple patch that tries to fall back to SDL rendering 
when GLX fails.
Regards,

Stefano Stabellini

[-- Attachment #2: opengl-disable.patch --]
[-- Type: text/x-diff, Size: 1385 bytes --]

diff -r a819cf758b8c tools/ioemu/sdl.c
--- a/tools/ioemu/sdl.c	Thu Mar 27 16:20:25 2008 +0000
+++ b/tools/ioemu/sdl.c	Thu Mar 27 18:35:35 2008 +0000
@@ -210,21 +210,32 @@ static void sdl_resize(DisplayState *ds,
 
  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);
-    }
-#endif
+
+    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);
+        }
+    }
+
     ds->width = w;
     ds->height = h;
     if (!ds->shared_buf) {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-28 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 10:33 [PATCH] Fixing Bug 1194: Fallback to SDL if GLX fails Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.