From f9e97ae62b4e5667855fc5d90b632f54331b2388 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 31 Jan 2016 09:05:52 +0000 Subject: [PATCH] sna/dri2: Restore signalling on Window destruction This reverts commit 5c735befdcc40f94bd740be9fc0df54ad53aa174 Author: Chris Wilson Date: Wed Jan 6 10:00:19 2016 +0000 sna/dri2: Ignore pending SwapComplete events when the window is destroyed as the error was due to setting signal after the drawable was destroed and fixed in commit 7817949314a21293c8bc34dec214b42932b19aaf Author: Chris Wilson Date: Wed Jan 27 10:54:46 2016 +0000 sna/dri2: Avoiding marking a pending-signal on a dead Drawable The only question that remains is what order does the teardown occur and can we unblock the client in time (as the core DRI2 has a bug where it does not cancel its IgnoreClient when the window is removed). Signed-off-by: Chris Wilson --- src/sna/sna_dri2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 045b12d..61c58ea 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -1846,16 +1846,19 @@ void sna_dri2_destroy_window(WindowPtr win) __FUNCTION__, info->signal, info->pending.bo ? info->pending.bo->handle : 0)); assert(info->draw == &win->drawable); + if (info->signal) + frame_swap_complete(info, DRI2_EXCHANGE_COMPLETE); if (info->pending.bo) { assert(info->pending.bo->active_scanout > 0); info->pending.bo->active_scanout--; + info->signal = true; + frame_swap_complete(info, DRI2_EXCHANGE_COMPLETE); kgem_bo_destroy(&sna->kgem, info->pending.bo); info->pending.bo = NULL; } - info->signal = false; info->draw = NULL; info->keepalive = 1; assert(!info->signal); -- 2.7.0