19 Commits

Author SHA1 Message Date
Daniel Vetter
4306538d1d tests: Sprinkle missing igt_exit() where needed.
Yay for breaking piles of tests.

This regression has been introduced with

commit 5782eca1e19e85a04ad402fa4094aa1b5f9c53ce
Author: Tim Gore <tim.gore@intel.com>
Date:   Wed Oct 1 13:25:20 2014 +0100

    lib/igt_core.c: disable lowmemorykiller during tests

Cc: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-02 11:34:55 +02:00
Chris Wilson
f2775039b1 igt/gem_userptr_blits: Test interruptible create-destroy
In order to exercise https://bugs.freedesktop.org/show_bug.cgi?id=84207
we need to interrupt the mmu_notifier_register with a signal. This is
likely to be quite difficult, but let's just try running the
create-destroy test in an interruptible loop for 5s.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-26 10:29:22 +01:00
Chris Wilson
855dc6284d igt/gem_userptr_blits: GTT mmaping a userptr requires llc
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83790
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 09:10:01 +01:00
Tvrtko Ursulin
8b3ded404c igt/gem_userptr_blits: Fix multi-threaded mm stress tester
Two parts to the fix:
  1. Do not use pthread_cancel since not available on Android.
  2. Do not assert in the thread since that does not get propagated
     to the process. Rather pass out any failures so we know test
     did not work as expected.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Tim Gore <tim.gore@intel.com>
Reviewed-by: Tim Gore <tim.gore@intel.com>
2014-07-24 09:31:31 +01:00
Tvrtko Ursulin
700bdf1401 igt/gem_userptr_blits: Fix forked access test
copy() blit helper assumes a certain object size much larger than a page size.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-24 08:46:38 +01:00
Chris Wilson
784b77257b igt/gem_userptr_blits: New tests, old issues
Introduce a new test to keep that we clean up on process exit (if the
userptr is busy or it has been gtt mmapped). This revealed a few bugs in
the existing tests so clean those up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-21 16:32:42 +01:00
Daniel Vetter
43784baa13 tests/gem_userptr_blits: Polish
- Drop return values for test functions - we rely on the implicit
  control flow from igt_ checks.
- Don't use assert directly, this upsets the test flow logic (and
  results in a CRASH result instead of FAIL).

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-15 10:18:28 +02:00
Tvrtko Ursulin
abbfecb015 tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops
Userptr v23 was not thread safe against memory map operations and object
creation from separate threads. MMU notifier callback would get triggered
on a partially constructed object causing a NULL pointer dereference.

This test excercises that path a bit. In my testing it would trigger it
every time and easily, but unfortunately a test pass here does not guarantee
the absence of the race.

v2: Added explicit cancellation point and removed the stop flag.
    Use only igt_assert().

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-15 10:11:27 +02:00
Chris Wilson
b3d038a2b9 igt/gem_userptr_blits: Add missing RAM check before coherency tests
-ENOCOFFE.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-14 10:33:55 +01:00
Chris Wilson
52ac9a4b57 igt/gem_userptr_blits: Add missing RAM check before coherency tests
References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-14 10:30:36 +01:00
Chris Wilson
9b6ae3cb6f igt/gem_userptr_blits: Verify that userptr bo work on unshared memory
If the parent passes a userptr to some private memory, we expect to
still be able to use the userptr in the child.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-11 10:41:29 +01:00
Chris Wilson
9344aa78e8 igt/gem_userptr_blits: Shared memory allocations
The forked tests allocate the bo (and thus for userptr, the memory) in
the parent and pass them to all children. The difference for userptr is
that we allocate system memory which the kernel then copies into each
child. As the children need to access the memory for their checks, it
does need to be shared - so allocate the userptr from shared memory!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80208
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-11 10:41:28 +01:00
Chris Wilson
a384e55b49 igt/gem_evict_everything: Move assertion
If we move the assertion from out of the callback, we can get a much
more useful error message.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-03 07:35:54 +01:00
Chris Wilson
9911f3f0cf igt/gem_userptr_blits: Fix up last minute API changes
When the patch was merged, the ioctl numbers had to be adjusted to leave
no holes. Also there was a final piece of munging of the API to
downgrade unsynced userptr for export over dma-buf.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-22 10:22:04 +01:00
Daniel Vetter
0b7ce4ac29 tests: Use igt macros more
Often just folding together of the common if (cond) printf;
abort|igt_skip|igt_fail; pattern. But in a few cases I've ripped out
more since the igt macros will already print the condition and errno.

A few tests where more work (like ripping out return codes en masse)
is needed left as-is.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 09:56:53 +02:00
Daniel Vetter
e624fa8a2e tests: sprinkle igt logging
All the cases that simply dump some debug information and couldn't be
converted to some of the fancier macros.

Some information output removed when it's redundant with the subtest
status.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 00:36:04 +02:00
Daniel Vetter
e36c896a71 test: Fixup for the previous patch
Oops, failed to git add.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:57:22 +02:00
Daniel Vetter
1b55886c4b test/gem_userptr_*: Fix compile fail
Also shut up warnings. Those revealed incorrect usage of local
variables in conjunction with igt_fixture/igt_subtest. Since those use
longjmps we need to move the out of the stackframe those magic blocks
are declared in.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:54:08 +02:00
Tvrtko Ursulin
863c0730f3 tests/gem_userptr_blits: Expanded userptr test cases
A set of userptr test cases to support the new feature.

For the eviction and swapping stress testing I have extracted
some common behaviour from gem_evict_everything and made both
test cases use it to avoid duplicating the code.

Both unsynchronized and synchronized userptr objects are
tested but the latter set of tests will be skipped if kernel
is compiled without MMU_NOTIFIERS.

Also, with 32-bit userspace swapping tests are skipped if
the system has a lot more RAM than process address space.
Forking swapping tests are not skipped since they can still
trigger swapping by cumulative effect.

v2:
   * Fixed dmabuf test.
   * Added test for rejecting read-only.
   * Fixed ioctl detection for latest kernel patch.

v3:
   * Use ALIGN macro.
   * Catchup with big lib/ reorganization.
   * Fixed up some warnings.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:48:41 +02:00