diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2017-09-06 16:27:53 +0200 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-12-20 15:20:43 -0500 |
commit | 1726badd61358e644b96f7c561ba239a68d87ba6 (patch) | |
tree | 46abdde3e8dd5d4e2fc382210c64dd9187c9bb37 | |
parent | c64bd21d7a732b6b8de0f8f636e93b1d1bb46135 (diff) |
glx: Work around a GLX_OML swap method in older dri drivers
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@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 0fc26310d5b09213c65f50bde444a1758172b016)
-rw-r--r-- | glx/glxdricommon.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c index f6c6fcdf2..d374dc753 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; |