diff options
author | Iago Toral Quiroga <[email protected]> | 2019-06-14 12:06:25 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-06-18 08:09:03 +0200 |
commit | 5491883a9ad678393621082c03c2e1a24019e86c (patch) | |
tree | 279facabf7517c97764f423aeeca34ff942c8ca5 /src/gallium | |
parent | e8cd7a30d53c8612d33079c40a8b0c8aa0ef341f (diff) |
v3d: add a helper function to flush jobs using a BO
v2: use _mesa_set_search() (Eric)
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/v3d/v3d_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/v3d/v3d_job.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_context.h b/src/gallium/drivers/v3d/v3d_context.h index 225ebe2f5ab..3ab227afb6c 100644 --- a/src/gallium/drivers/v3d/v3d_context.h +++ b/src/gallium/drivers/v3d/v3d_context.h @@ -583,6 +583,7 @@ struct v3d_job *v3d_get_job_for_fbo(struct v3d_context *v3d); void v3d_job_add_bo(struct v3d_job *job, struct v3d_bo *bo); void v3d_job_add_write_resource(struct v3d_job *job, struct pipe_resource *prsc); void v3d_job_submit(struct v3d_context *v3d, struct v3d_job *job); +void v3d_flush_jobs_using_bo(struct v3d_context *v3d, struct v3d_bo *bo); void v3d_flush_jobs_writing_resource(struct v3d_context *v3d, struct pipe_resource *prsc); void v3d_flush_jobs_reading_resource(struct v3d_context *v3d, diff --git a/src/gallium/drivers/v3d/v3d_job.c b/src/gallium/drivers/v3d/v3d_job.c index 73546adfc66..487f514a055 100644 --- a/src/gallium/drivers/v3d/v3d_job.c +++ b/src/gallium/drivers/v3d/v3d_job.c @@ -147,6 +147,17 @@ v3d_job_add_write_resource(struct v3d_job *job, struct pipe_resource *prsc) } void +v3d_flush_jobs_using_bo(struct v3d_context *v3d, struct v3d_bo *bo) +{ + hash_table_foreach(v3d->jobs, entry) { + struct v3d_job *job = entry->data; + + if (_mesa_set_search(job->bos, bo)) + v3d_job_submit(v3d, job); + } +} + +void v3d_flush_jobs_writing_resource(struct v3d_context *v3d, struct pipe_resource *prsc) { |