Mesa (master): glx: Don't downgrade the visual caveat from the server

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 8 22:23:51 UTC 2021


Module: Mesa
Branch: master
Commit: 8917ca8af55df9321fbaa8ad67ceed716abb8ce7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8917ca8af55df9321fbaa8ad67ceed716abb8ce7

Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Apr  6 15:50:35 2021 -0400

glx: Don't downgrade the visual caveat from the server

Mesa marks accumful fbconfigs as slow (for no especially good reason,
it's only accum operations that aren't accelerated, and we could fix
that). NVIDIA doesn't. All that mismatching on this attribute can do is
prevent a config from working exactly as well as it possibly can.

Trust the server's opinion here (but warn if you ask for warnings).

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

---

 src/glx/dri_common.c | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 2262db67459..beb5c8a0ff7 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -205,17 +205,6 @@ driConfigEqual(const __DRIcoreExtension *core,
             return GL_FALSE;
          break;
 
-      case __DRI_ATTRIB_CONFIG_CAVEAT:
-         if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
-            glxValue = GLX_NON_CONFORMANT_CONFIG;
-         else if (value & __DRI_ATTRIB_SLOW_BIT)
-            glxValue = GLX_SLOW_CONFIG;
-         else
-            glxValue = GLX_NONE;
-         if (glxValue != config->visualRating)
-            return GL_FALSE;
-         break;
-
       case __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS:
          glxValue = 0;
          if (value & __DRI_ATTRIB_TEXTURE_1D_BIT)
@@ -242,6 +231,30 @@ driConfigEqual(const __DRIcoreExtension *core,
 
          break;
 
+      /* Nerf some attributes we can safely ignore if the server claims to
+       * support them but the driver does not.
+       */
+      case __DRI_ATTRIB_CONFIG_CAVEAT:
+         if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
+            glxValue = GLX_NON_CONFORMANT_CONFIG;
+         else if (value & __DRI_ATTRIB_SLOW_BIT)
+            glxValue = GLX_SLOW_CONFIG;
+         else
+            glxValue = GLX_NONE;
+         if (glxValue != config->visualRating) {
+            if (config->visualRating == GLX_NONE) {
+               static int warned;
+               if (!warned) {
+                  dri_message(_LOADER_DEBUG,
+                              "Not downgrading visual rating\n");
+                  warned = 1;
+               }
+            } else {
+               return GL_FALSE;
+            }
+         }
+         break;
+
       default:
          if (!scalarEqual(config, attrib, value))
             return GL_FALSE;



More information about the mesa-commit mailing list