egl/dri2: expose srgb configs when KHR_gl_colorspace is available
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 29 Nov 2015 16:48:51 +0000 (16:48 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 22 Jan 2016 11:55:54 +0000 (11:55 +0000)
Otherwise the user has no way of using it, and we'll try to access the
linear one.

v2:
 - Bail out when KHR_gl_colorspace is missing and srgb is set (Marek)

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Fixes: c2c2e9ab604(egl: implement EGL_KHR_gl_colorspace (v2))
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91596
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
src/egl/drivers/dri2/egl_dri2.c

index d34b16119e29f3963e3f87bfcca2a9d7ba8fcf10..8f50f0ce5737dbdd8d8cef1629a4892575ff251d 100644 (file)
@@ -235,6 +235,8 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
 
       case __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE:
          srgb = value != 0;
+         if (!disp->Extensions.KHR_gl_colorspace && srgb)
+            return NULL;
          break;
 
       default: