23 Commits

Author SHA1 Message Date
Ville Syrjälä
b8a77dd6c8 Make gem_mmap__{cpu,gtt,wc}() assert on failure
Rename the current gem_mmap__{cpu,gtt,wc}() functions into
__gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name
that assert that the pointer is valid. Most callers will expect a valid
pointer and shouldn't have to bother with failures.

To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g'
over the entire codebase.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 19:16:26 +03:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
Apply the new API to all call sites within the test suite using the following
semantic patch:

// Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls
@@
identifier i =~ "\bdrm_open_any\b";
@@
- i()
+ drm_open_driver(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_master\b";
@@
- i()
+ drm_open_driver_master(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_render\b";
@@
- i()
+ drm_open_driver_render(DRIVER_INTEL)

@@
identifier i =~ "\b__drm_open_any\b";
@@
- i()
+ __drm_open_driver(DRIVER_INTEL)

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Thomas Wood
804e11f40d lib: add a single include header
Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21 09:37:10 +01:00
Chris Wilson
fc69bb0de5 igt/gem_exec_big: Check 64bit relocation values
On gen8, we should check that the full 64bit relocation value is
correct, and we should be sure to poison the relocation offset between
runs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-27 21:12:20 +01:00
Chris Wilson
3ea7a28072 igt/gem_exec_big: Don't try to repeatedly munmap(NULL)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-14 14:34:16 +00:00
Chris Wilson
cdbc514b41 igt/gem_exec_big: Use mmap(wc) to speed up verification
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-12 12:59:20 +00:00
Chris Wilson
b65903b7db igt/gem_exec_big: Also test a large batch with a large number of relocs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-12 12:59:20 +00:00
Chris Wilson
1dddf32df9 igt/gem_exec_big: Increase stress
We should be able to execute batches up to the full GTT size (give or
take fragmentation), so let's try!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 12:24:40 +00:00
Thomas Wood
b2ac2642a9 tests: add more test descriptions
Add more test descriptions based on exiting comments.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04 16:07:55 +00:00
Daniel Vetter
236d6bd2d3 tests/gem_exec_big: Re-add gem_sync
We need this to avoid hitting the slowpath and ending up with a
presumed_offset == -1. Regression reported by PRTS, bisected to

commit eb36fc993d7ae1988c80ba5b767989059c91d0ec
Author:     Chris Wilson <chris@chris-wilson.co.uk>
AuthorDate: Mon Jun 16 10:49:16 2014 +0100
Commit:     Chris Wilson <chris@chris-wilson.co.uk>
CommitDate: Mon Jun 16 10:51:02 2014 +0100

    igt/gem_exec_big: Update to new igt_assert_eq

    Use igt_assert_eq for better test output on failures.

    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

v2: igt_warn_on unexpected reloc offsets.

Cc: shuang.he@intel.com
Acked-by: Chris Wilson <chris@chris-wilson.co.uk> (on irc)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-19 10:15:42 +02:00
Chris Wilson
eb36fc993d igt/gem_exec_big: Update to new igt_assert_eq
Use igt_assert_eq for better test output on failures.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 10:51:02 +01:00
Daniel Vetter
e49ceb8690 lib: unnecessary header removal for drmtest.h, part 1
Brought a few missing headers to light in ioctl_wrappers.h, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:07:37 +01:00
Daniel Vetter
ef9745b7fa lib: igt_simple_main/init for subtest-less tests
Atm only used to print the version information.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-10 09:41:48 +01:00
Daniel Vetter
f3c54d0cb4 tests: use igt_assert/igt_require more
With the new _f variants we can replace almost all of them.

Also remove a ton of checks for argc != 1, they're a bit useless ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-25 14:37:07 +02:00
Daniel Vetter
225a91bc54 lib/drmtest: include sys/mman.h from drmtest.h
We need it for mmapping to get at PROT_READ|WRITE anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:38:29 +02:00
Daniel Vetter
5e25fcc285 tests: use igt_fail instead of exit(param != 0)
Mostly a sed job with too manual fixups:
- one case of using _exit instead of exit
- and one case which under some conditions use 77, so convert that
  check to an igt_skip.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:15:17 +02:00
Daniel Vetter
83440953e5 tests: s/assert/igt_assert
Just a wholesale rollout for now, we can refine later on.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Daniel Vetter
1caaf0a6b6 s/drmtest_/igt_/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:20:22 +02:00
Daniel Vetter
7847ea2965 tests: use drmtest_skip to check for rings
To simplify things add a set of gem_check_<ring> functions which take
care of this. Since I've opted for static inlines drmtest.h grew a few
more header includes which was a neat opportunity to dump a few redundant
#defines.

This kills all the skipped_all hand-rolled logic we have.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:17:58 +02:00
Damien Lespiau
5fa15f79d0 tests: Black list tests we don't want to run on simulation
Let's start by a small set of tests, to eventually consider running
more.

The current list should then be:

gem_mmap
gem_pread_after_blit
gem_ring_sync_loop
gem_ctx_basic
gem_pipe_control_store_loop
gem_storedw_loop_render
gem_storedw_loop_blt
gem_storedw_loop_bsd
gem_render_linear_blits
gem_tiled_blits
gem_cpu_reloc

gem_exec_nop
gem_mmap_gtt

v2 add (Daniel Vetter)
gem_exec_bad_domains
gem_exec_faulting_reloc
gem_flink
gem_reg_read
gem_reloc_overflow
gem_tiling_max_stride
prime_*

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:49:02 +01:00
Daniel Vetter
1a83c0990a tests/gem_exec_big: fixups
- don't emit a self-modifying batch, the kernel doesn't like those
- also change the buffer size, to exercise all corner-cases of the
  sg_table stuff
2012-10-09 22:47:59 +02:00
Daniel Vetter
fa6b0208ab tests/gem_exec_big: add a reloc at the end of the big batch
Since that's the other place where the broken get_page blows up.

Actually it seems to only blow up on specific pages ...
2012-10-09 19:53:52 +02:00
Daniel Vetter
1431938c5c tests: add big batchbuffer test
... and use it in the hangman to stress the error_state capture a bit more.

Uncovered a bug in the obj->pages ->obj->sg_list rework.
2012-10-09 19:29:02 +02:00