From 8917ca8af55df9321fbaa8ad67ceed716abb8ce7 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 6 Apr 2021 15:50:35 -0400 Subject: [PATCH] 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 Part-of: --- 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;