Bug 22561 - psc->ext_list_first_time is not set correctly if LIBGL_ALWAYS_INDIRECT is forced
Summary: psc->ext_list_first_time is not set correctly if LIBGL_ALWAYS_INDIRECT is forced
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-30 13:32 UTC by Jon Turney
Modified: 2010-03-05 13:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch which (incorrectly) removes the problematic calls to __glXExtensionBitIsEnabled() (1.68 KB, patch)
2009-06-30 13:32 UTC, Jon Turney
Details | Splinter Review
Patch to move initialization of ext_list_first_time out of DRI driver (2.58 KB, patch)
2009-07-03 03:54 UTC, Jon Turney
Details | Splinter Review
Patch to move initialization of ext_list_first_time out of DRI driver (2.57 KB, patch)
2009-10-01 06:26 UTC, Jon Turney
Details | Splinter Review
Patch to move initialization of ext_list_first_time to where it's storage is allocated (3.05 KB, patch)
2010-03-05 11:31 UTC, Jon Turney
Details | Splinter Review

Description Jon Turney 2009-06-30 13:32:22 UTC
Created attachment 27273 [details] [review]
Patch which (incorrectly) removes the problematic calls to __glXExtensionBitIsEnabled()

I'm using a Cygwin/X X server (which I'm writing some code for), which announces GLX version 1.2 and the GLX_SGIX_fbconfig extension

Indirect rendering is forced for the client using LIBGL_ALWAYS_INDIRECT

glxgears_fbconfig demo fails due to glXCreateContextWithConfigSGIX failing.

The cause of this seems to be that the mesa implementation of glXGetFBConfigFromVisualSGIX() uses __glXExtensionBitIsEnabled() to check if the GLX_SGIX_fbconfig extension is available, but that function only checks if the extension is supported for direct rendering.

Nothing else apart from these 3 functions from GLX_SGIX_fbconfig seems to use __glXExtensionBitIsEnabled, so I'm not sure exactly what the bug is here, or what the solution is.

Attached is a patch which removes those checks, and allows glxgears_fbconfig to run successfully, but that's probably incorrect for the direct path.
Comment 1 Jon Turney 2009-07-03 03:54:28 UTC
Created attachment 27364 [details] [review]
Patch to  move initialization of ext_list_first_time out of DRI driver

After a bit more staring at the code, the attached patch may be a more correct way to fix this: 

ext_list_first_time is only set in the DRI driver loader CreateScreen routine at the moment, so never gets set if DRI drivers are disabled by setting LIBGL_ALWAYS_INDIRECT.

If ext_list_first_time isn't set, the screen's direct_support flags (which seems to be a bit misnamed as it actually reflects the extensions supported by the client/server combination when direct rendering isn't available) are never intialized, so when __glXExtensionBitIsEnabled() is used to check them, they are always false.

So, this patch moves the initialization of ext_list_first_time out of the DRI driver loaders and up to where the screen config is allocated and initalized.
Comment 2 Jon Turney 2009-10-01 06:26:12 UTC
Created attachment 29975 [details] [review]
Patch to move initialization of ext_list_first_time out of DRI driver

Refreshed patch for git master
Comment 3 Jon Turney 2009-10-01 06:28:22 UTC
Retitled the bug to reflect the more correct analysis of what's wrong in comment #1
Comment 4 Jon Turney 2010-03-05 11:31:33 UTC
Created attachment 33793 [details] [review]
Patch to move initialization of ext_list_first_time to where it's storage is allocated

Refreshed patch for git master
Comment 5 Brian Paul 2010-03-05 13:59:47 UTC
Committed. Thanks.


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.