4317 Commits

Author SHA1 Message Date
Chris Wilson
d081953e67 igt/pm_rps: Trigger a real GPU reset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 20:09:34 +01:00
Chris Wilson
3dd5fe8ab2 igt/gem_exec_reloc: Exercise read-only relocation arrays
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 20:07:55 +01:00
Chris Wilson
aec81019e1 igt/gem_busy: Try to slow down execution
With lockdep enabled, the driver overhead is enormous and we need to
slow down the GPU to compenstate (otherwise the GPU is already idle when
we expect busyness). So do more work per batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 17:05:20 +01:00
Chris Wilson
92ee3cc1f6 igt/gem_busy: Cap number of tries to create busy rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 14:59:43 +01:00
Chris Wilson
0f5b03fa38 igt/gem_busy: Use a boatload of store-dwords to force ring busyness
A little more inelegant as we can't control the delay very well, but it
should prove more vesatile and broaden the test coverge (and still be
quick enough for basic).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 13:21:56 +01:00
Chris Wilson
c89e8dbfd8 lib: Ignore udev failure to report an event
Fixes gem_exec_suspend complaining that the hang detector spontaneously
combusts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 17:22:41 +01:00
Chris Wilson
2b804c33e7 lib: Tidy error message for a helper process who unexpectedly dies
Transform

gem_exec_suspend: igt_core.c:1429: igt_stop_helper: Assertion `(((signed char) ((((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) + 1) >> 1) > 0) && (((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) == (proc->use_SIGKILL ? 9 : 15)' failed.

into

(gem_exec_suspend:16589) igt-core-DEBUG: Helper died too early with status=0
gem_exec_suspend: igt_core.c:1437: igt_stop_helper: Assertion `helper_was_alive(proc, status)' failed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 17:22:41 +01:00
Chris Wilson
0bd117fa66 igt/gem_exec_suspend: Add basic selftest
The selftest is already before the suspend/hibernate tests, but to be
clear also run it first (it only takes a millisecond) by itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 13:53:22 +01:00
Chris Wilson
e56de3c900 igt/gem_exec_store: Exercise write ordering
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 11:20:22 +01:00
Chris Wilson
41a26b5152 igt/gem_exec_nop: Relax parallel assertion for short rings
On bdw, the render ring becomes full and limits dispatch across all rings.
Adjust the expected latency to take this into account.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-28 16:27:24 +01:00
Chris Wilson
870c774b86 igt/gem_exec_nop: Add expectancy of independent execution between engines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-28 15:41:08 +01:00
Chris Wilson
633854e8f4 igt/gem_ctx_switch: Add basic test for context switching
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-26 11:22:04 +00:00
Chris Wilson
1a722fa6cf igt/gem_exec_whisper: Add simple interruptible pass
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-26 11:22:04 +00:00
Chris Wilson
5dcb026348 igt/gem_exec_whisper: Check for inconsistent reloc offset vs object offset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-26 10:02:41 +00:00
Chris Wilson
3fd9b910d2 igt/gem_sync: Add a basic test to wait upon a batch on all rings
Execute the batch concurrently on all rings and then wait (as opposed to
executing a different batch on each engine).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-25 20:29:09 +00:00
Chris Wilson
9d61a685e9 igt/gem: Add GPU hang detection to basic tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-25 18:26:46 +00:00
Chris Wilson
98dcf2f0dc igt/gem_concurrent_blit: Relax maxfiles restrictions
Only fail the dmabuf tests if we cannot prep the system to support
"unlimited" fd.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-25 18:23:56 +00:00
Chris Wilson
4e2a785e24 benchmarks/gem_exec_nop: Include a measurement across all rings
For sync, it really is just the average latency across all rings, but
for continuous we can expect to see the effect of concurrent dispatch
across rings. Hopefully.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-24 11:25:38 +00:00
Chris Wilson
6867b87b73 igt/gem_concurrent_blit: Enable hang detection
When we aren't deliberately injecting hangs, we don't expect to see any
GPU hang. Detect them and fail early.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-24 11:25:38 +00:00
Chris Wilson
756f3e0cb7 lib: Add a GPU error detector
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-24 11:25:38 +00:00
Chris Wilson
eb572106b4 igt/gem_shrink: Consume all of total ram in each process
"Leak" the objects from each test until each process has allocated
enough objects to consume all of RAM.

Doing so from each process not only ensures we do stress the allocation
paths, but also obsoletes the separate purgeable helper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-23 11:11:43 +00:00
Chris Wilson
a9436e6693 igt/gem_shrink: Include a shrinker vs GPU hang
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-23 09:54:22 +00:00
Chris Wilson
54ec3782dc tests: Add gem_shrink
This test exercise purely to exercise the shrinker under some common
stress (i.e. paths leading to i915_gem_object_get_pages()). We try to
fill the entirely of memory split amongst many processes so that each
individual process only consumes a small fraction of RAM (less than the
mappable aperture) and a single process should not be individually
blamed.

Based on an idea to have a seperate set of memory stress tests by Piotr
Luc.

Cc: Piotr Luc <piotr.luc@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-23 09:41:54 +00:00
Lionel Landwerlin
7fc5256f56 test/kms_pipe_color: add test to verify legacy ioctl resets GAMMA_LUT
The GAMMA_LUT/DEGAMMA_LUT/CTM properties must be updated when the
legacy ioctl is triggered to ensure the new properties do not impact
older userspace code.

v2: Add checks verifying the content of CTM & DEGAMMA_LUT properties

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:48:11 -07:00
Lionel Landwerlin
aa55641d4f tests/kms_color: New test for pipe level color management
This test enables testing of :

     * degamma LUTs
     * csc matrix
     * gamma LUTs
     * legacy gamma LUTs

v2: turn assert into require to skip on platform not supporting color
    management

v3: add invalid blob ids tests

v4: Try to match CRC results against several values around the
    expected result for platforms with odd LUT items

v5: Fix running tests with multiple screens

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:47:54 -07:00
Lionel Landwerlin
c7e9be2302 lib: add crc comparison function without an assert
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:47:22 -07:00
Lionel Landwerlin
a511310244 lib: fb: add igt_paint_color_gradient_range
This is a helper to draw a gradient between 2 colors.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:47:04 -07:00
Lionel Landwerlin
1716625e1e lib: kms: add helpers for color management properties on pipes
v2: Rename CTM_MATRIX property to CTM

v3: Add support for atomic commits

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:46:18 -07:00
Lionel Landwerlin
59b5487625 lib: kms: add crtc_id to igt_pipe_t
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:45:45 -07:00
Chris Wilson
8520037e54 lib: Measure the cost of calling timer_settimer() for sigiter
We wish to delay the first signal from the igt_sigiter_ioctl
sufficiently to skip over the timer_settime() and into the drmIoctl
kernel context before firing. If we fire too early, we will think that
the ioctl doesn't respond to signals and ignore it in future. If we fire
too late, we won't probe the ioctl for signal handling at all. Let's try
measuring the timer_settime() call time as a first approximation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 16:26:04 +00:00
Chris Wilson
f1a3d0d96f igt/gem_ringfill: Fix basic- reversal
Rushed flipping around the logic to add basic- and forgot to apply the
corrected patch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 14:40:51 +00:00
Chris Wilson
87a4d8ab64 igt/gem_ringfill: Fine-tune list of BAT tests
Drop -bomb as with forking * interruptible repeating, it takes too long
to include in the BAT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 14:36:57 +00:00
Chris Wilson
a43f40741b igt/gem_exec_suspend: Add BAT runs
Add a couple of all-engine busy tests in order to exercise coherency and
general bugs across suspend. (In particular, I expect this to trigger a
fresh case of lockdeps on Braswell, as well as the usual battery of
missing rpm references. This is an exerciser for my lockless-suspend
patches.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:44:44 +00:00
Chris Wilson
a03ee8f6c8 igt/gem_exec_suspend: Allow suspend testing on gen6
Filter out the request to execute on gen6/bsd to prevent skips.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:05:48 +00:00
Chris Wilson
d5e550f5c6 igt/gem_exec_whisper: Tweak migration logging
reloc.presumed_offset == -1 => implies we hit the fallback path and not
that we strictly needed to patch the relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:05:48 +00:00
Chris Wilson
fcb4cfa520 igt/gem_concurrent_all: Inject a hang onto all rings
Also test a hang across all rings, rather than just one engine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:05:48 +00:00
Chris Wilson
3b22b89dd8 igt/gem_exec_whisper: Prevent MI_STORE_DWORD on gen6/bsd again
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 11:14:27 +00:00
Chris Wilson
c19b049d9c igt/gem_concurent_blit: Prevent a memleak if we assert whilst creating buffers
Assume that we may halt partway through buffers_create() and so be
careful to clear up the partial state in buffers_destroy().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-20 11:17:21 +00:00
Chris Wilson
3d8af56ed2 igt/gem_concurrent_blit: Reset process limits to allow dmabuf tests
Since dmabuf requires an actual fd for every object, we need to increase
the number of files our process is allowed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-20 10:51:09 +00:00
Chris Wilson
82e9113bfb lib/igt_aux: Refine decision to stop signal injection
The goal of injecting signals into the ioctl() is to trigger an EINTR.
If we did not succeed on the last pass, we are not going to on the next
or subsequent passes either.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 16:00:02 +00:00
Chris Wilson
f338e9834c igt/gem_concurrent_blit: Enable quicker interruptible testing
v2: Because I managed to push the wrong version.

Make --list-subtests happer by creating the name before the igt_fixture,
not inside it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:59:27 +00:00
Chris Wilson
1abbd69740 igt/gem_softpin: Convert to igt_interruptible
Convert the fixed time interruptible tests to igt_interruptible() for a
speed improvement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
22674ae88b igt/prime_mmap_coherency: Speed up interruptible testing
Use the new fangled igt_interruptible() to limit the number of passes we
require when performing signal injection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
83cfed8c39 igt/gem_exec_whisper: Add interruptibles tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
87cad37c78 igt/gem_ringfill: Use igt_sigiter to focus the interruptible testing
Use the igt_sigiter interface to repeat the ringfill testing for as much
as is required to exercise all potential injection sites.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
e85613b47c igt/gem_concurrent_blit: dmabuf requires twice the number of files
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-19 15:21:28 +00:00
Chris Wilson
c2248efbca igt/gem_concurrent_blit: Enable quicker interruptible testing
Use the igt_sigiter interface to only repeat the -interruptible tests
when we can make further progress with another change at injecting a
signal.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
d545610861 lib/igt_aux: Divert ioctls for signal injection
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-03-19 15:20:43 +00:00
Chris Wilson
c1fed522ae lib: Replace drmIoctl() with a layer of indirection
Insted of calling drmIoctl() directly, call igt_ioctl() instead. In the
normal scenario this is function pointer that calls drmIoctl() (so no
penalty), but allows us to divert ioctls into our own routines for
nefarious purposes. One such purpose will be to control interrupt
generation into the ioctl, to be able to detect when we successfully
interrupt the ioctl and when we no longer need more interrupts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 13:15:08 +00:00
Daniel Vetter
4e4f5b4fdc lib/tests: More igt_subtest_group checks
... for some cases discussed with Chris on irc. We seem to get them all
right.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-19 12:15:47 +01:00