summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_batch_cache.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-11-19 10:36:19 -0500
committerRob Clark <[email protected]>2017-12-03 14:17:40 -0500
commit15ebf387fc43632be0e68365cf92ac8fb1b64a9c (patch)
treec38457eb447df994c138d01a155122406accda3c /src/gallium/drivers/freedreno/freedreno_batch_cache.c
parentdeb57fb237c3be9629a39ef1978dfac4563d6bda (diff)
freedreno: rework fence tracking
ctx->last_fence isn't such a terribly clever idea, if batches can be flushed out of order. Instead, each batch now holds a fence, which is created before the batch is flushed (useful for next patch), that later gets populated after the batch is actually flushed. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_batch_cache.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_batch_cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_batch_cache.c b/src/gallium/drivers/freedreno/freedreno_batch_cache.c
index 9fea7d68271..470aca4f380 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch_cache.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch_cache.c
@@ -134,11 +134,12 @@ fd_bc_flush(struct fd_batch_cache *cache, struct fd_context *ctx)
hash_table_foreach(cache->ht, entry) {
struct fd_batch *batch = NULL;
+ /* hold a reference since we can drop screen->lock: */
fd_batch_reference_locked(&batch, (struct fd_batch *)entry->data);
if (batch->ctx == ctx) {
mtx_unlock(&ctx->screen->lock);
fd_batch_reference(&last_batch, batch);
- fd_batch_flush(batch, false);
+ fd_batch_flush(batch, false, false);
mtx_lock(&ctx->screen->lock);
}
fd_batch_reference_locked(&batch, NULL);
@@ -265,7 +266,7 @@ fd_bc_alloc_batch(struct fd_batch_cache *cache, struct fd_context *ctx)
*/
mtx_unlock(&ctx->screen->lock);
DBG("%p: too many batches! flush forced!", flush_batch);
- fd_batch_flush(flush_batch, true);
+ fd_batch_flush(flush_batch, true, false);
mtx_lock(&ctx->screen->lock);
/* While the resources get cleaned up automatically, the flush_batch