summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-07-01 20:51:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-07-01 21:02:55 +0100
commit614895fec12a66376167c23294157a8f69014e54 (patch)
treedb3593705f89338f2e52891443c5487754887e49 /tests
parentb43070987e8b926e7b487e7717e8b58197fd03cf (diff)
igt/gem_exec_nop: Control boost/idle frequencies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_exec_nop.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index 3bfc9374..c8fff2be 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -179,6 +179,8 @@ static void set_min_freq(void)
int min = sysfs_read("gt_RPn_freq_mhz");
igt_require(min > 0);
igt_debug("Setting min/max to %dMHz\n", min);
+ (void)sysfs_write("gt_idle_freq_mhz", min);
+ (void)sysfs_write("gt_boost_freq_mhz", min);
igt_require(sysfs_write("gt_min_freq_mhz", min) == 0 &&
sysfs_write("gt_max_freq_mhz", min) == 0);
}
@@ -188,6 +190,8 @@ static void set_max_freq(void)
int max = sysfs_read("gt_RP0_freq_mhz");
igt_require(max > 0);
igt_debug("Setting min/max to %dMHz\n", max);
+ (void)sysfs_write("gt_idle_freq_mhz", max);
+ (void)sysfs_write("gt_boost_freq_mhz", max);
igt_require(sysfs_write("gt_max_freq_mhz", max) == 0 &&
sysfs_write("gt_min_freq_mhz", max) == 0);
}
@@ -203,7 +207,7 @@ igt_main
{ "-max", set_max_freq },
{ NULL, NULL },
}, *r;
- int min = -1, max = -1;
+ int min = -1, max = -1, boost = -1, idle = -1;
uint32_t handle = 0;
igt_fixture {
@@ -211,6 +215,8 @@ igt_main
min = sysfs_read("gt_min_freq_mhz");
max = sysfs_read("gt_max_freq_mhz");
+ boost = sysfs_read("gt_boost_freq_mhz");
+ idle = sysfs_read("gt_idle_freq_mhz");
handle = gem_create(device, 4096);
gem_write(device, handle, 0, batch, sizeof(batch));
@@ -239,6 +245,10 @@ igt_main
sysfs_write("gt_min_freq_mhz", min);
if (max > 0)
sysfs_write("gt_max_freq_mhz", max);
+ if (boost > 0)
+ sysfs_write("gt_boost_freq_mhz", boost);
+ if (idle > 0)
+ sysfs_write("gt_idle_freq_mhz", idle);
close(device);
}
}