summaryrefslogtreecommitdiff
path: root/lib/sw_sync.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-17 12:36:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-12-17 15:03:41 +0000
commit70f0700e60d66f8b25e33c8f5efe57cb3d4eb534 (patch)
tree6f08124954aaf28c9bc93b248c2b86fcdc61d6ec /lib/sw_sync.c
parent20fffe7e4209220c63ec45e9b459224833831989 (diff)
lib/sw_sync: Indicate that sync_merge() operates and create a sync_fence
Improvements to self-documentating API that matches the rest of sw_sync. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/sw_sync.c')
-rw-r--r--lib/sw_sync.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/sw_sync.c b/lib/sw_sync.c
index 8d8e11b1..4977ef17 100644
--- a/lib/sw_sync.c
+++ b/lib/sw_sync.c
@@ -152,15 +152,11 @@ void sw_sync_timeline_inc(int fd, uint32_t count)
do_ioctl(fd, INT_SYNC_IOC_INC, &count);
}
-int sync_merge(int fd1, int fd2)
+int sync_fence_merge(int fd1, int fd2)
{
- struct local_sync_merge_data data = {};
- int err;
+ struct local_sync_merge_data data = { .fd2 = fd2};
- data.fd2 = fd2;
-
- err = ioctl(fd1, LOCAL_SYNC_IOC_MERGE, &data);
- if (err < 0)
+ if (ioctl(fd1, LOCAL_SYNC_IOC_MERGE, &data))
return -errno;
return data.fence;