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@lists.freedesktop.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit d4601b0efc)
This commit is contained in:
Rob Clark 2017-04-15 12:32:17 -04:00 committed by Emil Velikov
parent ed846b4c78
commit bea2c4b88f

View file

@ -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 */