After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663127 - [PATCH] cogl-winsys-glx: fix fallback to RGB visuals
[PATCH] cogl-winsys-glx: fix fallback to RGB visuals
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: GLX
git master
Other Linux
: Normal major
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
: 663411 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-10-31 21:09 UTC by Balló György
Modified: 2011-11-04 16:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cogl-winsys-glx: fix fallback to RGB visuals (2.18 KB, patch)
2011-10-31 21:09 UTC, Balló György
none Details | Review
cogl: fallback to non-transparent stages if unsupported (2.38 KB, patch)
2011-11-01 13:57 UTC, Robert Bragg
accepted-commit_now Details | Review

Description Balló György 2011-10-31 21:09:21 UTC
Created attachment 200368 [details] [review]
cogl-winsys-glx: fix fallback to RGB visuals

A comment says that if RGBA visuals not found, we fall back to using an RGB config. But it's not happened in fact.

This patch fixes the failure with the Nouveau classic Mesa driver, if RGBA visuals requested, but not found.

If you accept this fix, please apply it for both master and cogl-1.8 branch.
Comment 1 Robert Bragg 2011-11-01 13:57:28 UTC
Created attachment 200402 [details] [review]
cogl: fallback to non-transparent stages if unsupported

thanks for jumping in and making a patch!

I think though clutter should probably handle this fallback not cogl, because cogl doesn't know if such a fallback is really acceptable. Currently the only fallback similar to this that we handle in cogl is for egl to fallback when no stencil buffer is found but generally we would rather not second guess what is acceptable as a fallback - even for the stencil buffer case I'd rather have apis like clutter handle that at some point.

Can you perhaps point to the comment you refer to that says if RGBA visuals not found, we fall back to using an RGB config? I wonder if that was a comment in clutter not cogl? That comment should probably updated if it's in cogl.

I've scrapped together a patch that tries to do the fallback in clutter instead, It'd be good to hear if that works for you too.
Comment 2 Balló György 2011-11-02 00:45:51 UTC
Thanks, your patch for clutter solves also this problem!

The misleading comment can be found in file cogl-winsys-glx.c line 562:
http://git.gnome.org/browse/cogl/tree/cogl/winsys/cogl-winsys-glx.c#n562
Comment 3 Emmanuele Bassi (:ebassi) 2011-11-02 15:39:46 UTC
Review of attachment 200402 [details] [review]:

looks good to me. we might want to revisit the GError usage in a later commit, since Clutter should not just relay Cogl GError domains in this case.
Comment 4 Robert Bragg 2011-11-02 18:00:06 UTC
(In reply to comment #2)
> Thanks, your patch for clutter solves also this problem!
> 
> The misleading comment can be found in file cogl-winsys-glx.c line 562:
> http://git.gnome.org/browse/cogl/tree/cogl/winsys/cogl-winsys-glx.c#n562

ah right, yeah looking at the code it doesn't look like it actually tries to fallback though it probably did at some point, we should remove that comment.

thanks for testing the patch, I've landed it in master as:

commit db53ca382c5db10fa19f93761b8f898b20a4534f
Author: Robert Bragg <robert@linux.intel.com>
Date:   Tue Nov 1 13:42:40 2011 +0000

    cogl: fallback to non-transparent stages if unsupported
    
    If our check of the CoglOnscreenTemplate during initialization fails
    then we disable the request for an alpha component in the swap chain and
    try the check again.
    
    Reviewed-by: Neil Roberts <neil@linux.intel.com>
    Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>

I will also cherry-pick the patch for the 1.8 branch
Comment 5 Neil Roberts 2011-11-04 16:43:28 UTC
*** Bug 663411 has been marked as a duplicate of this bug. ***