Summary: | Add workaround(s) for 'Mesa 8.0.5 X11 SWRAST' issues (glXGetFBConfigAttrib, glXMakeContextCurrent) | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Sven Gothel <sgothel> |
Component: | opengl | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | fredrik |
Priority: | --- | ||
Version: | 2 | ||
Hardware: | All | ||
OS: | all | ||
Type: | --- | SCM Refs: |
fdd60adb1d421f2018b47ee17e9079c94b54910f
fdea8596b2ccc1221a980e4c9fd10de85d885a3c
|
Workaround: | TRUE | ||
Attachments: |
Shows glXGetFBConfigAttrib issue
Shows glXMakeContextCurrent issue |
Description
Sven Gothel
2014-02-06 14:32:57 CET
See forum discussion: <http://forum.jogamp.org/Cannot-initialize-JOGL-on-Mesa-swrast-after-upgrade-tp4031458.html> Created attachment 585 [details]
Shows glXGetFBConfigAttrib issue
Created attachment 586 [details]
Shows glXMakeContextCurrent issue
From the forum discussion:
> We surely have a problem, the returned FBConfigs are not >= 15 bits-per-pixel.
>
> I am surprised that it even went this far, sine we require an RGB[A] surface .. hmm.
If you refer to the color configuration being those weird 2/3/3/0 or 3/3/2/0 quadruplets, then I agree that that is strange. However, the mesa-swx11 on Debian 6.0, which works perfectly well, also reports those visuals. Moreover, when I actually render on that system, it does work perfectly well, and the results definitely seem to be 8/8/8/8. Alpha works and everything.
I can't say I know what is up with that; I didn't notice until now that I examined the visuals on the Debian 6.0 system in connection with this discussion.
Actually, it does appear that Xvfb only supports 8-bit visuals in its default configuration. When configured to 24-bit support (with the -screen option), JOGL started working on it. I don't know why it worked on Debian 6.0, however, seeing as I had always started Xvfb unconfigured there, and the version of Xvfb on Debian 6.0 had the same default configuration. I can only assume that mesa-swx11 uses 32-bit buffers internally regardless of the X or GLX visual, but that doesn't quite seem to explain why JOGL worked on one but not the other. With this discovery, my problems are solved and mesa-swx11 works perfectly again. To summarize then, what I needed to do was to: 1) Fix the glXGetFBConfigs bug in Mesa (this is reported to Debian in BTS #737841); and 2) Set up Xvfb to use a 24-bit screen, using its -screen option. Are any of these issues anything you want to do something about in JOGL, and, if so, is there anything I can do to help? (In reply to comment #5) > Actually, it does appear that Xvfb only supports 8-bit visuals in its > default configuration. When configured to 24-bit support (with the -screen > option), JOGL started working on it. > > I don't know why it worked on Debian 6.0, however, seeing as I had always > started Xvfb unconfigured there, and the version of Xvfb on Debian 6.0 had > the same default configuration. I can only assume that mesa-swx11 uses > 32-bit buffers internally regardless of the X or GLX visual, but that > doesn't quite seem to explain why JOGL worked on one but not the other. > > With this discovery, my problems are solved and mesa-swx11 works perfectly > again. To summarize then, what I needed to do was to: > 1) Fix the glXGetFBConfigs bug in Mesa (this is reported to Debian in BTS > #737841); and > 2) Set up Xvfb to use a 24-bit screen, using its -screen option. > > Are any of these issues anything you want to do something about in JOGL, > and, if so, is there anything I can do to help? Thank you so much for your high quality report and cooperation Fredrik! I guess I will at least add a patch to handle the NULL FBConfig in the array list, otherwise there is nothing we can do. Great to have learned about this configuration - another success of choosing free software, would not be possible to have walked this path w/o it. KUDOS ~Sven PS: Keeping this open until I performed the patch. (In reply to comment #6) > I guess I will at least add a patch to handle the NULL FBConfig in the array list Just as a thought, it might be better to check the return value of glXGetFBConfigAttrib and skip modes with error returns (instead of aborting the whole thing), instead of removing NULLs from the list. That could possibly cover other kinds of driver bugs as well, in the case a driver returns some invalid mode (that is not necessarily NULL). Bug 961: Stabilize glXGetFBConfigAttrib(..) and glXChooseFBConfig(..) Usage Against OpenGL Bugs ; Fix glXGetFBConfigs - glXChooseFBConfig(..) - Remove NULL FBConfig pointer from result in native code, which has been observed in Mesa 8.0.5-4 libgl1-mesa-swx11 (Debian-7). - glXGetFBConfigs - Add manual implementation similar to glXChooseFBConfig - glXGetFBConfigAttrib(..) - glXGetFBConfig(..) - Returns boolean reflecting success, don't throw exception - caller handles error - Caller ignore failure if not essential (i.e. already chosen config) fdea8596b2ccc1221a980e4c9fd10de85d885a3c Fix commit fdd60adb1d421f2018b47ee17e9079c94b54910f (memmove byte-count) memmove's byte-count was just giving the element-count, missing the element-size multiplier to actually pass byte-count |