Bug 15641

Summary: GLX Visual Strangeness
Product: xorg Reporter: Ben Gamari <bgamari>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: krh
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
glxinfo -t when run with a Full set of GlxVisuals
none
glxinfo -t when run with a Typical set of Glx Visuals
none
Xorg log
none
Patch adding debug output to xserver
none
Minimal test case for issue
none
Fix to use X Visual IDs instead of GLX visual ids
none
New patch that actually applies against master none

Description Ben Gamari 2008-04-21 23:18:30 UTC
Created attachment 16092 [details]
glxinfo -t when run with a Full set of GlxVisuals

xserver from git master (along with mesa and xf86-video-intel from git) produces extremely strange sets of GL visuals, so much so that compiz refuses to start. 

When the GlxVisuals ServerFlags option is set to "typical" (which appears to be the same as minimal from GL/glx/glxscreens.c?), the server exposes three GL visuals, none of which are double-buffered (which compiz requires).

When GlxVisuals is set to "full", the server exposes 36 visuals, none of which are the root visual (0x21), again prohibiting compiz from starting.

Surely there is something wrong with this picture.
Comment 1 Ben Gamari 2008-04-21 23:19:17 UTC
Created attachment 16093 [details]
glxinfo -t when run with a Typical set of Glx Visuals
Comment 2 Ben Gamari 2008-04-21 23:51:31 UTC
It looks like someone else has experienced this bug as well: http://people.freedesktop.org/~cbrill/dri-log/index.php?date=2008-03-03&channel=dri-devel&show_html=true&highlight_names=krh%3Bghepeu&update=Update&date=2008-03-31 . Kristian , do you know anything about this?
Comment 3 Ben Gamari 2008-05-04 18:06:22 UTC
It looks like this might be an intel-specific issue actually, judging by http://bugs.freedesktop.org/show_bug.cgi?id=14340#c17. Any input anyone?
Comment 4 Michel Dänzer 2008-05-05 01:36:22 UTC
Please attach the X log file. In particular, is AIGLX enabled? I think GLX visuals are known to be busted currently when it isn't.
Comment 5 Ben Gamari 2008-05-05 08:39:44 UTC
Created attachment 16362 [details]
Xorg log
Comment 6 Ben Gamari 2008-05-05 08:42:53 UTC
I just attached a log which shows that AIGLX should be enabled. There are also some messages in that log which might not look familiar. These I added to the xserver to figure out what is happening. If they look like they might help, I attached the log, otherwise ignore them.
Comment 7 Ben Gamari 2008-05-05 08:44:08 UTC
Created attachment 16363 [details] [review]
Patch adding debug output to xserver
Comment 8 Michel Dänzer 2008-05-06 00:23:15 UTC
I'm not seeing this with radeon or intel, I suspect it could be 64 bit related.
Comment 9 Ben Gamari 2008-05-06 08:13:05 UTC
(In reply to comment #8)
> I'm not seeing this with radeon or intel, I suspect it could be 64 bit related.
> 

Ahh, touche. I completely neglected to consider this as an option.
Comment 10 Ben Gamari 2008-05-26 10:31:39 UTC
Created attachment 16744 [details]
Minimal test case for issue

On my machine, this fails with,

ben@mercury ~/c $ ./visual-test 
Using visual 0x21
Root visual is not a GL visual
Comment 11 Ben Gamari 2008-05-26 12:32:05 UTC
This is quite strange. It appears that my default root config is getting filtered out in filterOutNativeConfigs(). Surely, this can't be the intended behavior?
Comment 12 Ben Gamari 2008-05-27 10:21:17 UTC
Created attachment 16766 [details] [review]
Fix to use X Visual IDs instead of GLX visual ids

Thanks krh.
Comment 13 Ben Gamari 2008-05-27 10:26:40 UTC
Created attachment 16767 [details] [review]
New patch that actually applies against master
Comment 14 Eric Anholt 2009-01-30 22:39:37 UTC
Comment on attachment 16767 [details] [review]
New patch that actually applies against master

this patch appears to completely mix up the indices into arrays, and would result in bad results if the glx visuals weren't a 1:1 mapping to X visuals
Comment 15 Eric Anholt 2009-01-30 23:02:08 UTC
The "full" option appears to be broken -- it doesn't attempt to match the visuals to existing X visuals, so the root visual never gets a corresponding GLX visual even though one exists.  Lame.
Comment 16 Michel Dänzer 2009-09-01 01:02:21 UTC
Eric fixed this for xserver 1.6.

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.