[PATCH xserver 1/2] glx: Work around a GLX_OML swap method in older dri drivers

Thomas Hellstrom thellstrom at vmware.com
Wed Sep 6 14:27:53 UTC 2017


The swapMethod config member would typically contain an arbitrary value
on older dri drivers. Fix this so that if we detect an illegal value,
return GLX_SWAP_UNDEFINED_OML

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
---
 glx/glxdricommon.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index f6c6fcd..d374dc7 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -181,6 +181,13 @@ createModeFromConfig(const __DRIcoreExtension * core,
                 config->config.bindToTextureTargets |=
                     GLX_TEXTURE_RECTANGLE_BIT_EXT;
             break;
+        case __DRI_ATTRIB_SWAP_METHOD:
+            /* Workaround for broken dri drivers */
+            if (value != GLX_SWAP_UNDEFINED_OML &&
+                value != GLX_SWAP_COPY_OML &&
+                value != GLX_SWAP_EXCHANGE_OML)
+                value = GLX_SWAP_UNDEFINED_OML;
+            /* Fall through. */
         default:
             setScalar(&config->config, attrib, value);
             break;
-- 
2.9.4



More information about the xorg-devel mailing list