summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRadoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>2017-10-18 17:20:47 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-10-19 10:24:37 +0300
commit04d4d6f10ec76f7efe459dc96b1f6d91634a79eb (patch)
tree7c3476554ef04164e7736cfa41bd0c065d501e46 /tests
parente2ee529bb96320da0968ae52d318883106f3fa55 (diff)
tests/pm_rps: Move some test logic out of boost function
Moving code out of the boost function will allow its usage in other/new test scenarios. Signed-off-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/pm_rps.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 89f3e31c..cc94813e 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -583,11 +583,6 @@ static void boost_freq(int fd, int *boost_freqs)
int64_t timeout = 1;
igt_spin_t *load;
unsigned int engine;
- int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2;
-
- fmid = get_hw_rounded_freq(fmid);
- /* Set max freq to less then boost freq */
- writeval(sysfs_files[MAX].filp, fmid);
/* Put boost on the same engine as low load */
engine = I915_EXEC_RENDER;
@@ -604,9 +599,6 @@ static void boost_freq(int fd, int *boost_freqs)
igt_spin_batch_end(load);
gem_sync(fd, load->handle);
igt_spin_batch_free(fd, load);
-
- /* Set max freq to original softmax */
- writeval(sysfs_files[MAX].filp, origfreqs[MAX]);
}
static void waitboost(int fd, bool reset)
@@ -614,6 +606,8 @@ static void waitboost(int fd, bool reset)
int pre_freqs[NUMFREQ];
int boost_freqs[NUMFREQ];
int post_freqs[NUMFREQ];
+ int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2;
+ fmid = get_hw_rounded_freq(fmid);
load_helper_run(LOW);
@@ -627,11 +621,17 @@ static void waitboost(int fd, bool reset)
sleep(1);
}
+ /* Set max freq to less than boost freq */
+ writeval(sysfs_files[MAX].filp, fmid);
+
/* When we wait upon the GPU, we want to temporarily boost it
* to maximum.
*/
boost_freq(fd, boost_freqs);
+ /* Set max freq to original softmax */
+ writeval(sysfs_files[MAX].filp, origfreqs[MAX]);
+
igt_debug("Apply low load again...\n");
sleep(1);
stabilize_check(post_freqs);
@@ -643,7 +643,6 @@ static void waitboost(int fd, bool reset)
igt_assert_lt(pre_freqs[CUR], pre_freqs[MAX]);
igt_assert_eq(boost_freqs[CUR], boost_freqs[BOOST]);
igt_assert_lt(post_freqs[CUR], post_freqs[MAX]);
-
}
static void pm_rps_exit_handler(int sig)