The kernel will round it, so if we don't we'll have a spurious
mismatch. Happens on my machine here with 650-1300MHz range, where the
midpoint is 975.
Cc: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Test that RPS functions as expected after a gpu reset.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The load helper can be set to HIGH or LOW. HIGH is the original mode
of sending continuous dword store commands. LOW adds a pause between
each command to reduce throughput.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This ensures that gpu is quiescent when load helper exits.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Like subtest basic-api, but additionally requires that current
frequency is increasing to the configured maximum within reasonable
time since we are loaded.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The load helper submits repeated dword store commands to keep the
gpu loaded while subtests running in the parent process check for
expected rps response.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Like subtest basic-api, but additionally requires that current
frequency is settling to the configured minimum within reasonable
time since we are idle.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Storing values avoids some unnecessary overhead but more importantly
allows all of our processing to be atomic.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Add a function that methodically varies min and max to exercise
several valid and invalid combinations. Allow the caller to
define what is to be checked between each step.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The goal of the test is to confirm that gt_cur_freq_mhz can be forced
to the boundaries of the frequency range by collapsing gt_min_freq_mhz
and gt_max_freq_mhz to the target value. But we miss testing the upper
end of the range by targetting the current value of max after it has
been set equal to min. So fix by targetting orginal max instead of
current max.
This correction exposes a problem in setfreq where min is always set
to target before max, which should fail if the target value is greater
than max. So fix that too.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
do_writeval now always checks the return value, whether we expect
success or a specific error. Also add new macro writeval_inval to
simplify repeated use of do_writeval to test for EINVAL return code.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Bionic C library may not re-read a buffered, read-only file which
results in failure to monitor changes in gt_cur_freq_mhz.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Imo power management, power consumption and performance are tightly
enough coupled that we can throw them all into one bin.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>