Revert "glx: Remove pointless GLX_INTEL_swap_event paranoia"
This reverts commit 19c57ea3bf
.
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>
This commit is contained in:
@@ -652,7 +652,7 @@ unsigned dri2GetSwapEventType(Display* dpy, XID drawable)
|
|||||||
struct glx_display *glx_dpy = __glXInitialize(dpy);
|
struct glx_display *glx_dpy = __glXInitialize(dpy);
|
||||||
__GLXDRIdrawable *pdraw;
|
__GLXDRIdrawable *pdraw;
|
||||||
pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, drawable);
|
pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, drawable);
|
||||||
if (!pdraw)
|
if (!pdraw || !(pdraw->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
|
||||||
return 0;
|
return 0;
|
||||||
return glx_dpy->codes.first_event + GLX_BufferSwapComplete;
|
return glx_dpy->codes.first_event + GLX_BufferSwapComplete;
|
||||||
}
|
}
|
||||||
|
@@ -60,6 +60,10 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|||||||
const CARD32 * attribs, size_t num_attribs)
|
const CARD32 * attribs, size_t num_attribs)
|
||||||
{
|
{
|
||||||
struct glx_display *priv = __glXInitialize(dpy);
|
struct glx_display *priv = __glXInitialize(dpy);
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
|
__GLXDRIdrawable *pdraw;
|
||||||
|
int i;
|
||||||
|
#endif
|
||||||
CARD32 *output;
|
CARD32 *output;
|
||||||
CARD8 opcode;
|
CARD8 opcode;
|
||||||
|
|
||||||
@@ -87,6 +91,22 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|||||||
UnlockDisplay(dpy);
|
UnlockDisplay(dpy);
|
||||||
SyncHandle();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -127,6 +127,7 @@ struct __GLXDRIdrawableRec
|
|||||||
struct glx_screen *psc;
|
struct glx_screen *psc;
|
||||||
GLenum textureTarget;
|
GLenum textureTarget;
|
||||||
GLenum textureFormat; /* EXT_texture_from_pixmap support */
|
GLenum textureFormat; /* EXT_texture_from_pixmap support */
|
||||||
|
unsigned long eventMask;
|
||||||
int refcount;
|
int refcount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user