summaryrefslogtreecommitdiff
path: root/tests/pm_rps.c
AgeCommit message (Collapse)Author
2017-12-20igt/pm_rps: Always allocate spin[0]Chris Wilson
Avoid having to test for spin[0] existing by starting the load-loop with it allocated. v2: Preallocate the spin[1] as well for high load. References: https://bugs.freedesktop.org/show_bug.cgi?id=104060 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104318 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2017-12-08igt/pm_rps: Replace arbitrary HIGH_LOAD blit with a busyspinChris Wilson
Using a blit + sleep does not guarantee generating a high enough load to keep the GPU busy, a busyspin does. Replace the blit at high load with a continuous series spins and low load with a mix of spin and sleep. v2: Maintain a limited queue depth References: https://bugs.freedesktop.org/show_bug.cgi?id=104060 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2017-10-19tests/pm_rps: Move some test logic out of boost functionRadoslaw Szwichtenberg
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>
2017-09-12pm_rps: [RFC] RPS tests documentation updateKatarzyna Dec
Added comments in tricky places for better feature understanding. Added IGT_TEST_DESCRIPTION and short description for non-obvious subtests. Changed name of 'magic' checkit() function to something meaningfull. Changed junk struct and stuff array names. Made some minor coding style changes. Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off: Katarzyna Dec <katarzyna.dec@intel.com>
2017-09-08build: remove _GNU_SOURCE from source filesDaniel Vetter
We are, the build system takes care of that. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-07igt/gem_exec_schedule: Basic tests for preemptionChris Wilson
We queue N low priority hanging batches across the engines and check that our high priority write over takes them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-08-31pm_rps: Changes in waitboost scenarioKatarzyna Dec
CI is observing sporadical failures in pm_rps subtests. There are a couple of reasons. One of them is the fact that on gen6, gen7 and gen7.5, max frequency (as in the HW limit) is not set to RP0, but the value obtaind from PCODE (which may be different from RP0). Thus the test is operating under wrong assumptions (SOFTMAX == RP0 == BOOST which is simply not the case). Let's compare current frequency with BOOST frequency rather than SOFTMAX to get the test behaviour under control. In boost_freq function I set MAX freq to medium freqency, which ensures that we for sure reach BOOST frequency. This could help with failures with boost frequency failing to drop down. Additionally GPU reset needs to be modified so we are not dependent on kernel's low priority retire worker. Reset method was replaced by igt_force_gpu_reset() and in reset testcase we make sure that we can recover from hang. v2: Commit message, simplified waiting for boost to finish, drop noisy whitespace cleanup. v3: Removed reading from i915_rps_boost_info debugfs because it not the same on every kernel. Removed function waiting for boost. Instead of that I made sure we will reach in boost by setting MAX freq to fmid. v4: Moved proposal with making test drm master to other patch v5: Used igt_force_gpu_reset() to reset GPU. Modified "reset" testcase. v6: Comments changes and update. v7: Fixing typos v8: Fixing another typos in comments and commit msg Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jeff Mcgee <jeff.mcgee@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Jani Saarinen <jani.saarinen@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Acked-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
2017-06-21Revert "igt/pm_rps: Remove remaining assert on CUR <= MAX"Arkadiusz Hiler
This reverts commit ae8d240b4d742a51f99e7fbe428392041aec160b. This constrain still should be in effect, as noted by Michal Winiarski. There's no client boost in the scenario when the check happens, so CUR freq should never exceed the MAX. Cc: Jeff Mcgee <jeff.mcgee@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Michal Winiarski <michal.winiarski@intel.com>
2017-06-20igt/pm_rps: Remove remaining assert on CUR <= MAXJeff McGee
This completes the change started by: commit 39cccab83b7c515a2b57abe679a8cb304c8933ef Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri May 19 09:41:40 2017 +0100 igt/pm_rps: Allow CUR to be greater than MAX (overclocking) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2017-06-09tests/pm_rps: Replace custom load function with dummy loadRadoslaw Szwichtenberg
Replaced custom load implementation with lib counterpart. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-05-19igt/pm_rps: Allow CUR to be greater than MAX (overclocking)Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-05-18lib: Refactor testing for ability to use MI_STORE_DATA_IMMChris Wilson
Rather than have the code in multiple locations, put a copy in lib/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-01igt/pm_rps: Remove reliance on guessing the busy workloadChris Wilson
Create an unbounded batch in order to ensure that the workload doesn't disappear before the wait and so we should be given the RPS waitboost. References: https://bugs.freedesktop.org/show_bug.cgi?id=97564 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-12igt/pm_rps: Avoid inadvertent waitboostingChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-08tests/pm_rps: Increase timeouts to 15 secondsVille Syrjälä
My BSW takes ~12 seconds to go back to idle after high load, so the current 10s timeouts are too short. Bump them up to 15s. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-04-01igt/pm_rps: Trigger a real GPU resetChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-16tests/pm_rps: Fix assert for sysfs writesVille Syrjälä
fprintf() returns a negative value on error. Fix the assert to catch that. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-25lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT paramMichał Winiarski
No functional changes. While I'm here, let's also rename gem_uses_aliasing_ppgtt (since it's being used to indicate if we are using ANY kind of ppgtt) and introduce gem_uses_full_ppgtt to drop some unnecessary code from tests that were previously calling getparam directly instead of using ioctl wrapper. v2: drop gem_uses_full_48b_ppgtt since it's no longer used anywhere, s/48b/64b (Chris) v3: rebase Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-09igt/test/pm_rps: load GPU to force not-idle to idle transition.Bob Paauwe
When changing the sysfs GT min frequency, the kernel won't automatcilly drop the GT frequency to idle unless the GPU transitions from busy to idle. Load the GPU after increasing the GT min frequency to force a busy to idle transition. This matches the behavior when decreasing the GT min frequency. Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-12-04igt/pm_rps: current freq < user specified min is not a fail (v3)Bob Paauwe
Since commit commit aed242ff7ebb697e4dff912bd4dc7ec7192f7581 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Mar 18 09:48:21 2015 +0000 drm/i915: Relax RPS contraints to allows setting minfreq on idle it is now possible that the current frequency will drop be the user specified minimum frequency to the "idle" or RPn frequency. Update the pm_rps tests to reflect that droping below the user specified minimum is no longer considered a failure. v2: Add check RPn <= current freq. (Me) v3: Use RPn instead of MIN frequency in idle check (Imre) Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-23tests/pm_rps: add test descriptionsJesse Barnes
Document a copule of the subtests with their purpose, methods, and expected results. Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-03-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13lib/igt_gt: Document and consolidateDaniel Vetter
Also move forcewake and stop_rings code from igt_debugfs to igt_gt since it fits better. And move the hang injection fork helpers from igt_aux to igt_gt, too. Also push the intel_gen call into igt_hang_ring while at it. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-12-08tests/pm_rps: vlv: round middle point to freq supported by HWImre Deak
When setting the calculated middle frequency value the test assumes that the HW/kernel rounds this value according to a 50MHz step value. This is not so at least on VLV/CHV, on my B0 BYT-M for example this step value is 22MHz, so there the test will fail. To fix this get the nearest supported value by setting the target frequency as a min or max frequency and read it back. The kernel will round the returned value to the nearest supported. v2: - remove the 50MHz rounding that was done for non-VLV platforms, the new way of rounding should provide the correct value for all platforms (Ville) Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-12-08tests/pm_rps: vlv: load gpu for idle min/max testsImre Deak
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. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-12-08tests/pm_rps: vlv: wait for freq to settleImre Deak
At least on VLV when forcing a new GT frequency by writing to the min/max freq sysfs entries the kernel doesn't wait until the new frequency settles, so the subsequent readback check might fail. To fix this wait until the current frequency is between the min/max values using a 10ms timeout. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-09-16igt/pm_rps: Fix STORE_DWORD for pre-gen8Chris Wilson
gen8 actually changed the command layout, not just extended the relocation value. Oh well. References: https://bugs.freedesktop.org/show_bug.cgi?id=83915 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>