diff options
author | Stefan Schake <[email protected]> | 2018-04-25 00:00:59 +0200 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-05-17 16:04:28 +0100 |
commit | 44036c354d800dda08d3688b042130039f3d592a (patch) | |
tree | 371fabae2380e942d4ebf71d6d7d5dcd839d8ce1 /src/gallium/drivers/vc4/vc4_job.c | |
parent | 9ed05e2520f77a11f73d21bccfe149b2b800082c (diff) |
broadcom/vc4: Store job fence in syncobj
This gives us access to the fence created for the render job.
v2: Drop flag (Eric)
Signed-off-by: Stefan Schake <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_job.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_job.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_job.c b/src/gallium/drivers/vc4/vc4_job.c index 41c274ca1b3..3b0ba8b69cf 100644 --- a/src/gallium/drivers/vc4/vc4_job.c +++ b/src/gallium/drivers/vc4/vc4_job.c @@ -477,6 +477,9 @@ vc4_job_submit(struct vc4_context *vc4, struct vc4_job *job) } submit.flags |= job->flags; + if (vc4->screen->has_syncobj) + submit.out_sync = vc4->job_syncobj; + if (!(vc4_debug & VC4_DEBUG_NORAST)) { int ret; @@ -530,7 +533,7 @@ vc4_job_hash(const void *key) return _mesa_hash_data(key, sizeof(struct vc4_job_key)); } -void +int vc4_job_init(struct vc4_context *vc4) { vc4->jobs = _mesa_hash_table_create(vc4, @@ -539,5 +542,24 @@ vc4_job_init(struct vc4_context *vc4) vc4->write_jobs = _mesa_hash_table_create(vc4, _mesa_hash_pointer, _mesa_key_pointer_equal); + + if (vc4->screen->has_syncobj) { + /* Create the syncobj as signaled since with no job executed + * there is nothing to wait on. + */ + int ret = drmSyncobjCreate(vc4->fd, + DRM_SYNCOBJ_CREATE_SIGNALED, + &vc4->job_syncobj); + if (ret) { + /* If the screen indicated syncobj support, we should + * be able to create a signaled syncobj. + * At this point it is too late to pretend the screen + * has no syncobj support. + */ + return ret; + } + } + + return 0; } |