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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>