aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_batch.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-07-22 17:55:59 -0400
committerRob Clark <[email protected]>2016-07-30 09:23:42 -0400
commit2d64a003c5059feebcb70b607311d380acc45962 (patch)
tree07e71ec75ae7cb71a0e28a1894f02d12545447d2 /src/gallium/drivers/freedreno/freedreno_batch.c
parent4175606474acda62775c41fa95a577e0796ff17f (diff)
freedreno: defer flush_queue allocation
Some apps, like warsow, create a bazillion contexts but don't render on most of them. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_batch.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_batch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c
index 76aaac8f0d9..276f6be93d9 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch.c
@@ -265,6 +265,10 @@ batch_flush(struct fd_batch *batch)
if (batch->ctx->screen->reorder) {
struct fd_batch *tmp = NULL;
fd_batch_reference(&tmp, batch);
+
+ if (!util_queue_is_initialized(&batch->ctx->flush_queue))
+ util_queue_init(&batch->ctx->flush_queue, "flush_queue", 16, 1);
+
util_queue_add_job(&batch->ctx->flush_queue,
batch, &batch->flush_fence,
batch_flush_func, batch_cleanup_func);