2060 Commits

Author SHA1 Message Date
Chris Wilson
d4a05bc009 igt/gem_concurrent_blit: Switch to a shared mmap for userptr
If we use a MAP_SHARED mmaping for the our backing storage for userptr,
then it will be inherited across the fork with the same address. ideal
for continuity testing of children.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-23 09:08:39 +00:00
Chris Wilson
69ecedea73 igt/gem_concurrent_blit: Allocate a private batch cache for the child
We have to avoid the COW alias for the intel_bufmgr and intel_batch
cache as the child may close the object (in its local cache) leaving an
alias in the parent cache pointing to a stale object.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-23 08:18:23 +00:00
Chris Wilson
3eae640b81 igt/gem_concurrent_blit: Disable userptr+child tests
The issue here is that the pointer inherited upon the child is
copied-on-write, i.e. the pointer is private to each process, but the
handle is shared. This means that writes and reads in the child are
going to a different set of pages than the GPU's object - the test is
simply broken. To overcome this we would need to mmap the shared buffer
into the child.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 20:01:55 +00:00
Chris Wilson
4645630d3e igt/gem_concurrent_blit: Check inheritance of buffers
The current forked modes recreate their handles in the children and just
look at any complications arising from contention. This mode looks at
inheriting the fd+handles from the parent into the child and seeing if
we can use them within the child.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 19:40:30 +00:00
Chris Wilson
512f846f37 igt/gem_ringfill: Mark the write object as EXEC_OBJECT_WRITE
After setting the flag for NORELOC (to avoid having to pay the cost of
validating the relocations on every pass), we need to make sure that
we set EXEC_OBJECT_WRITE so that we do track the outstanding writes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 19:28:34 +00:00
Chris Wilson
291ff6bcf1 igt/gem_ringfill: Disable MI_STORE_DATA_IMM on BSD/gen6
It's broken, avoid at all costs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 19:11:46 +00:00
Chris Wilson
0091e6787c igt/gem_userptr_blits: Exercise applying relocations to a userptr bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 18:28:01 +00:00
Chris Wilson
5b675f7b2f lib: Refactor common detection of missed interrupts
As we have the same function in a few places to read the
debugfs/i915_ring_missed_irq file, move it to the core.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 17:45:06 +00:00
Chris Wilson
e0ee36141e igt/gem_softpin: Fix MI_STORE_DATA_IMM for gen3
We need both a secure batch and to flag it to use the virtual GTT
address.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 17:30:28 +00:00
Chris Wilson
fbb0f636bd igt: Fix use MI_STORE_DATA_IMM on gen3
For the older gen, MI_STORE_DATA_IMM is a privileged command so we need
to set the "secure" batch flag, and we also need to instruct the command
to use the GTT virtual address.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 17:26:33 +00:00
Chris Wilson
e180bec7bc igt/gem_ringfill: Reduce ringfill to just filling the rings
The objective of this test is to check how the driver handles a full
ring. To that end we need only submit enough work to fill the ring by
submitting work faster than the GPU can execute it. If we are more
careful in our batch construction, we can feed them much faster and
achieve the same results much quicker.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 16:07:23 +00:00
Chris Wilson
c4bcffcd10 igt/gem_exec_alignment: Tweaks count for large alignments
We can fit a few more objects in at high alignment, so do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 16:07:23 +00:00
Chris Wilson
bd9842eade igt/gem_cs_tlb: Use softpin to remove GTT layout assumptions
With softpin we can explicitly manage the layout of the objects to be
executed, deliberately forcing the reuse of active pages in an attempt
to spot misbehaviour in the CS TLBs. Being explicit allows us to
eliminate a lot of the CPU overhead between execbuf, hopefully
increasing the likelihood of a conflict.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22 00:29:54 +00:00
Chris Wilson
0143d4f337 igt/gem_concurrent_blit: Add userptr backing storage tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-21 17:48:01 +00:00
Chris Wilson
a4493a54f3 igt/gem_softpin: Fix MI_STORE_DWORD_IMM for gen2-3
Before gen4, MI_STORE_DWORD was just 3 dwords long (cmd, offset, value).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-21 17:48:01 +00:00
Chris Wilson
92caf138f2 tests: Drop the superfluous igt_require_hang_ring()
As the hang injection now itself checks for validity before use, the
tests don't need to do so themselves. Except in certain situations! If
the test forks, it should do requirement checks before the fork (so that
we don't anger the igt gods) and if the test plays around i915.reset
then it needs to do an early igt_require_hang_ring() that is not
affected by the changes to i915.reset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-20 13:13:57 +00:00
Chris Wilson
47b6137842 igt/gem_partial_pwrite_pread: Fix range computation
The range we chose to overwrite in the target had an off-by-one error
that could cause it to compute a size that went past the end of the
buffer (and so trigger EINVAL). Fortuituously with our seed this did not
occur. Whilst changing the range calculation, update the error logging
to include the range information.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-20 07:53:22 +00:00
Chris Wilson
6bada3e2d4 igt/gem_softpin: Remove false dependencies on esoteric features
For softpinning, we do not require either userptr or extended ppgtt, so
remove those requirements and make the tests work universally. (Certain
ABI tests require large GTT, or per-process GTT.)

In the process, make the tests more extensive - validate overlapping
handling more careful, explicitly test no-relocation support, validate
more ABI handling. And for fun, cause a kernel GPF.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-20 07:53:22 +00:00
Chris Wilson
ad9b78f443 igt/gem_exec_alignment: Convert to subtests
Allow both parts (single, many) to be run independently.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-20 07:53:22 +00:00
Chris Wilson
28c33c6f90 igt/gem_exec_alignment: Fix off-by-one in evalation of find_last_bit()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 21:13:24 +00:00
Chris Wilson
6cf9d911ab igt/gem_exec_alignment: Remember to require 48b objects!
In order to actually use the high space we need to set the can-use-48bit
flag.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 21:04:33 +00:00
Chris Wilson
167fb9e7b2 igt/gem_exec_alignment: Test multiple objects with alignment as well
Compute the largest alignment for the most number of objects we can create,
then trying an execbuf with them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 20:48:14 +00:00
Chris Wilson
e7bdc5c916 igt/gem_exec_alignment: Test all possible pot alignments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
Chris Wilson
de45ceb667 igt/gem_ring_sync_loop: Be explicit!
The test just aims to execute batches on alternating rings with a write
target such that every batch must be executed after the previous
completes. This stresses the inter-ring synchronisation, which is
interrupt driven if the gpu does not support semaphores, and so is a
good stress tests for detecting "missed interrupt syndrome". Make that
detection explicit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
Chris Wilson
a8f0963af5 igt/gem_storedw_loop: Add a few more iterations
Whilst still keeping the runtime down, extend the pipeline slightly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19 14:03:15 +00:00
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
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
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
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