summaryrefslogtreecommitdiff
path: root/lib/sw_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sw_sync.c')
-rw-r--r--lib/sw_sync.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/sw_sync.c b/lib/sw_sync.c
index aa8feefe..276dc795 100644
--- a/lib/sw_sync.c
+++ b/lib/sw_sync.c
@@ -212,3 +212,17 @@ int sync_fence_count_status(int fd, int status)
return count;
}
+
+static bool kernel_has_sw_sync(void)
+{
+ char buf[128];
+
+ igt_ignore_warn(system("/sbin/modprobe -s r sw_sync"));
+
+ return kernel_sw_sync_path(buf, sizeof(buf));
+}
+
+void igt_require_sw_sync(void)
+{
+ igt_require(kernel_has_sw_sync());
+}