4208 Commits

Author SHA1 Message Date
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
Tiago Vignatti
35debab2d9 lib: Add prime_sync_start and prime_sync_end helpers
This patch adds dma-buf mmap synchronization ioctls that can be used by tests
for cache coherency management e.g. when CPU and GPU domains are being accessed
through dma-buf at the same time.

v7: add sync invalid flags test.

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:12 +01:00
Tiago Vignatti
4edfa09ae4 prime_mmap: Add basic tests to write in a bo using CPU
This patch adds test_correct_cpu_write, which maps the texture buffer through a
prime fd and then writes directly to it using the CPU. It stresses the driver
to guarantee cache synchronization among the different domains.

This test also adds test_forked_cpu_write, which creates the GEM bo in one
process and pass the prime handle of the it to another process, which in turn
uses the handle only to map and write. Roughly speaking this test simulates
Chrome OS  architecture, where the Web content ("unpriviledged process") maps
and CPU-draws a buffer, which was previously allocated in the GPU process
("priviledged process").

This requires kernel modifications (Daniel Thompson's "drm: prime: Honour
O_RDWR during prime-handle-to-fd") and therefore prime_handle_to_fd_for_mmap is
added to fail in case these lack. Also, upcoming tests (e.g. next patch) are
going to use it as well, so make it public and available in the lib.

v2: adds prime_handle_to_fd_with_mmap for skipping test in older kernels and
test for invalid flags.

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:15:59 +01:00
Rob Bradford
e0efeb97a9 prime_mmap: Add new test for calling mmap() on dma-buf fds
This test has the following subtests:
 - test_correct for correctness of the data
 - test_map_unmap checks for mapping idempotency
 - test_reprime checks for dma-buf creation idempotency
 - test_forked checks for multiprocess access
 - test_refcounting checks for buffer reference counting
 - test_dup checks that dup()ing the fd works
 - test_userptr make sure it fails when mmaping due the lack of obj->base.filp
   in a userptr.
 - test_errors checks the error return values for failures
 - test_aperture_limit tests multiple buffer creation at the gtt aperture
   limit

v2 (Tiago): Removed pattern_check(), which was walking through a useless
iterator. Removed superfluous PROT_WRITE from gem_mmap, in test_correct().
Added binary file to .gitignore
v3 (Tiago): squash patch "prime_mmap: Test for userptr mmap" into this one.
v4 (Tiago): use synchronized userptr for testing. Add test for buffer
overlapping.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
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:15:52 +01:00
Tiago Vignatti
e1f663b543 lib: Add gem_userptr and __gem_userptr helpers
This patch moves userptr definitions and helpers implementation that were
locally in gem_userptr_benchmark and gem_userptr_blits to the library, so other
tests can make use of them as well. There's no functional changes.

v2: added __ function to differentiate when errors want to be handled back in
the caller; bring gem_userptr_sync back to gem_userptr_blits; added gtkdoc.
v8: remove local_i915_gem_userptr from gem_concurrent_all.c to use the global
helpers instead.

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:15:44 +01:00
Maarten Lankhorst
7670e286f5 kms_force_connector_basic: Add force-load-detect test
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-11 12:46:24 +01:00
Daniele Ceraolo Spurio
0e388f409a tests/gem_exec_params: test all valid execution flags
The control subtest has been extended to check the execution flags for
all the rings that are present in the HW.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-10 09:16:33 +01:00
Tomeu Vizoso
2629f3aeef lib: Fix build when vc4 headers are present
Automake seems to not like variable assignments indented with tabs.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: 9e5478dc4345 ("lib: Only compile igt_vc4 is we have it")
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-09 16:25:35 +01:00
Daniel Vetter
9e5478dc43 lib: Only compile igt_vc4 is we have it
Unbreaks compilation fail.

Also appease gcc in gem_exec_basic because.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-02-09 09:46:03 +01:00
Eric Anholt
467a9fac9b igt/vc4_wait_bo: Add tests with rendering performed.
These caught an unexpected bug with clear colors (we'd get the last
executed clear's color in our new BO), while failing to catch the bug
I'd been hoping to find all along.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
e7e094f444 igt/vc4_create_bo: Test various paths in BO creation.
create-bo-0 fails on the current kernel, and it's something I want to
fix.

v2: Use do_ioctl_err().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
59f98997ab igt: Add a helper function for creating VC4 BOs.
v2: Use do_ioctl().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
b8badc2436 igt: Add a helper function for mapping VC4 BOs.
v2: Use do_ioctl().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
4880e13d04 igt: Add a helper function for getting a VC4 BO that's been drawn to.
v2: Use do_ioctl().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
7f421acb60 igt/vc4_wait_bo: Add a test for VC4's wait-for-BO ioctl.
The pad subtest fails currently.

v2: Use do_ioctl() and do_ioctl_err().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
d333a0ed69 igt/vc4_wait_seqno: Add a test for VC4's wait-for-seqno ioctl.
v2: Use do_ioctl_err().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
3f83f07039 igt: Add support for DRIVER_VC4 flags on tests.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
ceca9ef8d0 configure.ac: Test for libdrm_vc4 and build vc4 tests based on it.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Damien Lespiau
8d441ee491 list-workarounds: Fix python 2 print statement
That script is a python 3 script, so we can't use the python 2 print
statement, it's a function now.

I missed it in the review because reviewing a diff without additional
context gives you a partial story.

Cc: Sameer Kibey <sameer.kibey@intel.com>
Cc: Dylan Baker <baker.dylan.c@gmail.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2016-02-08 12:01:48 +00:00
Kibey, Sameer
fb9df0e510 list-workarounds: Extend the script to Mesa
Updated the list-workarounds script so that it
can parse Mesa directory if provided. Moved the
common code to a separate function to allow
reuse for both kernel and mesa.

The new command line is:
Usage: list-workarounds [options] path-to-kernel
       -k path-to-kernel -m path-to-mesa

The legacy usage is retained to avoid breaking
backwards compatibility. New parameters -k and
-m are added for the new behavior.

Either kernel or mesa or both paths can be specified.
If path-to-mesa is invalid, error is reported.

Signed-off-by: Sameer Kibey <sameer.kibey@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
2016-02-05 23:44:38 +00:00
Chris Wilson
6b3c832cfb igt/gem_workarounds: Convert to real GPU hang injection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 17:38:02 +00:00
Chris Wilson
6f7372f664 igt/gem_exec_alignment: Fix off-by-one in buffer objects
When reducing the buffer count to fit into the aperture whilst aligned,
remember to adjust the pointer so that the batch is the last object!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 16:13:23 +00:00
Chris Wilson
b081257d74 igt/gem_exec_alignment: Mark batch buffer as also requiring 48B
If we completely fill the lower 4G of address space with our alignment
objects, then we also need to mark the batch as requiring high-address.
Though the kernel should be reordering in this case...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 15:35:58 +00:00
Chris Wilson
ffbc59a3ef lib: Silence a common debug message when creating a context
In context tests, we may create thousands of contexts, the noise from
each requirement passing drowning out the real information. Let's only
do the requirement test (to detect if contexts are meant to be supported
or plain broken) only on the error path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 13:31:29 +00:00
Chris Wilson
e7faf33ec7 igt/gem_ctx_thrash: Rewrite to avoid extraneous allocations
The goal of the test is to exercise what happens when we fill the Global
GTT with the contexts. To that end, we only need to allocate 2/4GiB of
context objects, and can forgo filling each context with buffers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94005
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 09:12:31 +00:00
Chris Wilson
0e96238bf3 igt/gem_userptr_blits: Limit amount of mlocked surfaces
When testing surface eviction we don't need that many surfaces as we
mlock surplus memory. Reducing the number of surfaces speeds up the test
and prevents a couple of integer overflow bugs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94004
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 17:48:16 +00:00
Chris Wilson
7b5a818581 igt/gem_reset_stats: Convert from stop-rings to real hang injection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 15:25:40 +00:00
Chris Wilson
9cc2b1336b igt/gem_ctx_exec: Convert from stop-rings to a real GPU hang/reset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 11:22:00 +00:00
Chris Wilson
38fe49d9a8 tests/drv_hangman: Convert to using central list of engines
Rather than encoding our own list of engines, use the common one for
greater coverage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 11:22:00 +00:00
Chris Wilson
01e467a631 igt/drv_hangman: Make the batchbuffer check more robust
All the external viewer expects of the GPU error capture is to extract
the exact batch that triggered the hang. Everything else is internal
detail to aide in post-mortem debugging of the kernel driver (i.e.
subject to change) and not of the userspace portion (under control of
the test).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 11:08:07 +00:00
Chris Wilson
0753057446 igt/drv_hangman: Inject a true hang
Wean drv_hangman off the atrocious stop_rings and use a real GPU hang
instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:36 +00:00
Chris Wilson
8f6957a05a igt/gem_ringfill: Add exercising the default-ring to basic testing
ringfill generates a few very common errors when submitting requests,
and historically these have been where we have had many implementation
bugs, repeated over and over again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:35 +00:00
Chris Wilson
348742ec0d igt/gem_streaming_writes: Set bb start alignment to 64b for Ironlake
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:35 +00:00
Chris Wilson
3992babd98 igt/gem_busy: Refactor to use gem_require_ring()
Now that gem_require_ring() does the right thing with BSD1/BSD2 we can
use it to our advantage here.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:29 +00:00
Paulo Zanoni
3005665ead tools/intel_residency: use setitimer instead of {,u}alarm
It seems that Android doesn't have ualarm(). Let's use setitimer()
instead.

The tool still won't compile on Android due to igt_fb requiring Cairo,
but we're supposed to solve this in another patch since our igt_fb
calls don't actually require Cairo.

Reported-by: Derek Morton <derek.j.morton@intel.com>
Tested-by: Derek Morton <derek.j.morton@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:31:42 -02:00
Paulo Zanoni
ec5deb218d tests/pm_rpm: find an appropriate CRTC instead of hardcoding CRTC 0
BSW does not allow CRTC 0 to be used on every connector, so we need to
write code to actually find a suitable CRTC.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93124
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:31:18 -02:00
Paulo Zanoni
84157ad1b4 tests/pm_rpm: remove POWER_DIR definition
Unused ever since we moved some code from pm_rpm.c to lib/. This is
currently defined inside igt_aux.c.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:30:55 -02:00