Mesa (master): xlib: stop calling XShmQueryVersion()
Brian Paul
brianp at kemper.freedesktop.org
Wed Jan 11 19:44:16 UTC 2012
Module: Mesa
Branch: master
Commit: 0a20051e6da99e91b7bf589ea457c77a8b618f26
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a20051e6da99e91b7bf589ea457c77a8b618f26
Author: Brian Paul <brianp at vmware.com>
Date: Tue Jan 10 19:32:38 2012 -0700
xlib: stop calling XShmQueryVersion()
It caused an X protocol error in some (rare) situations.
This is a follow-on to the previous commits which fixes a bug reported
by Wayne E. Robertz.
NOTE: This is a candidate for the 7.11 branch.
Reviewed-by: Adam Jackson <ajax at redhat.com>
---
src/mesa/drivers/x11/xm_api.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 81b2459..bdee2a2 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -114,16 +114,16 @@ static int host_byte_order( void )
static int check_for_xshm( XMesaDisplay *display )
{
#if defined(USE_XSHM)
- int major, minor, ignore;
- Bool pixmaps;
+ int ignore;
if (XQueryExtension( display, "MIT-SHM", &ignore, &ignore, &ignore )) {
- if (XShmQueryVersion( display, &major, &minor, &pixmaps )==True) {
- return (pixmaps==True) ? 2 : 1;
- }
- else {
- return 0;
- }
+ /* Note: we're no longer calling XShmQueryVersion() here. It seems
+ * to be flakey (triggers a spurious X protocol error when we close
+ * one display connection and start using a new one. XShm has been
+ * around a long time and hasn't changed so if MIT_SHM is supported
+ * we assume we're good to go.
+ */
+ return 2;
}
else {
return 0;
More information about the mesa-commit
mailing list