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

Author: Emma Anholt <[email protected]>
Date:   Mon Sep 20 11:11:30 2021 -0700

freedreno: Fix autotune regression since batch-cache rework.

I freed the key that autotune needed a little early.

Fixes: b2349a46715e ("freedreno: Move the batch cache to the context.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12942>

---

 src/gallium/drivers/freedreno/freedreno_batch.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c 
b/src/gallium/drivers/freedreno/freedreno_batch.c
index df6ea640d1b..a7cb906b861 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch.c
@@ -341,7 +341,6 @@ batch_flush(struct fd_batch *batch) assert_dt
    batch_flush_dependencies(batch);
 
    batch_reset_resources(batch);
-   fd_bc_free_key(batch);
    batch->flushed = true;
 
    if (batch == batch->ctx->batch)
@@ -354,6 +353,9 @@ batch_flush(struct fd_batch *batch) assert_dt
 
    debug_assert(batch->reference.count > 0);
 
+   /* Must come after fd_gmem_render_tiles, since that uses the key. */
+   fd_bc_free_key(batch);
+
    cleanup_submit(batch);
    fd_batch_unlock_submit(batch);
 }

Reply via email to