Mesa (17.1): freedreno: fix crash if ctx torn down with no rendering

Emil Velikov evelikov at kemper.freedesktop.org
Mon Apr 24 14:32:50 UTC 2017


Module: Mesa
Branch: 17.1
Commit: bea2c4b88fa6d0bd0239f0e35a5cab5b73fce4fa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bea2c4b88fa6d0bd0239f0e35a5cab5b73fce4fa

Author: Rob Clark <robdclark at gmail.com>
Date:   Sat Apr 15 12:32:17 2017 -0400

freedreno: fix crash if ctx torn down with no rendering

In this case, ctx->flush_queue would not have been initialized.

Fixes: 0b613c20 ("freedreno: enable draw/batch reordering by default")
Cc: "17.1" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Rob Clark <robdclark at gmail.com>
(cherry picked from commit d4601b0efc7f5e24e3f39fefa8e29e79560245ce)

---

 src/gallium/drivers/freedreno/freedreno_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
index 4d8c4251a8..6478e0e7a9 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -112,7 +112,7 @@ fd_context_destroy(struct pipe_context *pctx)
 
 	DBG("");
 
-	if (ctx->screen->reorder)
+	if (ctx->screen->reorder && util_queue_is_initialized(&ctx->flush_queue))
 		util_queue_destroy(&ctx->flush_queue);
 
 	fd_batch_reference(&ctx->batch, NULL);  /* unref current batch */




More information about the mesa-commit mailing list