[Mesa-dev] [PATCH] glxinfo: handle no fbconfigs case better

Dave Airlie airlied at gmail.com
Mon Nov 18 15:33:33 PST 2013


From: Dave Airlie <airlied at redhat.com>

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.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/xdemos/glxinfo.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/xdemos/glxinfo.c b/src/xdemos/glxinfo.c
index bb9e100..25967f7 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;
    }
-- 
1.8.4.2



More information about the mesa-dev mailing list