[Mesa-dev,5/9] glx: don't expose sRGB visuals

Submitted by Marek Olšák on June 10, 2015, 4:27 p.m.

Details

Message ID 1433953640-2815-6-git-send-email-maraeo@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Marek Olšák June 10, 2015, 4:27 p.m.
From: Marek Olšák <marek.olsak@amd.com>

The problem is it makes Ubuntu Unity dark. It's probably using
OpenGL ES 2.0, chooses an sRGB-capable config and there is no way
to turn off sRGB rendering then.
---
 src/glx/dri_common.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 63c8de3..a5a6c7c 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -317,6 +317,15 @@  driConfigEqual(const __DRIcoreExtension *core,
             return GL_FALSE;
          break;
 
+      case __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE:
+         /* Don't expose sRGB-capable configs.
+          * DRI drivers only expose them for EGL_KHR_gl_colorspace,
+          * but historically no drivers have exposed them for GLX.
+          */
+         if (!scalarEqual(config, attrib, 0))
+            return GL_FALSE;
+         break;
+
       default:
          if (!scalarEqual(config, attrib, value))
             return GL_FALSE;