summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_job.c
diff options
context:
space:
mode:
authorStefan Schake <[email protected]>2018-04-25 00:01:00 +0200
committerEric Anholt <[email protected]>2018-05-17 16:04:30 +0100
commitb0acc3a5628c6c6dd669cbb7cff2d974b175605e (patch)
treeef0d04117ae2f56fc3c891e4baf1cb93974af265 /src/gallium/drivers/vc4/vc4_job.c
parent44036c354d800dda08d3688b042130039f3d592a (diff)
broadcom/vc4: Native fence fd support
With the syncobj support in place, lets use it to implement the EGL_ANDROID_native_fence_sync extension. This mostly follows previous implementations in freedreno and etnaviv. v2: Drop the flags (Eric) Handle in_fence_fd already in job_submit (Eric) Drop extra vc4_fence_context_init (Eric) Dup fds with CLOEXEC (Eric) Mention exact extension name (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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_job.c b/src/gallium/drivers/vc4/vc4_job.c
index 3b0ba8b69cf..72569765847 100644
--- a/src/gallium/drivers/vc4/vc4_job.c
+++ b/src/gallium/drivers/vc4/vc4_job.c
@@ -477,9 +477,19 @@ vc4_job_submit(struct vc4_context *vc4, struct vc4_job *job)
}
submit.flags |= job->flags;
- if (vc4->screen->has_syncobj)
+ if (vc4->screen->has_syncobj) {
submit.out_sync = vc4->job_syncobj;
+ if (vc4->in_fence_fd >= 0) {
+ /* This replaces the fence in the syncobj. */
+ drmSyncobjImportSyncFile(vc4->fd, vc4->in_syncobj,
+ vc4->in_fence_fd);
+ submit.in_sync = vc4->in_syncobj;
+ close(vc4->in_fence_fd);
+ vc4->in_fence_fd = -1;
+ }
+ }
+
if (!(vc4_debug & VC4_DEBUG_NORAST)) {
int ret;