4038 Commits

Author SHA1 Message Date
Chris Wilson
e2b9dfd0aa igt/gem_storedw_loop: Remove libdrm crutches
Make the behaviour of the test more explicit wrt to the handle management,
mmap and domain handling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
Chris Wilson
38790b77d5 igt/gem_cs_prefetch: Replace explicit sync with implicit sync
We can trade off the explicit sync (presumably to avoid some resource
starvation issue?) with the implicit sync of having to perform a
relocation. Using an implicit sync helps stress core kernel code,
besides being much faster!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
Chris Wilson
a6090c7191 igt/gem_mmap_wc: Test cpu mmap vs wc mmap coherency
Similar to the cpu mmap vs gtt mmap coherency test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
Chris Wilson
571b876544 gem_concurrent_all: Add a "quick" tiny pass
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
Chris Wilson
1c61c0f750 gem_concurrent_blit: Add a pread/pwrite variant to only set part of the buffer
The idea is to check partial cacheline reads/writes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
Chris Wilson
42291f2510 gem_concurrent_blit: Don't call igt_require() outside of a subtest/fixture
gem_concurrent_blit tries to ensure that it doesn't try and run a test
that would grind the system to a halt, i.e. unexpectedly cause swap
thrashing. It currently calls intel_require_memory(), but outside of
the subtest (as the tests use fork, it cannot do requirement testing
within the test children) - but intel_require_memory() calls
igt_require() and triggers and abort. Wrapping that initial require
within an igt_fixture() stops the abort(), but also prevents any further
testing.

This patch restructures the requirement checking to ordinary conditions,
which though allowing the test to run, also prevents listing of subtests
on machines which cannot handle them.
2016-01-19 14:03:15 +00:00
Chris Wilson
51e965f299 tests: Add basic gem_sync test
A very basic test of functionality, execute a nop and wait for it to
complete. It should be very effective at stimulating the "missed
interrupt syndrome" on all devices.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-17 17:07:50 +00:00
Chris Wilson
136d6c7961 igt/gem_streaming_writes: Set the initial CPU write domain
Remove one assumption from the test and amek the domain management
explict - when we write through the CPU to construction the batch, mark
it as having been written.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-16 17:54:16 +00:00
Chris Wilson
59adb00129 tests: Add gem_busy
Exercise the busy-ioctl and verify it reports the right active engines
using the execbuffer notation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-15 20:54:45 +00:00
Derek Morton
825482a25c tools/Android.mk: Add zlib support
IGT does not build for Android due to a zlib dependency being added
to intel_error_decode.c in a recent patch.
This patch fixes the error by updating the Android makefile to add
the path to the zlib library and using any LDFLAGS specified in
Makefile.sources.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2016-01-15 15:56:59 +00:00
Mika Kahola
fe7a42bff6 tools/intel_bios_reader: Fix typo on dump info
Fix typo on intel_bios_reader.c

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-15 15:22:55 +02:00
Jani Nikula
480479d7dc intel_bios_reader: dump MIPI sequence block v3
Similar to what's done in kernel. It's a bit artificial that the parsing
and dumping are two separate steps in the userspace tool, but it's
easier to follow and debug the code when both the kernel and userspace
are similar.

v2: don't segfault so much on dumping null pointers

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:56:07 +02:00
Jani Nikula
70dc8c85f1 intel_bios_reader: port the sequence block parsing from kernel
Reuse the same code as kernel. Also parses v3, although does not
actually dump that stuff yet.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:40:42 +02:00
Jani Nikula
7d1a37282b intel_bios_reader: port find_panel_sequence_block from kernel
No need to reinvent wheels, reuse the code from kernel.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:36:33 +02:00
Jani Nikula
b26393489e intel_bios_reader: make the VBT pointers more const
In const we trust.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:35:08 +02:00
Jani Nikula
d9588c891d intel_bios_reader: fix size handling for 32-bit block size
The MIPI DSI sequence block v3+ has a separate block size field.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:33:34 +02:00
Jani Nikula
2e2fffa7a5 intel_bios_reader: pass bdb pointer around instead of having as global
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:32:21 +02:00
Ville Syrjälä
065d73619f tests/kms_chv_cursor_fail: Skip when the pipe doesn't exist
Looks like I fumbled things when I made kms_chv_cursor_fail iterate
over all pipes. It fails to check that the pipe actually exists, and
so fails on < 3 pipe platforms. Add the necessary checks to skip
on non-existing pipes.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-11 20:25:45 +02:00
Chris Wilson
cd658a7c6b core/sighelper: Interrupt everyone in the process group
Some stress tests create both the signal helper and a lot of competing
processes. In these tests, the parent is just waiting upon the children,
and the intention is not to keep waking up the waiting parent, but to
keep interrupting the children (as we hope to trigger races in our
kernel code). kill(-pid) sends the signal to all members of the process
group, not just the target pid.

We also switch from using SIGUSR1 to SIGCONT to paper over a race
condition when forking children that saw the default signal action being
run (and thus killing the child).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-01-11 09:36:46 +00:00
Rodrigo Vivi
05ac611358 kms_psr_sink_crc: Simplify debugfs reading.
Let's start using igt_debugfs_read helper so we
can change the debugfs interface at anytime.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2016-01-08 16:00:13 -08:00
Ville Syrjälä
f1bb20eb7c tests/kms_flip: Increase TEST_TS_CONT max seq difference to 150
During suspend tests we can exceed the current 100 frame difference
in sequence numbers. Bump the limit to 150 frames.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 19:59:10 +02:00
Ville Syrjälä
39aecb05d5 tests/kms_pipe_crc_basic: Use igt_assert_eq() to see the failing frame counts
Use igt_assert_eq() to compare the frame numbers during the frame
sequence tests so that we'll see exactly what the bad frame counts
are when the test fails.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 19:59:10 +02:00
Ville Syrjälä
7ff8223d44 tests/gem_mmap_gtt: Make the small-bo tiling tests work on old platforms
Several factors conspire against us when trying to execute
the tiled small-bo tests:
- pre-gen4 require power of two fences, with natural alignment
- the entire gtt may be mappable
- we put a guard page at the end of gtt

What all that means is that when we try to use a tiled object half
the size of the mappable area, we can only fit it in the first half
of the gtt. That leads to a SIGBUS when we try to fault in the
object when there's already something (eg. fbdev) occupying the
first half of gtt.

So in order to make the tests run on old machines, let's further
halve the object size when things look too tight.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 19:57:33 +02:00
Ville Syrjälä
21022f076d tests/gem_mmap_gtt: Add progress indicators
Some of the copy tests take a while, so let the user know how
far along we are via a progress indicator.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 19:57:33 +02:00
Ville Syrjälä
86382de3fb tests/gem_mmap_gtt: Deal with tile sizes on gen2/3
Gen2/3 platforms have some unusual tile dimensions. Account
for them to make the test work correctly.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 19:57:33 +02:00
Ville Syrjälä
1ecd91a8c6 Fix a bunch of printf types
igt_kms.c: In function ‘igt_crtc_set_background’:
igt_kms.c:1940:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat=]
  LOG(display, "%s.%d: crtc_set_background(%lu)\n",
  ^
intel_firmware_decode.c: In function ‘csr_open’:
intel_firmware_decode.c:169:2: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘__off_t’ [-Wformat=]
  printf("Firmware: %s (%zd bytes)\n", filename, st.st_size);
  ^
intel_gpu_top.c: In function ‘main’:
intel_gpu_top.c:683:10: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=]
          stats[i] - last_stats[i]);
          ^
hsw_compute_wrpll.c: In function ‘main’:
hsw_compute_wrpll.c:644:3: warning: format ‘%li’ expects argument of type ‘long int’, but argument 7 has type ‘long long int’ [-Wformat=]
   igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p,
   ^
gem_gtt_hog.c: In function ‘__real_main155’:
gem_gtt_hog.c:177:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
  igt_info("Time to execute %lu children:  %7.3fms\n",
  ^
kms_flip.c: In function ‘run_test_step’:
kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 10 has type ‘__time_t’ [-Wformat=]
   igt_assert_f(end - start > 0.9 * frame_time(o) &&
   ^
kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 11 has type ‘__suseconds_t’ [-Wformat=]
kms_frontbuffer_tracking.c: In function ‘setup_sink_crc’:
kms_frontbuffer_tracking.c:1364:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t’ [-Wformat=]
   igt_info("Unexpected sink CRC error, rc=:%ld errno:%d %s\n",
   ^
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 19:56:49 +02:00
Ville Syrjälä
a7882a31cb tests/kms_chv_cursor_fail: Add a test to exercise CHV pipe C cursor fail
The test tries to anger CHV pipe C cursor by walking the edges of the
screen while moving the cursor across the screen edge.

The actual hw issue only occurs on pipe C, and only on the left screen
edge. The testcase can walk all the edges though, and on all pipes, just
so I could make sure the failure doesn't occur there.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 15:01:59 +02:00
Ville Syrjälä
a7a2c76a80 tests/kms_pipe_crc_basic: Add tests for O_NONBLOCK CRC reads
v2: Rebased due to __attribute__((warn_unused_result))

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 15:01:59 +02:00
Ville Syrjälä
9090745030 lib: Add igt_pipe_crc_new_nonblock()
Add support for reading the CRC in non-blocking mode. Useful for tests
that want to start the CRC capture, then do a bunch of operations, then
collect however many CRCs that got generated. The current
igt_pipe_crc_new() + igt_pipe_crc_get_crcs() method would block until
it gets the requested number of CRCs, whreas in non-blocking mode we
can just read as many as got generated thus far.

v2: __attribute__((warn_unused_result)), document the
    new igt_pipe_crc_get_crcs() return value (Daniel)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 15:01:59 +02:00
Ville Syrjälä
5b113d323d lib: Extract some common fb create+fill methods into helpers
Several tests do one or more of the following:
* igt_create_fb() + igt_paint_test_pattern()
* igt_create_color_fb() + igt_paint_test_pattern()
* igt_create_fb() + igt_paint_image()

Extract them into new helpers: igt_create_pattern_fb(),
igt_create_color_pattern_fb(), igt_create_image_fb().

v2: Fix typos, and improve API docs (Thomas)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 15:01:59 +02:00
Michel Thierry
7cb3510964 tests/gem_softpin: Use offset addresses in canonical form
i915 validates that requested offset is in canonical form, so tests need
to convert the offsets as required.

Also add test to verify non-canonical 48-bit address will be rejected.

v2: Use sign_extend64 for converting to canonical form (Tvrtko)

Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
2016-01-08 09:40:56 +00:00
Chris Wilson
fca862cdd3 igt/gem_mmap_gtt: Add a test to exercise coherency between GTT/CPU
This checks whether a write through the GTT is immediately visible to
the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-07 11:31:28 +00:00
Derek Morton
8528b484e8 igt_core: Fix logging to display extended line
line[strlen(line)] will always evaluate to NULL so line_continuation
was always true. That prevented the program name, pid and log level
ever being printed.
Changed to [strlen(line) - 1] so the last character before the null
terminator is compared with '\n' to determine line_continuation.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-01-06 15:17:53 +01:00
Chris Wilson
51bb53663e benchmarks/gem_latency: Allow setting an infinite time
Well, 24000 years.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-06 10:21:40 +00:00
Maarten Lankhorst
3c1362f0a6 tests: Bump pageflip wait timeout to 50 ms.
The default is too low for panels that are 30 fps or lower.
Bump the timeout to 50 ms to prevent spurious errors on those
displays.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-01-05 15:22:30 +01:00
Chris Wilson
1d6e5d3197 igt/gem_concurrent_all: Preparatory work for testing different create flags
In order to do concurrency checks using different allocation functions,
we need to hook those functions up to gem_concurrent_all. So let's add
another layer of combinations! The actual enabling for create2-ioctl
will come in the future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-03 14:22:24 +00:00
Chris Wilson
e21368c53a benchmarks/gem_mmap: Convert to run over a fixed period
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-02 16:31:05 +00:00
Chris Wilson
9b90234414 benchmarks/gem_exec_nop: Convert to running for a fixed time
Like the previous patch to gem_exec_ctx, retrict gem_exec_nop to running
for a fixed length of time, rather than over a range of different
execution counts. In order to retain some measurement of that range,
allow measuring individual execution versus continuous dispatch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-02 15:43:52 +00:00
Chris Wilson
6953899beb benchmarks/gem_exec_ctx: Run for a fixed time
Rather than investigate the curve for dispatch latency, just run for a
fixed time and report an average latency. Instead offer two modes,
average single dispatch latency, average continuous dispatch latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-02 12:31:51 +00:00
Chris Wilson
276fb3d3f4 benchmarks/gem_exec_ctx: Fix fd switching between default contexts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-01 14:38:07 +00:00
Chris Wilson
bb35716d25 intel_error_decode: Update address parsing for 64bit offsets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
8f9df28a82 intel_error_decode: Fix decode headers for HW context
As we didn't recognise the different buffer type, we confused it with
whatever we last decoded (i.e. the render ring buffer).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
d4c3cd4d04 intel_error_decode: Inflate compressed error state
Recent kernels compress the active objects using zlib + ascii85
encoding. This adapts the tool to decompress those inplace.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
3d5b50b4f0 benchmarks/gem_blt: Estimate memory bandwidth to improve test runtime
If we autotune the workload to only take 0.1s and then repeat the
measurements over 2s, we can bound the benchmark runtime. (Roughly of
course! Sometimes the dispartity between main memory CPU bandwidth, and
GPU execution bandwidth throws off the runtime, but that's the purpose
of the benchmark!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Jani Nikula
9764247dc5 intel_bios_reader: add dumping of i2c element in mipi sequence
Due to the clever way the whole sequence block is specified without
forward compatibility, it's not possible to dump most blocks without
this.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
cb89add979 intel_bios_reader: improve element dumpers
Try to print something useful and helpful for the user.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
9c4aa072f0 intel_bios_reader: rewrite the mipi sequence block dumping
Simplify things a lot, make it correct, don't pass random pointers to
free() on errors, etc.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
68cfe4ba57 intel_bios_reader: check mipi sequence block version
Bail out on v3+, we don't support that just yet.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
bdf7b1c0eb intel_opregion_decode: add new ASLE fields
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Thomas Wood
fa24ce6b96 docs: add igt_edid_template.h to IGNORE_HFILES
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-21 17:09:19 +00:00