summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_job.c
diff options
context:
space:
mode:
authorRohan Garg <[email protected]>2019-08-30 18:00:13 +0200
committerBoris Brezillon <[email protected]>2019-08-30 22:10:49 +0200
commitb2ff2dfc2a8797260d7b87a5cc6188d891f713ff (patch)
tree82a932b7d39f61ab3ba8040d47983eb781883c75 /src/gallium/drivers/panfrost/pan_job.c
parent6b0dc3d53011b384798bcdb5d5e804d7482a3247 (diff)
panfrost: protect access to shared bo cache and transient pool
Both the BO cache and the transient pool are shared across context's. Protect access to these with mutexes. Signed-off-by: Rohan Garg <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_job.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_job.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index f5bbd04b913..f7ff57c4331 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -67,10 +67,12 @@ panfrost_free_job(struct panfrost_context *ctx, struct panfrost_job *job)
/* Free up the transient BOs we're sitting on */
struct panfrost_screen *screen = pan_screen(ctx->base.screen);
+ pthread_mutex_lock(&screen->transient_lock);
util_dynarray_foreach(&job->transient_indices, unsigned, index) {
/* Mark it free */
BITSET_SET(screen->free_transient, *index);
}
+ pthread_mutex_unlock(&screen->transient_lock);
/* Unreference the polygon list */
panfrost_bo_unreference(ctx->base.screen, job->polygon_list);