[igt-dev] [PATCH i-g-t] i915/perf: Ensure i915.ko is loaded before requiring its procfs files

Petri Latvala petri.latvala at intel.com
Wed Aug 19 13:41:18 UTC 2020


If for example i915_module_load is executed before this test, i915.ko
is not loaded and /proc/sys/dev/i915/perf_stream_paranoid naturally
does not exist. Ensure the module is loaded by briefly opening
DRIVER_INTEL.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
 tests/i915/perf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index 92edc9f1..c43ef496 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -4902,6 +4902,9 @@ igt_main
 	igt_fixture {
 		struct stat sb;
 
+		/* Ensure i915.ko is loaded */
+		close(__drm_open_driver(DRIVER_INTEL));
+
 		igt_require(stat("/proc/sys/dev/i915/perf_stream_paranoid", &sb)
 			    == 0);
 		igt_require(stat("/proc/sys/dev/i915/oa_max_sample_rate", &sb)
-- 
2.20.1



More information about the igt-dev mailing list