19 Commits

Author SHA1 Message Date
Daniel Vetter
3cd45dec2e lib/igt_gt: Document and consolidate
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-13 09:35:36 +01:00
Daniel Vetter
2eca38eab9 lib/igt_aux: s/swap/igt_swap/
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-02-13 09:35:36 +01:00
Rodrigo Vivi
3d65ff780d lib: s/IGT_DEBUG_INTERACTIVE/--interactive-debug=var
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-20 11:36:10 +01:00
Chris Wilson
a315476a6b igt/gem_evict_(alignment|everything): contend with GPU hangs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Thomas Wood
42b02c284e lib: add a function to lock memory into RAM
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-11 17:57:03 +00:00
Ville Syrjälä
1658edceee lib: Add swap() macro
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-12-08 19:26:39 +02:00
Daniel Vetter
a535cdedfb lib/os: Pust igt_require into memory check function
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-17 14:43:33 +01:00
Imre Deak
b35b1505f7 tests/pm_rpm: add gem-evict-pwrite subtest
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-11-14 00:18:30 +02:00
Mika Kuoppala
4f6a6cbdff lib: fix #define max
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-23 12:48:05 +03:00
Thomas Wood
be4710a541 lib: add common min and max macros
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:43 +01:00
Thomas Wood
6a8d33c2bb lib: add a function to indicate activity
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30 17:54:12 +01:00
Daniel Vetter
c49542af07 lib/igt_aux: Improve wait_for_keypress helper a bit
- 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-09-05 09:30:53 +02:00
Thomas Wood
d96490af99 lib: add missing includes to headers
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-16 20:11:57 +02:00
Chris Wilson
321273ff76 Factor in kernel object overhead when checking available memory for tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-28 09:05:57 +01:00
Daniel Vetter
bd521b493e lib/igt_aux: Extract runtime pm helpers from pm_pc8
I want to use them elsewhere ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 14:25:47 +02:00
Chris Wilson
ff7806e52c gem_tiled_swapping: Purge all page/swap caches first
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-07 13:12:29 +01:00
Chris Wilson
e8869c4bc4 gem_tiled_swapping: Limit to available memory
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-04-03 09:45:55 +01:00
Daniel Vetter
8221fda087 lib: s/igt_env_set/igt_check_boolean_env_var
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-23 14:38:17 +01:00
Daniel Vetter
f5daeec724 lib: extract igt_aux.[hc]
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>
2014-03-23 13:47:09 +01:00