[Intel-gfx] [PATCH 2/3] tests/pm_rps: vlv: load gpu for idle min/max tests

Imre Deak imre.deak at intel.com
Thu Dec 4 08:09:39 PST 2014


When changing the sysfs GT min/max frequencies, the kernel won't
explicitly change the current frequency, unless it becomes out of bound
based on the new min/max values. The test happens to work on non-VLV
platforms because on those the kernel resets the current frequency
unconditionally (to adjust the RPS interrupt mask as a side-effect) and
that will lead to an RPS interrupt setting the minimum frequency.

To fix this load the GPU after decreasing the min frequency and before
checking the current frequency. This should set the current frequency to
the minimum.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 tests/pm_rps.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 9ed2125..1fd5995 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -335,7 +335,14 @@ static void load_helper_deinit(void)
 		drm_intel_bufmgr_destroy(lh.bufmgr);
 }
 
-static void min_max_config(void (*check)(void))
+static void do_load_gpu(void)
+{
+	load_helper_run(LOW);
+	nsleep(10000000);
+	load_helper_stop();
+}
+
+static void min_max_config(void (*check)(void), bool load_gpu)
 {
 	int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2;
 
@@ -343,11 +350,15 @@ static void min_max_config(void (*check)(void))
 	fmid = fmid / 50 * 50;
 
 	igt_debug("\nCheck original min and max...\n");
+	if (load_gpu)
+		do_load_gpu();
 	check();
 
 	igt_debug("\nSet min=RPn and max=RP0...\n");
 	writeval(stuff[MIN].filp, origfreqs[RPn]);
 	writeval(stuff[MAX].filp, origfreqs[RP0]);
+	if (load_gpu)
+		do_load_gpu();
 	check();
 
 	igt_debug("\nIncrease min to midpoint...\n");
@@ -368,10 +379,14 @@ static void min_max_config(void (*check)(void))
 
 	igt_debug("\nDecrease min to midpoint...\n");
 	writeval(stuff[MIN].filp, fmid);
+	if (load_gpu)
+		do_load_gpu();
 	check();
 
 	igt_debug("\nDecrease min to RPn...\n");
 	writeval(stuff[MIN].filp, origfreqs[RPn]);
+	if (load_gpu)
+		do_load_gpu();
 	check();
 
 	igt_debug("\nDecrease min below RPn (invalid)...\n");
@@ -605,14 +620,14 @@ igt_main
 	}
 
 	igt_subtest("basic-api")
-		min_max_config(basic_check);
+		min_max_config(basic_check, false);
 
 	igt_subtest("min-max-config-idle")
-		min_max_config(idle_check);
+		min_max_config(idle_check, true);
 
 	igt_subtest("min-max-config-loaded") {
 		load_helper_run(HIGH);
-		min_max_config(loaded_check);
+		min_max_config(loaded_check, false);
 		load_helper_stop();
 	}
 
-- 
1.8.4




More information about the Intel-gfx mailing list