glx: Downgrade tfp mipmap-capable fbconfigs
authorAdam Jackson <ajax@redhat.com>
Tue, 6 Apr 2021 19:56:01 +0000 (15:56 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 8 Apr 2021 21:43:04 +0000 (21:43 +0000)
Again, NVIDIA does this but Mesa doesn't. Just disable it in the
fbconfig so apps can't try to use it.

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 b137869..4577ee4 100644 (file)
@@ -157,8 +157,7 @@ static const struct
       __ATTRIB(__DRI_ATTRIB_SWAP_METHOD, swapMethod),
       __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
       __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
-      __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE,
-                     bindToMipmapTexture),
+      __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
       __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
       __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable)
 };
@@ -267,6 +266,18 @@ driConfigEqual(const __DRIcoreExtension *core,
          }
          break;
 
+      case __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE:
+         if (!scalarEqual(config, attrib, value)) {
+            static int warned;
+            if (!warned) {
+               dri_message(_LOADER_DEBUG,
+                           "Disabling server's tfp mipmap support\n");
+               warned = 1;
+            }
+            config->bindToMipmapTexture = 0;
+         }
+         break;
+
       default:
          if (!scalarEqual(config, attrib, value))
             return GL_FALSE;