[igt-dev] [PATCH i-g-t] i915/perf: Make sure i915 loaded properly

Nirmoy Das nirmoy.das at intel.com
Wed Jul 13 18:16:37 UTC 2022


Previous test may leave incomplete i915 state.
make this more resilient my unload and reloading i915.

Reference: https://gitlab.freedesktop.org/drm/intel/-/issues/5608
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
 tests/i915/perf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index e641d5d2d..9c36aac34 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -41,8 +41,8 @@
 #include "i915/gem.h"
 #include "i915/perf.h"
 #include "igt.h"
+#include "igt_kmod.h"
 #include "igt_sysfs.h"
-#include "drm.h"
 
 IGT_TEST_DESCRIPTION("Test the i915 perf metrics streaming interface");
 
@@ -4916,7 +4916,8 @@ igt_main
 		 * loading/unloading i915. Load i915 here before we stat the
 		 * files.
 		 */
-		drm_load_module(DRIVER_INTEL);
+		igt_i915_driver_unload();
+		igt_assert_eq(igt_i915_driver_load(NULL), 0);
 
 		igt_require(stat("/proc/sys/dev/i915/perf_stream_paranoid", &sb)
 			    == 0);
-- 
2.35.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



More information about the igt-dev mailing list