30 Commits

Author SHA1 Message Date
Chris Wilson
4b81e9ca7d igt/gem_reloc_vs_gpu: Fix reloc.presumed_offset value
Since the last patched value does not match the presumed relocation
value we submit to the kernel, it occasionally makes mistakes. Also note
that the libdrm interface makes the same presumptive mistake, and would
easily be broken by a threaded environment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77793
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-19 16:44:13 +01:00
Chris Wilson
10552b5ca6 batch: Specify number of relocations to accommodate
Since relocations are variable size, depending upon generation, it is
easier to handle the resizing of the batch request inside the
BEGIN_BATCH macro. This still leaves us with having to resize commands
in a few places - which still need adaption for gen8+.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-30 11:44:51 +01:00
Chris Wilson
982f7eb238 Prepare for 64bit relocation addresses
This reveal that quite a few locations were writing relocation offsets
but only allowing for 32 bit addresses. To reveal such places in active
tests, we also now double check that we do not use more batch space than
declared.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 20:02:10 +01:00
Daniel Vetter
f5daeec724 lib: extract igt_aux.[hc]
And shovel all the various helpers in there.

Also move igt_set_vt_graphics_mode to igt_kms.h since the function is
implemented in igt_kms.c. And it fits better. I kinda missed this in
the prep work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23 13:47:09 +01:00
Daniel Vetter
c03c6ceb29 lib: rename intel_gpu_tools.h to intel_io.h
With the header cleanup we can now give this header a suitable name,
since it now really only contains register access and other I/O
functions and assorted definitions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:34:29 +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
Ben Widawsky
53b0c0431c gem_reloc_vs_gpu: Update for gen8 BLT cmds
NOTE: Some subtests are still failing, but I haven't found the bug yet.
At least this should help QA meanwhile.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-12-05 15:32:37 -08:00
Ben Widawsky
f4dfa37e85 bdw: Update obvious missing blit support
This provides a macro that allows us to update all the arbitrary blit
commands we have stuck throughout the code. It assumes we don't actually
use 64b relocs (which is currently true). This also allows us to easily find
all the areas we need to update later when we really use the upper dword.

This block was done mostly with a sed job, and represents the easier
in test blit implementations.

v2 by Oscar: s/OUT_BATCH/BEGIN_BATCH in BLIT_COPY_BATCH_START

CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
2013-11-06 09:34:35 -08:00
Daniel Vetter
af9d1b5cdb lib: drop return value from igt_drop_caches
No one actually cares, everyone expects it to just work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04 18:11:29 +01:00
Oscar Mateo
5f0ab94c3f lib: Add igt_drop_caches_set()
This is basically a "drop cache" interface to the igt_debugfs
facilities. Also, update existing users.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04 18:05:37 +01:00
Oscar Mateo
a97402e89a tests: Fix "-thrashing" and "-thrash-inactive" distinction
A typo in the relocation tests made both sub-tests perform the
same action: drop *all* caches.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04 18:05:31 +01:00
Daniel Vetter
071e9ca1ca lib: add igt_main macro
In the past new testcases with subtest often forgot to add the call to
igt_exit at the end of their main() function. That is now caught with
a bit more obnoxious asserts, but it's still a nuissance.

This little igt_main macro takes care of that (and also of calling the
subtest machinery initialization code correctly).

If no one objects I'll roll this out for all the simple cases (i.e.
those tests that don't have additional argv parsing on top of the
subtest machinery).

v2: Roll it out across the board.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 21:10:59 +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
5dc424f70d tests/gem_reloc_vs_gpu: some fixes
- Clear the igt_helper_process struct to avoid hitting asserts.
- Fix up the logic for enumerating forked processes.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 13:59:18 +02:00
Daniel Vetter
7c25e8cff1 tests/gem_reloc_vs_gpu: use igt_fork_helper
Now we do a waitpid instead of a simple wait which could eat
the "wrong" child ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10 17:40:06 +02:00
Daniel Vetter
0550092c9a tests: add missing igt_exit() calls
Forgotten while converting to subtests, then copy&pasted.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 13:25:28 +02:00
Daniel Vetter
87c690f9e2 tests: add gem_persisten_relocs
This reproduces the 3.7 relocation regression ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 10:30:21 +02:00
Daniel Vetter
7db283f930 tests/gem_reloc_vs_gpu: add thrashing tests
Using the i915_gem_drop_caches debugfs interface to thrash without
really thrashing.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 17:51:05 +02:00
Daniel Vetter
2c7166eb7a tests/gem_reloc_vs_gpu: add forked versions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 15:19:30 +02:00
Daniel Vetter
e45b7d9474 tests/gem_reloc_vs_gpu: Add faulting reloc tests
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:59:13 +02:00
Daniel Vetter
bd59d60275 tests/gem_reloc_vs_gpu: add interruptible version
Exercise a bug where we've failed to propagate the error code
correctly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 08:58:20 +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
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
a7a80c2c2f tests: fixup new warnings
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 15:50:20 +01:00
Daniel Vetter
09cba27fdc tests/gem_reloc_vs_gpu: fixup this mess
- fixup pitch mess noticed by Chris Wilson.
- we need to diable bo reuse otherwise the kernel won't do the relocs
  (we might get an already gtt-bound batch from the dummy load).

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04 14:19:30 +01:00
Daniel Vetter
b9629f2d8d tests/gem_reloc_vs_gpu: emit special batch on blt ring on gen6+
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04 13:57:51 +01:00
Daniel Vetter
28e3f9c606 tests/gem_reloc_vs_gpu: switch to COLOR_BLT instead of PIPE_CONTROL
Less fancy command that works everywhere. Suggested by Chris Wilons.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04 13:46:43 +01:00
Daniel Vetter
ad6be1f0c9 tests: add gem_reloc_vs_gpu
Tests whether the kernel properly waits for the gpu before
applying a reloc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04 12:08:59 +01:00