Bug 2910 - GetAllFBConfigs in pbutil.c has problems w/X.org GLX.
Summary: GetAllFBConfigs in pbutil.c has problems w/X.org GLX.
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Demos (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 2917
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-05 14:29 UTC by Ian Romanick
Modified: 2009-08-24 12:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Allow pbinfo to work without GLX_SGIX_pbuffer (6.37 KB, patch)
2005-04-05 14:44 UTC, Ian Romanick
Details | Splinter Review

Description Ian Romanick 2005-04-05 14:29:53 UTC
I'm not sure if this problem is with GetAllFBConfigs in pbutil.c or with the
implementation of glXChooseFBConfigSGIX in the open-source libGL.  Either way,
when GetAllFBConfigs uses glXChooseFBConfigSGIX with the attributes {
GLX_RENDER_TYPE, 0, GLX_DRAWABLE_TYPE, 0, None }, no fbconfigs are returned. 
However, changing the attributes to { GLX_DEPTH_SIZE, 0, None } seems to work as
expected on the open-source libGL.  I haven't had a chance to test this yet with
Nvidia's libGL.

Which piece of code has the problem?
Comment 1 Ian Romanick 2005-04-05 14:44:59 UTC
Created attachment 2338 [details] [review]
Allow pbinfo to work without GLX_SGIX_pbuffer

As-is, pbinfo won't work unless either GLX 1.3 or both GLX_SGIX_fbconfig and
GLX_SGIX_pbuffer are available.  This hacky patch allows it to run with either
GLX 1.3 or GLX_SGIX_fbconfig (wihtout also needing GLX_SGIX_pbuffer).  Without
this patch, pbinfo can't be used with the open-source DRI drivers to reproduce
this bug.
Comment 2 Brian Paul 2005-04-06 15:39:11 UTC
I found that glXGetChooseFBConfigSGIX() is supposed to return a list of all
fbconfigs if the attribList pointer is NULL.   In stand-alone Mesa, this
resulted in a crash.  I've fixed the Fake/Xlib driver to do the right thing. 
You should check what the DRI libGL does with a NULL pointer.

I'm checking in updates to pbutil.[ch] to call glXChooseFBConfigSGIX() with NULL
in the GetAllFBConfigs() routine.  That might fix your problem in the initial
bug report.

Do you want your "hacky patch" applied as-is, or are you looking for something
cleaner?
Comment 3 Ian Romanick 2005-04-06 16:35:56 UTC
Looking at the extension spec, I believe that Brian has the right solution for
this bug.  As it turns out, the DRI libGL *also* causes a segv when a NULL
pointer is passed to glXChooseFBConfigSGIX.  I've filed bug #2917 for that.

As for my hacky-patch, I'm going to continue working on it for a bit.  When I
get something a little cleaner, and I *am* getting there, I'll go ahead and
commit it.

Thanks for following up on this.
Comment 4 Ian Romanick 2005-04-06 17:07:23 UTC
With Brian's changes and bug #2917 being fixed, I'm closing this as fixed.
Comment 5 Adam Jackson 2009-08-24 12:23:09 UTC
Mass version move, cvs -> git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.