From e43abdce964f5ed9689cf908af8c305b39a5dd36 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 3 Feb 2016 09:54:46 +0000 Subject: [PATCH] dri2: Unblock Clients on Drawable release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the Window is destroyed by another client, such as the window manager, the original client may be blocked by DRI2 awaiting a vblank event. When this happens, DRI2DrawableGone forgets to unblock that client and so the wait never completes. Note Present/xshmfence is also suspectible to this race. Testcase: dri2-race/manager Signed-off-by: Chris Wilson Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä --- hw/xfree86/dri2/dri2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index bbff11c9f..dfc2f495d 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -413,6 +413,9 @@ DRI2DrawableGone(void *p, XID id) (*pDraw->pScreen->DestroyPixmap)(pPriv->redirectpixmap); } + if (pPriv->blockedClient) + AttendClient(pPriv->blockedClient); + free(pPriv); return Success;