From e77299156606f3f3bf5610586a6a0879bdffcf11 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 25 Mar 2017 13:05:38 +0000 Subject: Replace more system("modprobe") As we have libkmod available, it is faster and safer than calling system(). Signed-off-by: Chris Wilson --- lib/sw_sync.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/sw_sync.c') 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 #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)); } -- cgit v1.2.3