Mesa (master): st/dri: wait for thread to finish before unbinding context
Timothy Arceri
tarceri at kemper.freedesktop.org
Sat Mar 18 03:16:05 UTC 2017
Module: Mesa
Branch: master
Commit: 9e42b93f338d73d5bb97279060cedef70622c1d0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e42b93f338d73d5bb97279060cedef70622c1d0
Author: Timothy Arceri <tarceri at itsqueeze.com>
Date: Fri Mar 17 11:02:14 2017 +1100
st/dri: wait for thread to finish before unbinding context
Fixes a bunch of piglit crashes that hit an assert() when trying
to delete the framebuffer. The assert() was triggered because
WinSysDrawBuffer was set to NULL before glDeleteFramebuffers()
was called.
Tested-by: Michel Dänzer <michel.daenzer at amd.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/state_trackers/dri/dri_context.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index 91d2d1fbbe..92d79849c4 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -206,6 +206,9 @@ dri_unbind_context(__DRIcontext * cPriv)
if (--ctx->bind_count == 0) {
if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
+ if (ctx->st->thread_finish)
+ ctx->st->thread_finish(ctx->st);
+
/* For conformance, unbind is supposed to flush the context.
* However, if we do it here we might end up flushing a partially
* destroyed context. Instead, we flush in dri_make_current and
More information about the mesa-commit
mailing list