4344 Commits

Author SHA1 Message Date
Jani Nikula
b6b130c5eb man: update intel_reg.rst to be more in line with the others
Use the definitions and formatting used in other man pages, etc.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-03-03 16:17:07 +02:00
Jani Nikula
cc7387f17c man: rewrite manual pages in reStructuredText
intel_reg.rst was the first man page written in reStructuredText. Follow
suit with the rest of the man pages.

Add a generated defs.rst include file for definitions such as
intel-gpu-tools version. This replaces the MAN_SUBSTS sed script
substitutions from xorg-macros for old man pages.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-03-03 16:17:07 +02:00
Ville Syrjälä
037bc69fde lib/igt_fb: Fix gen2 and 915 Y tile sizes
gen2 tile dimensions are 128x32 for both X and Y tiling
915 tile dimensions are 512x8 for both X and Y tiling

Fix igt_get_fb_tile_size() to return the correct Y tile dimensions
for these platforms. X tile was fine already.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-03-03 15:53:08 +02:00
Ville Syrjälä
0c02873220 lib/igt_kms: Fix igt_fb_set_size() debug message
The debug message in igt_fb_set_size() was copy pasted
from igt_fb_set_position() and not adjusted to say the
right thing. Fix it up.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-03-03 15:53:08 +02:00
Chris Wilson
7499b913b3 lib/igt_gt: Replace asm clflush/mfence with __builtin_ia32 variants
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03 12:11:01 +00: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
cb4589af09 lib: Tidy testing for rtcwake
When performing a dummy-run of rtcwake, hide the output as it doesn't
print anything useful (just when it will wake up).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03 10:19:01 +00: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
18d0b1efb8 lib/igt_fb: Fix domain tracking for GTT cairo surfaces
If we create a cairo surface using a GTT mmaping, then we need to use
the GTT access domain. cairo surfaces created with a blit temporary (for
unfenced surfaces) still use the CPU domain.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-02 14:14:11 +00:00
Chris Wilson
5533f22c35 lib: Show the command that fails when suspending
Include the system("") in the debug output for the assertion failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-02 13:58:35 +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
Marius Vlad
1112abe5ec Bump again to 1.14, as Chris managed to push before I got chance to do a
release. Modified REAMDE to include link for doing releases.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-03-01 18:09:33 +02:00
Chris Wilson
f3751d53bd benchmarks/gem_blt: Measure the throughput of synchronous copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01 15:07:29 +00:00
Marius Vlad
b59bcb811a NEWS: Updates and bump release to 1.14.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-03-01 17:06:05 +02: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
Chris Wilson
925e5e1cae lib: Check required number of surfaces against VFS file limits
If we want to create more file handles than VFS supports (itself often a
memory limited value), report that we can not create that many objects
via intel_require_memory().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-29 15:40:21 +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
Chris Wilson
0667cf5669 igt/gem_sync: Add some forked variants
Repeat the synchronisation test with a few competing processes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-26 10:09:10 +00:00
Chris Wilson
d627e30c9e igt/gem_concurrent_blit: Pretend tests exist
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-25 20:01:33 +00:00
Chris Wilson
cf569c216b igt/gem_concurrent_blit: Add dmabuf exercisers
Create and use dmabuf mmaps as well to ensure correct synchronisation
between concurrent rendering and CPU access.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-25 17:59:57 +00:00
Chris Wilson
f27d295fe3 lib: Move gem_wait() to ioctl-wrappers
We intend to use gem_wait() in more tests than gem_wait.c, so move the
simple ioctl wrapper into the core.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-23 18:03:46 +00:00
Paulo Zanoni
babcf40f29 kms_frontbuffer_tracking: add basic subtest
This test executes one of each of the very basic operations with
whatever features are enabled by default in the Kernel, without
checking their statuses: we only care about the CRCs. Although it's
completely redundant, it will be ran by the CI so we can spot
regressions both in the specific features and in the frontbuffer
tracking subsystem.

We're not checking sink CRCs since they're still unreliable and we
don't want false negatives in the CI.

It takes 5 seconds to run this test on my machines.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-02-19 17:09:46 -02:00
Paulo Zanoni
b87188795e kms_frontbuffer_tracking: don't fail fbc-farfromfence on SKL
SKL doesn't do the same dspaddr_offset magic as the older gens, so FBC
may not be enabled on fbc-farfromfence. This is not a bug since FBC is
just disabled, and this is the expected case of the current Kernel, so
let's not fail the test.

If/once we land the proper infrastructure to fix this in the Kernel we
may revert this commit.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-02-19 17:08:48 -02:00
Chris Wilson
556535400c igt/gem_exec_reloc: Check WC mmaps as well
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-19 10:32:35 +00:00
David Weinehall
15deba4575 lib/igt_pm: Lib for power management
Move power management related code to a separate library.
Initially this is done only for workarounds that apply to external
components.  Modify the users of such workarounds accordingly.
This currently involves HD audio and SATA link power management.
For SATA link PM there's also code to save the previous settings,
to allow for resetting the values after we've finished testing.

Signed-off-by: David Weinehall <david.weinehall@intel.com>
Reviewed-by: Marius Vlad <marius.c.vlad@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-02-19 12:10:21 +02:00
Chris Wilson
16038908de lib: Restore gem_available_aperture_size()
Missed an error whilst rebasing and trying to modify the previous patch
to keep this function intact... Instead, I now have to add this patch to
restore gem_available_aperture_size() and its one usage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-18 10:36:45 +00:00
Chris Wilson
391b32c382 igt: Report the global GTT size
For many tests, the relevant aperture is not the ppGTT but the internal
global GTT managed by the kernel. Use this limit appropriately.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-18 10:30:56 +00:00
Chris Wilson
e85c530eab igt: Mark gem_cs_tlb/gem_cs_prefetch as a pair of basic GTT layout tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-18 10:28:39 +00:00
Chris Wilson
3990dd87b6 igt/gem_ctx_thrash: Combine context thrashing with a render test
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-18 09:46:02 +00:00
Chris Wilson
3b12d9e6dc igt/gem_ctx_thrash: Double number of threads/proceesses
Slightly increase the stress by doubling the number of contending
threads and the number of times we try and use each ctx/fd.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-18 09:46:02 +00:00
Derek Morton
ef724ab2bb lib/igt_core.c: Expand --run-subtest functionality.
Added extended wildcard support when specifying --run-subtest.

Wildcard format is as specified in rfc3977 and the uwildmat() implementation
is taken from libinn.
See https://tools.ietf.org/html/rfc3977#section-4 for a description of
allowed wildcard expressions.

v2: Use comma as list separator (Ville Syrjala)
support both ^ and ! as not operators (Dave Gordon)

v3: Updated to use uwildmat() (Dave Gordon)

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
[danvet: Fixup whitespace. Add #include <stdint.h>. Run lint.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-17 18:21:12 +01:00
Marius Vlad
0a45d6ba13 tests/prime_mmap: Encapsulate check_for_dma_buf_mmap() in igt_fixture.
This unbreaks distcheck target that in turn runs each test with --list-subtests.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-02-14 19:22:25 +02:00
Marius Vlad
42c7dd1255 Update MAINTAINERS file.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-02-14 19:22:00 +02:00
Kristian Høgsberg Kristensen
c5c1270f0f aubdump: Add a get_bo() lookup function
We'll use this instead of accessing the bo array directly and add a few
sanity checks.
2016-02-13 12:42:06 -08:00
Kristian Høgsberg Kristensen
68a064ec64 aubdump: Don't use .so constructors for initializing
This doesn't seem to work when mixed with constructors in other shared
objects or other creative uses of the linker. Let's stick with a simpler
mechanism, where we look up the libc functions when our hooks are called
for the first time.
2016-02-13 12:42:02 -08:00
Kristian Høgsberg Kristensen
a3506b5219 aubdump: Raise SIGTRAP on failure 2016-02-13 12:40:11 -08:00
Chris Wilson
ca3d355846 igt/gem_userptr_blits: Flip sign on error check
Following conversion to __gem_execbuf() we need to consider that it
returns -errno when checking the result.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94117
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-12 16:39:29 +00:00
Tiago Vignatti
ed40329c30 tests: Add prime_mmap_coherency for cache coherency tests
Different than kms_mmap_write_crc that captures the coherency issues within the
scanout mapped buffer, this one is meant for test dma-buf mmap on !llc
platforms mostly and provoke coherency bugs so we know where we need the sync
ioctls.

I tested this with !llc and llc platforms, BTY and IVY respectively.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-02-11 18:16:26 +01:00
Tiago Vignatti
7c89c9d734 tests: Add kms_mmap_write_crc for cache coherency tests
This program can be used to detect when CPU writes in the dma-buf mapped object
don't land in scanout due cache incoherency.

Although this seems a problem inherently of non-LCC machines ("Atom"), this
particular test catches a cache dirt on scanout on LLC machines as well. It's
inspired in Ville's kms_pwrite_crc.c and can be used also to test the
correctness of the driver's begin_cpu_access and end_cpu_access (which requires
i915 implementation.

To see the need for flush, one has to run using '-n' option to not call the
sync ioctls which, via a rather simple CPU hog the system will trashes the
caches, while the test will catch the coherency issue. If you now suppress
'-n', then things should just work like expected.

I tested this with !llc and llc platforms, BTY and IVY respectively.

v2: use prime_handle_to_fd_for_mmap instead.
v3: merge end_cpu_access() patch with this and provide options to disable sync.
v4: use library's prime_sync_{start,end} instead.
v7: use CPU hog instead and use testing rounds to catch the sync problems.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-02-11 18:16:20 +01:00