Bug 62999

Summary: glXChooseFBConfig with GLX_DRAWABLE_TYPE, GLX_DONT_CARE fails
Product: Mesa Reporter: Alexander Monakov <amonakov>
Component: GLXAssignee: mesa-dev
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Alexander Monakov 2013-04-01 16:36:43 UTC
The following aborts, indicating a wrong implementation of GLX spec.  This is minimized from failing startup of Rage under Wine.


#include <GL/glx.h>
#include <assert.h>

int main()
{
  int n;
  glXChooseFBConfig(XOpenDisplay(NULL), 0, (int[]){GLX_DRAWABLE_TYPE, GLX_DONT_CARE, 0}, &n);
  assert(n);
}
Comment 1 Brian Paul 2013-04-01 18:08:10 UTC
Can you attach the output of glxinfo?
Comment 2 Alexander Monakov 2013-04-01 18:21:12 UTC
(In reply to comment #1)
> Can you attach the output of glxinfo?

I don't want to sound arrogant, but I fail to see how that would be relevant.

In http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxcmds.c, fbconfigs_compatible() fails to follow the GLX specification, which says:

    If GLX_DONT_CARE is specified as an attribute value,
    then the attribute will not be checked.

MATCH_EXACT and MATCH_MASK don't check a->param for GLX_DONT_CARE.
Comment 3 gurketsky 2013-04-01 18:33:06 UTC
Dupe of bug 47478 .
Comment 4 gurketsky 2013-04-01 18:34:07 UTC

*** This bug has been marked as a duplicate of bug 47478 ***
Comment 5 Brian Paul 2013-04-01 18:52:46 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Can you attach the output of glxinfo?
> 
> I don't want to sound arrogant, but I fail to see how that would be relevant.
> 
> In http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxcmds.c,
> fbconfigs_compatible() fails to follow the GLX specification, which says:
> 
>     If GLX_DONT_CARE is specified as an attribute value,
>     then the attribute will not be checked.
> 
> MATCH_EXACT and MATCH_MASK don't check a->param for GLX_DONT_CARE.

There are three implementations of GLX in the Mesa tree:
src/glx/  (for DRI drivers)
src/mesa/drivers/x11/  (for legacy swrast)
src/gallium/state_trackers/glx/xlib/  (for llvmpipe/softpipe)

The output of glxinfo would tell me which one you're using.
Comment 6 Alexander Monakov 2013-04-01 18:56:30 UTC
Thanks for the explanation.  I was talking, of course, about the first (DRI).  I was assuming you ran the testcase and saw the failure.
Comment 7 Alexander Monakov 2013-04-01 19:18:32 UTC

*** This bug has been marked as a duplicate of bug 47478 ***

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.