[v2,2/9] panfrost: Remove job from ctx->jobs at submission time

Submitted by Boris Brezillon on Aug. 2, 2019, 5:18 p.m.

Details

Message ID 20190802171848.7805-3-boris.brezillon@collabora.com
State Accepted
Commit b5ca1e545843375560378cea19be8e50eb152de8
Headers show
Series "panfrost: Allocate the polygon lists on-demand" ( rev: 2 ) in Mesa

Commit Message

Boris Brezillon Aug. 2, 2019, 5:18 p.m.
This guarantees that new draws targetting the same framebuffer will
get a new job instance.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
---
Changes in v2:
* Add Alyssa's R-b
---
 src/gallium/drivers/panfrost/pan_job.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index cc81d475165e..d75af0c53308 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -198,6 +198,14 @@  panfrost_job_submit(struct panfrost_context *ctx, struct panfrost_job *job)
 	 */
         assert(!ctx->job || job == ctx->job);
         ctx->job = NULL;
+
+        /* Remove the job from the ctx->jobs set so that future
+         * panfrost_get_job() calls don't see it.
+         * We must reset the job key to avoid removing another valid entry when
+         * the job is freed.
+         */
+        _mesa_hash_table_remove_key(ctx->jobs, &job->key);
+        memset(&job->key, 0, sizeof(job->key));
 }
 
 void