Demos (master): glxinfo: handle no fbconfigs case better

Dave Airlie airlied at kemper.freedesktop.org
Thu Nov 21 00:52:53 UTC 2013


Module: Demos
Branch: master
Commit: c202524348826e1e54a853d69395334faafa6103
URL:    http://cgit.freedesktop.org/mesa/demos/commit/?id=c202524348826e1e54a853d69395334faafa6103

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Nov 19 09:30:51 2013 +1000

glxinfo: handle no fbconfigs case better

If we get a server that has only GLX1.2 and no SGIX_fbconfig, we can
print stuff we shouldn't. If we have no fbconfigs then we don't have core
profile, so don't bother trying visual path when doing core profile.

Reviewed-by: Brian Paul <brianp at vmware.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/xdemos/glxinfo.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/xdemos/glxinfo.c b/src/xdemos/glxinfo.c
index 4d9a5cc..218b018 100644
--- a/src/xdemos/glxinfo.c
+++ b/src/xdemos/glxinfo.c
@@ -862,13 +862,14 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect,
       visinfo = glXGetVisualFromFBConfig(dpy, fbconfigs[0]);
       XFree(fbconfigs);
    }
-   else {
+   else if (!coreProfile) {
       visinfo = choose_xvisinfo(dpy, scrnum);
       if (visinfo)
 	 ctx = glXCreateContext(dpy, visinfo, NULL, allowDirect);
-   }
+   } else
+      visinfo = NULL;
 
-   if (!visinfo) {
+   if (!visinfo && !coreProfile) {
       fprintf(stderr, "Error: couldn't find RGB GLX visual or fbconfig\n");
       return False;
    }




More information about the mesa-commit mailing list