[PATCH xserver 4/4] dri2: Unblock Clients on Drawable release

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 3 09:54:46 UTC 2016


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 <chris at chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 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 2f05c64..80a601e 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -416,6 +416,9 @@ DRI2DrawableGone(void *p, XID id)
         (*pDraw->pScreen->DestroyPixmap)(pPriv->redirectpixmap);
     }
 
+    if (pPriv->blockedClient)
+        AttendClient(pPriv->blockedClient);
+
     free(pPriv);
 
     return Success;
-- 
2.7.0



More information about the xorg-devel mailing list