[Mesa-dev] [PATCH 6/8] i965: Call intel_finish before destroying the context
Jason Ekstrand
jason at jlekstrand.net
Wed Jun 13 20:26:58 UTC 2018
---
src/mesa/drivers/dri/i965/brw_context.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 9ced230ec14..98ec54f2ae3 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1099,6 +1099,14 @@ intelDestroyContext(__DRIcontext * driContextPriv)
(struct brw_context *) driContextPriv->driverPrivate;
struct gl_context *ctx = &brw->ctx;
+ /* Wait for our any outstanding rendering to be completed before we start
+ * freeing anything. It's probably safe to destroy the context while stuff
+ * is sill in flight since the kernel will reference count our BOs. This
+ * just ensures that everything is safe before we start destroying things
+ * in case doing so has any side-effects.
+ */
+ intel_finish(ctx);
+
_mesa_meta_free(&brw->ctx);
if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
--
2.17.1
More information about the mesa-dev
mailing list