14 Commits

Author SHA1 Message Date
Chris Wilson
dcb39b5270 igt/gem_softpin: Repeat tests with signal interruptions
For the long running tests probing error conditions, throwing in the
signal interruptions is a good idea.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18 09:20:06 +00:00
Chris Wilson
af22497ac9 igt/gem_softpin: Check norelocations hold versus suspend/resume
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03 10:19:01 +00:00
Chris Wilson
89f81e0396 igt: More MI_STORE_DWORD fixes for gen5
A few other tests I have updated recently to use MI_STORE_DWORD also need
the magic bit for gen4/5.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-28 16:22:43 +00:00
Chris Wilson
e3b68bb666 lib: Share common __gem_execbuf()
An oft-repeated function to check EXECBUFFER2 for a particular fail
condition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 14:45:18 +00:00
Michał Winiarski
e6ca4bd7cd lib/ioctl_wrappers: Add gem_has_softpin
We can move it from softpin test into lib, and since softpin support is
highly unlikely to go away in-between getparam ioctl calls, let's just
do a single call and store the value.

v2: rebase

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-01-25 19:44:34 +01:00
Michał Winiarski
52b5d5016e lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT param
No functional changes.
While I'm here, let's also rename gem_uses_aliasing_ppgtt (since it's
being used to indicate if we are using ANY kind of ppgtt) and introduce
gem_uses_full_ppgtt to drop some unnecessary code from tests that were
previously calling getparam directly instead of using ioctl wrapper.

v2: drop gem_uses_full_48b_ppgtt since it's no longer used anywhere,
    s/48b/64b (Chris)
v3: rebase

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-01-25 19:44:31 +01:00
Chris Wilson
9bf4e19125 igt/gem_softpin: Keep last_handle around to vary hole generation
If we don't close the handle from the last pass, we don't free up the
previous pass's vma immediately, changing the hole allocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-24 15:35:31 +00:00
Chris Wilson
c5b0293ca3 igt/gem_softpin: Exercise snoop+uncached abutting
snooped objects are not allowed to abutt uncached objects on older gen
(!llc and global GTT) or else the GPU may hang if it prefetches across a
page boundary into a different memory type (i.e. CS reading from snoop).
The kernel should be checking the alignment rules as normal.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-23 18:35:20 +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
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
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
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
Mika Kuoppala
5a8d063e42 tests/gem_softpin: Fix compiler warning on 32bit systems
We get build error as we try to cast from ptr to integer
of different size on 32 bit platforms. Use unsigned long
as the cast, it will work with both 32 and 64 bit
systems.

Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
2015-12-14 10:23:58 +02:00
Vinay Belgaumkar
be2d5188f6 tests/gem_softpin: New tests for softpin feature
These tests exercise the userptr ioctl to create shared buffers
between CPU and GPU. They contain error and normal usage scenarios.
They also contain a couple of stress tests which copy buffers between
CPU and GPU. These tests rely on the softpin patch in order to pin buffers
to a certain VA.

Caveat: These tests were designed to run on 64-bit system. Future work
includes adding logic to ensure these tests can run on 32-bit systems with
PPGTT support. Some tests are currently disabled for 32-bit systems for that
reason.

v2: Added cc and signed-off-by fields

v3: Fixed review comments, added helper functions. Removed userptr error
scenarios covered by existing userptr tests. Modified stress test to have
100K buffers, it now runs for ~30 mins, checks every element has been written
to correctly, and pins buffers at different VMAs.

v4: Changed name to gem_softpin

v5: More fixes. Removed the file based tests, will move them to userptr tests.
Added a function that validates appropriate PPGTT support before running tests.
Optimized stack space and memory footprint in stress test. Removed the eviction
test, will add it back after verifying proper functionality.

v6: Split basic test into userptr and bo
Fixed some coding style issues.

v7: Enhanced invalid vma pinning test to verify 32-bit PPGTT functionality.
Enabled the test for 32-bit PPGTT systems, and verify pinning fails above
32-bit addresses. Enhanced the high adress pinning test to ensure pinning
fails when EXEC_OBJECT_PINNED flag is not used. Some more cosmetic fixes to
close buffer handles. Changed userptr function to used synchronized operations.

v8: Minor change to high address pinning test as per comment.

v9: Skip the tests if softpin support is not present.

v10: Removed trailing white spaces.

v11: Keep alphabetical order in Makefile and gitignore; update error code
returned while trying to pin above the max vm size (EINVAL); test attempt
to pin above 4GB without the support 48b flag.

Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v11)
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2015-12-09 10:27:12 +00:00