2187 Commits

Author SHA1 Message Date
Chris Wilson
5acda10e7f igt/gem_exec_reloc: Exercise updating relocations of an active object
Supersedes gem_dummy_reloc_loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
e5abd779cf tests/gem_ring_sync_loop: Exercise all rings
Fix the engine selection to exercise all possible rings and in doing so
completely obsoletes gem_multi_bsd_sync_loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
8f6ed9e692 igt/gem_exec_whisper: Persistent relocation support
The goal is to test interengine synchronisation so remove any likelihood
that we introduce synchronisation for performing relocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-12 17:45:55 +00:00
Chris Wilson
f14d56c42d igt/drv_module_reload_basic: Rinse and repeat with addition module parameters
An idea for testing failure paths along module load is to use a parameter
to perform fault injection. This rudimentary framework should get us
started.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 21:27:19 +00:00
Chris Wilson
9eacbd2acd igt/gem_exec_whisper: Test submission between fds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 14:32:36 +00:00
Chris Wilson
6291678f31 igt/gem_exec_whisper: Stop passing NO_RELOC
We don't preserve the execobj.offset nor set the right values into the
batches between iterations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 14:21:46 +00:00
Chris Wilson
d99db0990e igt/gem_exec_whisper: Don't forget that 0 is a valid address on full-ppgtt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 12:07:20 +00:00
Chris Wilson
5615ab2a9d tests: Add gem_exec_whisper
A more complicated store variant to stress inter-engine dependencies
(i.e. semaphores and sync). We write a control value from one batch into
the next and then execute it. This is repeated a few times with each
execution happening on a different engine (so the kernel has to
serialise operations between engines) until we finally write the value
out into our scratch buffer where we can check the result, just like a
Chinese whisper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 11:34:48 +00:00
Chris Wilson
3e2443f838 igt/gem_exec_nop: Fix logical inversion for checking of valid execbuf
Only if the trial __gem_execbuf reports an error do we want to remove
the fancy LUT flags.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 12:46:52 +00:00
Chris Wilson
778f0796e8 igt/gem_reloc_overflow: 32bit compilation warning
gem_reloc_overflow.c: In function ‘__real_main365’:
gem_reloc_overflow.c:384:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
   igt_require_f(mlock(reloc, reloc_size) == 0,
   ^

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 10:58:11 +00:00
Chris Wilson
5ec85f5bf8 igt/gem_concurrent_blit: 32bit compilation warning
gem_concurrent_all.c: In function ‘__real_main1556’:
gem_concurrent_all.c:1642:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘uint64_t’ [-Wformat=]
    igt_debug("Pinning %ld MiB\n", pin_sz);

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 10:58:11 +00:00
Chris Wilson
eb59497a83 igt/drv_hangman: 32bit compilation warning
drv_hangman.c: In function ‘hangcheck_unterminated’:
drv_hangman.c:290:27: warning: integer overflow in expression [-Woverflow]
  int64_t timeout_ns = 100 * NSEC_PER_SEC; /* 100 seconds */

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 10:58:11 +00:00
Chris Wilson
0aacdac56f igt/gem_exec_nop: Only combine unique rings
Ignore the default ring as that is purely symbolic. On BSD2 systems it
is similarly useful to ignore the symbolic BSD ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09 23:40:21 +00:00
Daniel Vetter
e1ca201fe9 tests/gem_reloc_overflow: Add missing igt_fixture
Boom when running with --list on non-intel machines or as non-root.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-09 15:09:56 +01:00
Chris Wilson
c684065be0 igt/gem_exec_store: The simplest batch that does something!
A very simple, the simplest!, batch that can execution on any known
engine that just writes a value into memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09 11:39:42 +00:00
Daniel Vetter
c644c55177 tests/kms_mmap_write_crc: Use the right fork helpers
For a background task the fork helpers are more appropriate, since we
can explicitly cancel children. Also, anything that does real work is
supposed to be in fixtures.

Cc: Tiago Vignatti <tiago.vignatti@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

--
Tiago, can you pls check that I haven't broken anythig?

Thanks, Daniel
2016-03-08 17:12:04 +01:00
Chris Wilson
3a7325e498 igt/gem_exec_nop: Add a basic test
Demonstrate how trivial it is to lockup Braswell, at least my N3050 nuc,
by saturating the interrupt handler with a few requests.

References: https://bugs.freedesktop.org/show_bug.cgi?id=93467
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 12:23:42 +00:00
Chris Wilson
1985459b09 igt/gem_ringfill: Check full rings across suspend/hibernate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
d8842d385c igt/gem_exec_suspend: Check with both cached/uncached objects
Keep an eye on domain tracking for both cached/uncached objects across
suspend.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
697c3f5550 lib: Magic for_each_engine() macro to iterate over available engines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
60eafc5489 igt/gem_exec_suspend: Do pre/post suspend double checks
Check that the system operates normally before and after the suspend (as
well as across the suspend). The goal is to isolate the breakage to the
subtest.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
2d2b61e160 igt/gem_reloc_overflow: Fix errno tests for "overflow"
The execbuffer2 ABI is not strictly limited to a total of UINT32_MAX
entries, rather each object can have a maximum of UINT32_MAX relocation
entries and the current implementation imposes that the total must be
allocable in a contiguous buffer when necessary (i.e as large as the
kernel can conceivably allocate). This is not an ABI constraint per-se,
just an implementation issue.

Whilst updating the limits for 64bit kernels, review usable of
ioctl-wrappers (i.e. use __gem_execbuf now available) and include a
batch of more tests to explore the boundary conditions of the maximum
relocation size. Note that rather than guess the reloc-max, it would be
better if we queried it. Also it is of vital importance that when
constructing a test to fail in a particular fashion, it must not include
any other error (e.g. we were passing in relocation arrays with invalid
target handle and domains when looking for a potential overflow across
multiple objects).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
ec1ac2e2e9 igt/pm_rpm: Wait for PCI D3
The transition to PCI device state D3 is not instantaneous and only
started when runtime suspended. Allow the driver/hardware a little bit
of time to complete the transition before declaring a test failure.

References: https://bugs.freedesktop.org/show_bug.cgi?id=93123
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-07 14:18:43 +00:00
Tvrtko Ursulin
174a06b129 gem_ppgtt: Fix flink-and-exit-vma-leak for engine->last_context
Now that engines keep references on the last executed contexts,
to fix this test we need to execute an unrelated context last to
ensure the one we are interested in is free to be cleaned up when
we expect it to be.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2016-03-07 13:03:04 +00:00
Marius Vlad
afa38a4d45 tests/kms_setmode: Fix compilation warnings.
kms_setmode.c:384:30: warning: declaration of ‘drm_fd’ shadows a global
declaration [-Wshadow]

kms_setmode.c:45:12: note: shadowed declaration is here static int drm_fd;

kms_setmode.c:391:38: warning: passing argument 8 of ‘drmModeSetCrtc’
discards ‘const’ qualifier from pointer target type
[-Wdiscarded-qualifiers] ids, crtc->connector_count, &crtc->mode);

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-03-07 12:27:05 +01:00
Maarten Lankhorst
b33a78b9b1 tests/kms_setmode: Add tests when not stealing encoders on same crtc.
Excercise connector stealing harder. There is a border case in atomic currently where
encoder stealing is not prevented on the same crtc when the encoder is not reassigned.

The following testcase excercises that path and causes a OOPS on my system with nightly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-07 09:47:44 +01:00
Paulo Zanoni
364d3785bf tests/kms_draw_crc: remove hardcoded PIPE_A
The test used to assume pipe A was being used for everything, and we
tried to fix this in commit "tests: fix CRTC assignment for a few
tests", but the pipe CRC code was forgotten.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-04 19:14:57 -03:00
Gabriel Feceoru
55fa16b654 kms_frontbuffer_tracking: Remove hardcoded PIPE_A
Use the pipe which is given from the possible_crcs for that connected port
instead.

On BSW there are constrains for the crtc<-->connector, this fix make this test
passing on BSW.

v2 (from Paulo): bikeshed the blank lines.

Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-04 19:14:32 -03:00
Paulo Zanoni
5267f24471 kms_frontbuffer_tracking: add missing igt_remove_fb calls
Let's be good citizens and properly handle our garbage.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03 16:58:28 -03:00
Paulo Zanoni
d8bf28f0cb tests: fix CRTC assignment for a few tests
All the tests I wrote always assumed that every connector supported
CRTC 0. This is not the case for BSW and possibly others, so fix the
tests before the CI reports more failures.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03 16:57:48 -03:00
Paulo Zanoni
9751e602b7 kms_frontbuffer_tracking: try harder to find suitable connectors
Instead of just giving preference to an eDP primary connector, give
preference to one that's eDP and supports pipe A, then try lesser
optimal combinations later.

We could try to make our test suite use different sets of connectors
when testing FBC and PSR, but that would require some rework, and we
would still be helpless when testing the combination of FBC+PSR.

Also notice that we still hardcode pipe A for the primary connector,
regardless of whether it supports it. This will be solved in the next
commits.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03 16:57:25 -03:00
Paulo Zanoni
1d5dbbf844 kms_frontbuffer_tracking: extract find_connector function
We're going to make our search for connnectors a little more
complicated, so extract the function since we're going to call it a
few more times.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03 16:57:00 -03:00
Paulo Zanoni
b138896331 kms_frontbuffer_tracking: don't pass the crtc idx to init_mode_params
We already pass the crtc id, so use the id to retrieve the index.
We'll change the way we pass the crtc id in the next commits, so we'll
have to call a function to calculate the index based on the id at that
point. Do the change now in order to avoid big commits later.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03 16:56:39 -03:00
Paulo Zanoni
c6279ec4bb lib/igt_kms: add kmstest_get_crtc_idx
Move it from pm_rpm.c to lib/igt_kms and remove the hardcoded version
from kms_frontbuffer_tracking. I'm also planning to add other callers.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03 16:56:01 -03:00
David Weinehall
4133c7f85b tests/pm_rpm: Fix CRASH on machines that lack LLC
On machines that lack an LLC the pm-caching subtest will
terminate with sigbus and thus CRASH during the
I915_CACHING_CACHED iteration. To work around this we reset
the caching to I915_CACHING_NONE before doing memory access.

v2: Various improvements based on feedback from Chris Wilson

v3: Fix incorrect Signed-off-by: line

v4: Further improvements based on feedback from Chris Wilson

Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-03-03 12:38:01 +02:00
Chris Wilson
af22497ac9 igt/gem_softpin: Check norelocations hold versus suspend/resume
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03 10:19:01 +00:00
Chris Wilson
95fbf7efed igt/gem_exec_basic: Check that we don't write into the const execbuf arg
For good measure, also check that we can read the args from a GTT
mmaping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03 09:12:21 +00:00
Chris Wilson
a25983e0b1 igt/gem_exec_suspend: Exercise simple exec-and-read across suspend
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-02 17:28:30 +00:00
Chris Wilson
a3de0bc9df tests/drv_missed_irq_hang: Wait harder
Improve the busy-load for triggering a wait-on-interrupt and check for
extraneous missed-interrupts before and after our tests.

References: https://bugs.freedesktop.org/show_bug.cgi?id=88437
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-02 10:33:25 +00:00
Chris Wilson
02befb8b03 igt/gem_ctx_create: Exercise implicit per-fd context creation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-02 09:46:18 +00:00
Chris Wilson
fbe92a222e igt/gem_ctx_create: Exercise a trivial allocation failure
Trying to allocate and use lots of contexts with execlists and !llc end
ups in faliure very quickly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01 22:39:56 +00:00
Daniele Ceraolo Spurio
95ca7644db tests/drv_hangman: test for acthd increasing through invalid VM space
The hangcheck logic will not flag an hang if acthd keeps increasing.
However, if a malformed batch jumps to an invalid offset in the ppgtt it
can potentially continue executing through the whole address space
without triggering the hangcheck mechanism.

This patch adds a test to simulate the issue. I've kept the test running
for more than 10 minutes before killing it on a BDW and no hang occurred.
I've sampled i915_hangcheck_info a few times during the run and got the
following:

Hangcheck active, fires in 468ms
render ring:
	seqno = fffff55e [current fffff55e]
	ACTHD = 0x47df685ecc [current 0x4926b81d90]
	max ACTHD = 0x47df685ecc
	score = 0
	action = 2
	instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff
	instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000

Hangcheck active, fires in 424ms
render ring:
	seqno = fffff55e [current fffff55e]
	ACTHD = 0x6c953d3a34 [current 0x6de5e76fa4]
	max ACTHD = 0x6c953d3a34
	score = 0
	action = 2
	instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff
	instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000

Hangcheck active, fires in 1692ms
render ring:
	seqno = fffff55e [current fffff55e]
	ACTHD = 0x1f49b0366dc [current 0x1f4dcbd88ec]
	max ACTHD = 0x1f49b0366dc
	score = 0
	action = 2
	instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff
	instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000

v2: use the new gem_wait() function (Chris)

v3: switch to unterminated batch and rename test, remove redundant
    check, update test requirements (Chris), update top comment

v4: force gpu reset if the hang detection fails (Mika)

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
[Mika: removed batch_len=8]
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-03-01 16:57:11 +02:00
Daniele Ceraolo Spurio
03c7f84eb1 lib: move i915_wedged_set to ig_gt.c
Upcoming tests will call it to recover from bad states caused by
hangcheck bugs.the function was renamed to igt_force_gpu_reset to have a
naming closer to other hang-related functions in the same file.

The value written to the debugfs has also been changed to -1; this makes
no differences with the current implementation but copes with upcoming
TDR changes (still under discussion) that should allow the resetting of
a mask of rings.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-03-01 16:57:00 +02:00
Chris Wilson
094e0cbabb igt/gem_concurrent_blit: Deglobalify num_buffers
More num_buffers onto the local struct passed down into the tests to
avoid the issue with having to modify the global value inside the tests
leading to hilarity if the test asserts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01 13:25:07 +00:00
Chris Wilson
aed69b56d4 lib: Add read/write direction support for dmabuf synchronisation
Allow read-only synchronisation on dmabuf mmaps, useful to allow
concurrent read-read testing between the CPU and GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01 13:25:07 +00:00
Maarten Lankhorst
a508fc8622 tests/kms_force_connector_basic: Disable all crtc's for load-detect.
Load detection requires a inactive crtc to run. The CI igt tests are
failing, so ensure there is at least 1 inactive crtc.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-29 10:06:40 +01:00
Chris Wilson
754876378d igt/gem_sync: Enforce a timeout of 20s
The sync test is supposed to complete in 10s. But some bugs cause it to
run very, very slowly. As a defence against those, terminate the test if
we wait for more than 20s.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-26 22:19:41 +00:00
Matt Roper
3482925454 kms_atomic: drop unnecessary connector looping from plane_primary test
Local variable num_connectors is never initialized before being
auto-incremented in the loop.  If we wind up with a non-zero garbage
value, it will lead us to try to write to an out-of-bounds array index.
We should probably initialize it to zero before use.

However on closer inspection, the plane_primary test doesn't actually
wind up using the connector list or number of connectors, so just remove
the whole block of code; it was probably brought in by accident as part
of a copy-paste operation.

Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-02-26 08:52:53 -08:00
Chris Wilson
405b3478d1 igt/drv_hangman: Tidy up assertion failure message
Because

(drv_hangman:6035) CRITICAL: Failed assertion: !((__extension__
(__builtin_constant_p (l) && ((__builtin_constant_p (tmp) && strlen
(tmp) < ((size_t) (l))) || (__builtin_constant_p (s) && strlen (s) <
((size_t) (l)))) ? __extension__ ({ size_t __s1_len, __s2_len;
(__builtin_constant_p (tmp) && __builtin_constant_p (s) && (__s1_len =
strlen (tmp), __s2_len = strlen (s), (!((size_t)(const void *)((tmp) +
1) - (size_t)(const void *)(tmp) == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((s) + 1) - (size_t)(const void *)(s) == 1) ||
__s2_len >= 4)) ? __builtin_strcmp (tmp, s) : (__builtin_constant_p
(tmp) && ((size_t)(const void *)((tmp) + 1) - (size_t)(const void
*)(tmp) == 1) && (__s1_len = strlen (tmp), __s1_len < 4) ?
(__builtin_constant_p (s) && ((size_t)(const void *)((s) + 1) -
(size_t)(const void *)(s) == 1) ? __builtin_strcmp (tmp, s) :
(__extension__ ({ const unsigned char *__s2 = (const unsigned char *)
(const char *) (s); int __result = (((const unsigned char *) (const char
*) (tmp))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (tmp))[1] - __s2[1]); if
(__s1_len > 1 && __result == 0) { __result = (((const unsigned char *)
(const char *) (tmp))[2] - __s2[2]); if (__s1_len > 2 && __result == 0)
__result = (((const unsigned char *) (const char *) (tmp))[3] -
__s2[3]); } } __result; }))) : (__builtin_constant_p (s) &&
((size_t)(const void *)((s) + 1) - (size_t)(const void *)(s) == 1) &&
(__s2_len = strlen (s), __s2_len < 4) ? (__builtin_constant_p (tmp) &&
((size_t)(const void *)((tmp) + 1) - (size_t)(const void *)(tmp) == 1) ?
__builtin_strcmp (tmp, s) : (- (__extension__ ({ const unsigned char
*__s2 = (const unsigned char *) (const char *) (tmp); int __result =
(((const unsigned char *) (const char *) (s))[0] - __s2[0]); if
(__s2_len > 0 && __result == 0) { __result = (((const unsigned char *)
(const char *) (s))[1] - __s2[1]); if (__s2_len > 1 && __result == 0) {
__result = (((const unsigned char *) (const char *) (s))[2] - __s2[2]);
if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *)
(const char *) (s))[3] - __s2[3]); } } __result; })))) :
__builtin_strcmp (tmp, s)))); }) : strncmp (tmp, s, l))) == 0)

is a little hard to understand at a glance.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-26 12:59:37 +00:00
Chris Wilson
430439541c igt/gem_sync: Test across all rings simultaneously
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-26 10:09:10 +00:00