summaryrefslogtreecommitdiff
path: root/lib/sw_sync.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-03-25 13:05:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-03-25 13:11:10 +0000
commite77299156606f3f3bf5610586a6a0879bdffcf11 (patch)
treeb722e9e5971144f086cb5adb16be82ceab26bd4d /lib/sw_sync.c
parent2297766d8101661cd03749630aeb1c60cc615da1 (diff)
Replace more system("modprobe")
As we have libkmod available, it is faster and safer than calling system(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/sw_sync.c')
-rw-r--r--lib/sw_sync.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sw_sync.c b/lib/sw_sync.c
index 9dc6ec85..c05a7876 100644
--- a/lib/sw_sync.c
+++ b/lib/sw_sync.c
@@ -36,6 +36,7 @@
#include <sys/ioctl.h>
#include "igt_debugfs.h"
+#include "igt_kmod.h"
#include "sw_sync.h"
#include "drmtest.h"
#include "ioctl_wrappers.h"
@@ -248,11 +249,16 @@ int sync_fence_status(int fence)
return fence_info.status;
}
+static void modprobe(const char *driver)
+{
+ igt_kmod_load(driver, "");
+}
+
static bool kernel_has_sw_sync(void)
{
char buf[128];
- igt_ignore_warn(system("/sbin/modprobe -s r sw_sync"));
+ modprobe("sw_sync");
return kernel_sw_sync_path(buf, sizeof(buf));
}