summaryrefslogtreecommitdiff
path: root/lib/sw_sync.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-02-20 16:55:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-02-21 10:36:46 +0000
commit5d3062af9ed4780ff651bd9463b3355334cb74f7 (patch)
tree3944979d7353ec34de50e01cf7e4916f6d25e8a0 /lib/sw_sync.c
parent2660502e69b2539f49395c64bd32b65bd0189591 (diff)
sw_sync: Use fixed runtime for sync_expired_merge
Convert from using a fixed number of iterations (1 million), to using a fixed runtime so that we have predictable (and shorter!) run times across a wide variety of machines. As a bonus convert the other fixed iterations into a timeout. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com> #v1
Diffstat (limited to 'lib/sw_sync.c')
-rw-r--r--lib/sw_sync.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/sw_sync.c b/lib/sw_sync.c
index d671923c..e860a2c1 100644
--- a/lib/sw_sync.c
+++ b/lib/sw_sync.c
@@ -119,9 +119,23 @@ int sw_sync_timeline_create_fence(int fd, uint32_t seqno)
return fence;
}
+static int __sw_sync_timeline_inc(int fd, uint32_t count)
+{
+ int err;
+
+ err = 0;
+ if (igt_ioctl(fd, INT_SYNC_IOC_INC, &count)) {
+ err = -errno;
+ igt_assume(err);
+ }
+
+ errno = 0;
+ return err;
+}
+
void sw_sync_timeline_inc(int fd, uint32_t count)
{
- do_ioctl(fd, INT_SYNC_IOC_INC, &count);
+ igt_assert_eq(__sw_sync_timeline_inc(fd, count), 0);
}
int sync_fence_merge(int fd1, int fd2)