summaryrefslogtreecommitdiff
path: root/src/glx
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-06-12 17:42:46 +0800
committerEric Engestrom <eric@engestrom.ch>2023-06-15 22:10:35 +0100
commit9bd71cd6017596488f4a11cc72d3cce594732c6b (patch)
tree7ecfe03bcce946205851e5f9cfe4acb14afc74ee /src/glx
parent37531fa0ce9eee2e1c78c64cbdcf0214543c1e13 (diff)
downloadmesa-9bd71cd6017596488f4a11cc72d3cce594732c6b.tar.gz
mesa-9bd71cd6017596488f4a11cc72d3cce594732c6b.tar.bz2
mesa-9bd71cd6017596488f4a11cc72d3cce594732c6b.zip
Revert "glx: Remove pointless GLX_INTEL_swap_event paranoia"
This reverts commit 19c57ea3bf6d77cf6f07f2a56e781f55b0e6013b. This commit is causing a reproducible crash of GNOME shell on Xorg server. Revert it for now and we may investigate it further in the future. Fixes #8542. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23589> (cherry picked from commit bbd428401697fe6e1ed0dbbabe952dd27955d388)
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/dri2_glx.c2
-rw-r--r--src/glx/glx_pbuffer.c20
-rw-r--r--src/glx/glxclient.h1
3 files changed, 22 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 633b0ba6e7b..36243c60aa5 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -652,7 +652,7 @@ unsigned dri2GetSwapEventType(Display* dpy, XID drawable)
struct glx_display *glx_dpy = __glXInitialize(dpy);
__GLXDRIdrawable *pdraw;
pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, drawable);
- if (!pdraw)
+ if (!pdraw || !(pdraw->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
return 0;
return glx_dpy->codes.first_event + GLX_BufferSwapComplete;
}
diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index e0a0b662816..0b3cdfaa587 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -60,6 +60,10 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
const CARD32 * attribs, size_t num_attribs)
{
struct glx_display *priv = __glXInitialize(dpy);
+#ifdef GLX_DIRECT_RENDERING
+ __GLXDRIdrawable *pdraw;
+ int i;
+#endif
CARD32 *output;
CARD8 opcode;
@@ -87,6 +91,22 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
UnlockDisplay(dpy);
SyncHandle();
+#ifdef GLX_DIRECT_RENDERING
+ pdraw = GetGLXDRIDrawable(dpy, drawable);
+
+ if (!pdraw)
+ return;
+
+ for (i = 0; i < num_attribs; i++) {
+ switch(attribs[i * 2]) {
+ case GLX_EVENT_MASK:
+ /* Keep a local copy for masking out DRI2 proto events as needed */
+ pdraw->eventMask = attribs[i * 2 + 1];
+ break;
+ }
+ }
+#endif
+
return;
}
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index ead33c378fe..013a6ed6a7e 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -127,6 +127,7 @@ struct __GLXDRIdrawableRec
struct glx_screen *psc;
GLenum textureTarget;
GLenum textureFormat; /* EXT_texture_from_pixmap support */
+ unsigned long eventMask;
int refcount;
};