summaryrefslogtreecommitdiff
path: root/tests/pm_rps.c
AgeCommit message (Collapse)Author
2014-09-12igt/pm_rps: Fix the batch count for emitting the flushChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81858#c2 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-30batch: Specify number of relocations to accommodateChris Wilson
Since relocations are variable size, depending upon generation, it is easier to handle the resizing of the batch request inside the BEGIN_BATCH macro. This still leaves us with having to resize commands in a few places - which still need adaption for gen8+. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29igt: Prettify igt_assert_eq() failure messagesChris Wilson
This just improves the language about the exact failure to reduce confusion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-27igt/pm_rps: Fix assertion in load_helper_stopChris Wilson
The load_helper isn't killed by the signal, but it exits gracefully. So update the assertion to check for the successful exit. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-25intel-gpu-tools: add sys/wait.h to pm_rps.cTim Gore
commit 745945546f7366a413a3a51a37f90caa3a227b1d breaks the build under Android because some of the macros used in pm_rps.c are defined in sys/wait.h which is not included. Signed-off-by: Tim Gore <tim.gore@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-24igt_core: Refactor igt_stop_helper() to use igt_wait_helper()Chris Wilson
Reduce code duplication as the igt_stop_helper can reuse igt_wait_helper() to replace its own waiting routine. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-23tests: remove unused getopt header includesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-04-10tests: use lib igt_[get|set]_stop_rings()Mika Kuoppala
on gem_reset_stats, kms_flip and pm_rps. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75876 Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-03-26tests/pm_rps: Add a new testcase to provoke the "stuck at max" bugDaniel Vetter
Note that the sleep(5); to fully idle the gpu is _really_ important. Without it the bug is not exhibited. The issue at hand is that after gem_quiescent_gpu we are at max (expected, since the blocking waits peg to max), but then we never go down to a lower freq again until we're fully idle. The tiny load is sufficient to keep the gpu at max. I've played around with this a bit and even ridiculously low loads (like one MI_STORE per 50ms) are enough to keep the gpu at max freq. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26tests/pm_rps: quiescent harderDaniel Vetter
Apparently some rps chips are prone to stick to max once you're there. And all the synchronous waits in gem_quiescent_gpu are _really_ good at forcing the kernel to go full throttle. And even a positively tiny load (one MI_STORE_IMM per 50 ms) is enough to eternally keeep it there, which means the first idle measurement of the freqs before we do the reset it completely busted. Just add a wait before the tricky test and call it a day. Option b) would have been to now have this tiny load, but I think a good reminder how quirky rps is is always welcome. Just in case we start sleeping too easy at night. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74956 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23tests/pm_rps: fixup the blt copy load helper changesDaniel Vetter
All suggested by Jeff McGee. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: rename intel_gpu_tools.h to intel_io.hDaniel Vetter
With the header cleanup we can now give this header a suitable name, since it now really only contains register access and other I/O functions and assorted definitions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 2Daniel Vetter
I've left unistd.h in it - it's not strictly required but most users of drmtest.h want it for the open helpers, and then you kinda need to close that file descriptor again ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 1Daniel Vetter
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22tests|lib: remove assert.h includesDaniel Vetter
Only the igt core and non-test tools should have asserts to catch internal errors, tests and helper libraries should all user igt_asert instead. Fix things up where assert instead of igt_assert was used. One tiny step towards header sanity. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17lib/igt_debugfs: Remove debugfs from igt_debugfs_openDaniel Vetter
Also update the api docs a bit since the Returns: section was missing. v2: Readd the accidentally lost line for @filename. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-14tests/pm_rps: wait longer for idlingDaniel Vetter
Big cores seem to take forever to idle, at least my ivb here. Fairly ridiculous, so maybe there's more room for our debooster to kick in. Anyway, this gets the min-max-config-idle and reset subtests going somewhat reliably on my ivb. They still occasionally fail with the current frequency pegged to max (or close to it) for no apparent reason at all. Rebooting tends to fix it. Don't ask, don't tell. Cc: Jeff McGee <jeff.mcgee@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-14tests/pm_rps: use igt_assert_cmpintDaniel Vetter
Much better debug output almost for free. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-14tests/pm_rps: load harderDaniel Vetter
Big core platforms need some seriuos omph to break a sweat. This fixes min-max-config-loaded here on my ivb. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75146 Cc: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-14tests/pm_rps: simplify load helper setupDaniel Vetter
There's no need to be fancy here. Cc: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-14tests/pm_rps: ducttape for igt fork helper cleanup issuesDaniel Vetter
We don't call cleanup handlers when exiting a subtest currently, only when exiting the entire binary. Which means pm_rps falls over when it fails more than one subtest. Cc: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-13test/pm_rps: use igt loggingDaniel Vetter
Cc: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-07tests/pm_rps: remove setfreqDaniel Vetter
It's unused. Cc: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-07tests/pm_rps: Round requested freq correctlyDaniel Vetter
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>
2014-02-06tests/pm_rps: Fix compilation on LinuxDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06pm_rps: New subtest for gpu resetJeff McGee
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>
2014-02-06pm_rps: Add variable load support to load helperJeff McGee
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>
2014-02-06pm_rps: Load helper should stall for last writeJeff McGee
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>
2014-02-06pm_rps: Add stop rings injection utilityJeff McGee
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06pm_rps: New subtest min-max-config-loadedJeff McGee
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>
2014-02-06pm_rps: Add load helper for loading gpuJeff McGee
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>
2014-02-06pm_rps: New subtest min-max-config-idleJeff McGee
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>
2014-01-27tests/pm_rps: rename basic test to "basic-api"Daniel Vetter
Jeff plans to add more tests ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-27pm_rps: Make frequency logging more compactJeff McGee
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-27pm_rps: Remove repeat sysfs readsJeff McGee
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>
2014-01-27pm_rps: Expand on min and max config testingJeff McGee
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>
2014-01-19tests/pm_rps: Add missing staticDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-18pm_rps: Fix verbose option and streamline its useJeff McGee
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-18pm_rps: Convert to subtest structureJeff McGee
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-18pm_rps: Add read back checking on sysfs writesJeff McGee
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-10pm_rps: Use igt exit handler for restoreJeff McGee
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-10pm_rps: Fix test to target original min and maxJeff McGee
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>
2014-01-10pm_rps: Assert that valid sysfs writes return successJeff McGee
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>
2014-01-10pm_rps: Use unbuffered I/O on sysfs filesJeff McGee
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>
2013-12-10tests: roll out igt_simple_init/igt_simple_mainDaniel Vetter
Also use igt_skip a bit more to simplify some of the tests. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04tests: establish pm_ prefixDaniel Vetter
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>