summaryrefslogtreecommitdiff
path: root/lib/igt_aux.h
AgeCommit message (Collapse)Author
2016-05-12lib/igt_aux: Polish docs for igt_timeoutDaniel Vetter
Add docs, rename parameter and rename the macro to igt_do_timeout to make it clear it works like a loop. v2: Rename instead to igt_until_timeout (Chris). Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-05-12lib/igt_aux: Polish docs for igt_interruptibleDaniel Vetter
- Give __ prefix to internal funcstion and structs, only igt_interruptible is used by tests. - Move docs to igt_interruptible and adjust. - Explain more clearly how the timeout is getting doubled each iteration until no more interruptions happen. Also rename the argument to give it a more meaningful name in the docs. - Link from other functions to this one for cross-referencing. - Rename to igt_do_interruptible to make it clearer it's a loop, inspired by do {} while () loops. v2: Rename instead to igt_while_interruptible and fix typos (Chris). And add gtk-doc for igt_ioctl, too. Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-04-20igt/gem_close_race: BatifyChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-24lib: Add a GPU error detectorChris Wilson
If we listen to the uevents from the kernel, we can detect when the GPU hangs. This requires us to fork a helper process to do so and send a signal back to the parent. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19igt/gem_concurrent_blit: dmabuf requires twice the number of filesChris Wilson
In order to keep the dmabuf mmap around whilst we keep the object alive, we need a file descriptor for each. Check that the VFS supports that many fd. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19lib/igt_aux: Divert ioctls for signal injectionChris Wilson
To simplify and speed up running interruptible tests, use a custom ioctl() function that control the signaling and detect when we need no more iterations to trigger an interruption. We use a realtime timer to inject the signal after a certain delay, increasing the delay on every loop to try and exercise different code paths within the function. The first delay is very short such that we hopefully enter the kernel with a pending signal. Clients should use struct igt_sigiter iter = {}; while (igt_sigiter_repeat(&iter, enable_interrupts=true)) do_test() to automatically repeat the test until we can inject no more signals into the ioctls. This is condensed into a macro igt_interruptible(enable_interrupts=true) do_test(); for convenience. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22lib: Print memory requirements as MiBChris Wilson
Since we need a lot of memory, trim off the less significant digits for easier human consumption. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19gem_concurrent_blit: Don't call igt_require() outside of a subtest/fixtureChris Wilson
gem_concurrent_blit tries to ensure that it doesn't try and run a test that would grind the system to a halt, i.e. unexpectedly cause swap thrashing. It currently calls intel_require_memory(), but outside of the subtest (as the tests use fork, it cannot do requirement testing within the test children) - but intel_require_memory() calls igt_require() and triggers and abort. Wrapping that initial require within an igt_fixture() stops the abort(), but also prevents any further testing. This patch restructures the requirement checking to ordinary conditions, which though allowing the test to run, also prevents listing of subtests on machines which cannot handle them.
2015-08-14lib: Allow caller to use uint64_t sizes with intel_require_memory()Chris Wilson
Allow the caller to ask how many extra large objects can be created and still fit into memory. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-02aux: Don't evaluate several times the arguments of min() and max()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-11lib/igt_aux: add functions to manipulate i915.ko parametersPaulo Zanoni
Some i915.ko features have very nice IGT tests, which are never executed because the features are disabled by default. This leads to unnoticed regressions both in the Kernel and in the IGT tests. We have seen this multiple times, for example, on FBC and PSR. We want to be able to run IGT and actually test these disabled-by-default features in order to make sure we at least don't break them even more. Sometimes they may be disabled for some specific reason, and we don't want to increase the set of reasons without noticing. To help solving this problem, this commit adds some helper functions that should make it easier to change certain i915.ko parameters and then restore their original values at the end of the test. With this, I'm hoping QA will be able to detect any regressions and automatically bisect them - or, with PRTS, reject the patches before they are even merged. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-05lib: add igt_wait()Paulo Zanoni
Just a little helper for code that needs to wait for a certain condition to happen. It has the nice advantage that it can survive the signal helper. Despite the callers added in this patch, there is another that will go in a separate patch, and another in a new IGT test file that I plan to push later. v2: Check COND again before returning in case we hit the timeout. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-04-16lib/igt_aux: Introduce igt_interactive_debug_manual_check.Rodrigo Vivi
This is an extention of igt_debug_wait_for_keypress that also can have customized message and return key pressed. v2: This is actualy a v2. V1 was an extension of original igt_debug_wait_for_keypress but it was nacked. v3: Make [Y/n] check inside aux function as suggested by Daniel. Also renaming and adding first use case along with the axu function. v4: Simplify function name and make it assert pressed key is different from n/N as suggested by Daniel. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-02-24tests/drv_suspend: hibernation testDavid Weinehall
intel-gpu-tools currently has a bunch of tests for suspend, but currently none (that I could find) for hibernate. Attached is a rudimentary patch to add said test. It does so by repurposing the drv_suspend driver to handle both suspend and hibernate, since the difference is miniscule. I decided to split the suspend/autoresume functions in igt_aux.c though, to be able to leave the igt_system_uspend_autoresume() function unchanged (the other option would be to introduce a boolean function argument and have that decide what parameters to pass to rtcwake). The timeout passed to rtcwake probably needs tuning (it might even need to be dynamically adjusted, since the time hibernation takes varies wildly depending on the amount of non-cache memory in use). Signed-off-by: David Weinehall <david.weinehall@intel.com> Reviewed-by: Imre Deak <imre.deak@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>
2015-02-13lib/igt_aux: s/swap/igt_swap/Daniel Vetter
It collides with the subtest naming convention glossary entry for swap. Which makes the docbook xml stuff unhappy. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-20lib: s/IGT_DEBUG_INTERACTIVE/--interactive-debug=varRodrigo Vivi
Use cmdline variable for interactive debug instead of env var. v2: Make interactive-debug domain optional and use "all" when not set. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-07igt/gem_evict_(alignment|everything): contend with GPU hangsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-11lib: add a function to lock memory into RAMThomas Wood
Add a function to lock memory into RAM and use it in the gem_tiled_swapping test to reduce the amount of allocated memory required to force swapping. This also reduces the amount of time required for the test to complete, since the data set is smaller. The following durations were recorded with gem_tiled_swapping on a haswell system before the change: Subtest non-threaded: SUCCESS (55.889s) Subtest threaded: SUCCESS (810.532s) and after: Subtest non-threaded: SUCCESS (11.804s) Subtest threaded: SUCCESS (268.336s) v2: add various assertions and requirements and make sure gem_tiled_swapping works on systems with less RAM (Daniel Vetter) v3: fix allocation size calculation Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-08lib: Add swap() macroVille Syrjälä
swap() will swap its two arguments while keeping the required tmp variable hidden. Makes for neater code. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-17lib/os: Pust igt_require into memory check functionDaniel Vetter
More in line with the usual igt pattern and simplifies the code - every called just wrapped it in igt_require. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-14tests/pm_rpm: add gem-evict-pwrite subtestImre Deak
This triggers a device suspended WARN in the kernel in gen6_ggtt_insert_entries() while calling the GEM pwrite ioctl. The sequence is suggested by Daniel. Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-23lib: fix #define maxMika Kuoppala
Regression from: commit be4710a541b517b5f8663448bffed5656d59b47b Author: Thomas Wood <thomas.wood@intel.com> Date: Fri Oct 10 11:20:35 2014 +0100 lib: add common min and max macros Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85218 Tested-by: Guo Jinxian <jinxianx.guo@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-17lib: add common min and max macrosThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30lib: add a function to indicate activityThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05lib/igt_aux: Improve wait_for_keypress helper a bitDaniel Vetter
- Use keys in just one env variable to enable/disable it. - Add an informational message so that the users knows when to press the key (more useful over ssh than when run on the terminal ofc). - Improve the documentation so that it's clearer how to use this when running tests. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-16lib: add missing includes to headersThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-28Factor in kernel object overhead when checking available memory for testsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-15lib/igt_aux: Extract runtime pm helpers from pm_pc8Daniel Vetter
I want to use them elsewhere ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-07gem_tiled_swapping: Purge all page/swap caches firstChris Wilson
Reset the system to a vanilla state before we query how much RAM/swap space is available for our testing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-03gem_tiled_swapping: Limit to available memoryChris Wilson
If there is not enough free RAM+swap for us to execute our test, we will hit OOM, so check first. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-23lib: s/igt_env_set/igt_check_boolean_env_varDaniel Vetter
So I wasn't really happy with env_set since it's way too close to setenv(), whic actually _sets_ and environment variable. So use check instead of set as the verb (well adjective for env_set). Also sprinkle in some hints that we talk about a boolean setting here. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23lib: extract igt_aux.[hc]Daniel Vetter
And shovel all the various helpers in there. Also move igt_set_vt_graphics_mode to igt_kms.h since the function is implemented in igt_kms.c. And it fits better. I kinda missed this in the prep work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>