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@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1648>
This commit is contained in:
Adam Jackson 2021-04-06 15:50:35 -04:00 committed by Marge Bot
parent 7934b283dd
commit 8917ca8af5

View file

@ -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;