glx: Downgrade sRGB-ful fbconfigs
authorAdam Jackson <ajax@redhat.com>
Tue, 6 Apr 2021 19:57:26 +0000 (15:57 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 8 Apr 2021 21:43:04 +0000 (21:43 +0000)
Again, NVIDIA supports this on every fbconfig, Mesa alternates it on and
off for some reason but only on some drivers, and in particular llvmpipe
doesn't try to create sRGB-ful fbconfigs. Nerf it out of the fbconfig.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1648>

src/glx/dri_common.c

index 4577ee4..f7a1a42 100644 (file)
@@ -278,6 +278,18 @@ driConfigEqual(const __DRIcoreExtension *core,
          }
          break;
 
+      case __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE:
+         if (!scalarEqual(config, attrib, value)) {
+            static int warned;
+            if (!warned) {
+               dri_message(_LOADER_DEBUG,
+                           "Disabling server's sRGB support\n");
+               warned = 1;
+            }
+            config->sRGBCapable = 0;
+         }
+         break;
+
       default:
          if (!scalarEqual(config, attrib, value))
             return GL_FALSE;