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>
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>
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>
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>
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>
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>
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>
Since we need a lot of memory, trim off the less significant digits for
easier human consumption.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
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>
Some potential callers want to inject a hang into a particular context,
some want to trigger an actual ban and others may or may not want to
capture the associated error state. Expand the hang injection interface
to suit all.
v2: Disable the new kernel API, but push to provide a missing piece of
infrastucture to unbreak compilation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
If we move the igt_require() into the hang injector, this makes simple
test cases even more convenient. More complex test cases can always do
their own precursory check before settting up the test.
However, this does embed the assumption that the first context we are
called from is safe (i.e no i915.enable_hangcheck/i915.reset
interferrence).
v2: A couple of environment variables to skip hang testing or to force
hang injection even if the GPU cannot be reset.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>