82 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
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
Thomas Wood
80d2c9bf82 tests: convert simple tests to use igt_simple_init_parse_opts
Convert simple tests to use igt_simple_init_parse_opts if they require
extra options.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23 15:23:54 +01:00
Daniel Vetter
5a98fe9d4a lib: Add argc/argv to igt_simple_init
There's a pile of ideas around to add generally useful options like
--debug to all igt tests. Or unify the runtime behaviour between
simple and subtest tests a bit more.

The first step to get there is to add argc/argv to igt_simple_init so
that we can get at the argument list.

Cc: Tim Gore <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-14 15:03:59 +02:00
Tim Gore
8abca6fd14 intel-gpu-tools: add igt_core init func calls to some tests
igt-core.h/c provides some macros and initialisation
functions to support the tests but some of the single
tests do not use these. Modifying these tests to use
the igt_simple_main macro and igt_simple_init function
is the first step towards a consistent command line
across all tests.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-06-20 14:12:37 +01:00
Daniel Vetter
c9c554594e tests: run igt.cocci
Re-run with correct igt_fail rules. Again manually fixup missing
includes for igt_core.h.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:27:59 +02:00
Daniel Vetter
6b73a9a288 tests: Don't use stderr for informational messages
These should go to stdout instead. The next patch will clean this up
with cocci, so no change from fprintf(stdout, to printf( here.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:09:05 +02:00
Ville Syrjälä
fa86e33ccc tests/gem_stress: Fix rendercopy vs. keep_gpu_busy on gen6+
If the hardware has a blt ring blits aren't allowed on the render ring.
Trying to execute blits on the render ring results in a GPU hang.

Flush outstanding blits from keep_gpu_busy() before calling rendercopy()
so that they don't end up on the render ring.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-28 19:28:39 +03: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
Daniel Vetter
0e22f14ed6 tests|lib: remove assert.h includes
Only the igt core and non-test tools should have asserts to catch
internal errors, tests and helper libraries should all user igt_asert
instead.

Fix things up where assert instead of igt_assert was used.

One tiny step towards header sanity.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 19:39:46 +01:00
Daniel Vetter
53a4d9e982 lib/intel_batchbuffer: igt_ prefix for rendercopy/mediafill funcs
Now everything is prepared to pour some neat api docs over this all.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:49:02 +01:00
Daniel Vetter
83a4c7d3eb lib/intel_batchbuffer: igt_ namespace for the buffer structure
Step one to properly namespace the rendercpy/mediafill functions. Als
give the buf_height/width helpers a proper igt_ prefix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:44:48 +01:00
Daniel Vetter
7dc0001f3d lib: make rendercopy.h an internal header
And move the public interfaces into intel_batchbuffer.[hc].

A bit messy since we are fairly inconsistent with our header #include
handling.

Also exclude rendercopy.h from the documentation.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:31:15 +01:00
Ville Syrjälä
725da6ee74 rendercopy: Pass context to rendercopy functions
rendercopy does the batch buffer flush internally, so if we want
to use it with multiple contexts, we need to pass the context
in from caller.

v2: Modify rendercopy_gen8 as well

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-27 16:21:28 +02: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
14e12b8008 tests/*: scrap get_num_fences
Just use gem_available_fences directly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-17 00:13:47 +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
Ville Syrjälä
1d1f68316f tests: Use gem_available_fences()
lib/drmtest.c provides gem_available_fences(). Use it where
appropriate.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-09 20:21:13 +02:00
Daniel Vetter
0d7139af58 tests/gem_stress: prevent segfault in getopt parsing
Needs a terminal element in the long option array.
2012-11-29 15:01:09 +01:00
Daniel Vetter
64f669f7a9 lib: extract get_render_copyfunc
Otherwise we won't update all the tests if we add new render
copyfuncs.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-29 14:59:57 +01:00
Ben Widawsky
beb1bb8fd2 gem_stress: use the gen7 rendercopy
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-28 22:52:04 -07:00
Daniel Vetter
fbfe374b28 lib: extract drmtest_permute_array
Lots of tests need to create havoc to LRUs in the kernel or otherwise
need to shuffle things around a bit. So make a small array permutation
function available.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-22 20:09:54 +01:00
Daniel Vetter
1357427fd0 gem_stress: s/gem_stress.h/rendercopy.h 2012-01-18 17:53:12 +01:00
Daniel Vetter
f7c2dab5bd gem_stress: move keep_gpu_busy stuff out of render copy functions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-18 17:51:48 +01:00
Daniel Vetter
b9fe673f49 gem_stress: move option struct out of header
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-18 17:47:33 +01:00
Daniel Vetter
9f20ecc3b3 gem_stress: add width/height arg to rendercpy functions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-18 17:46:00 +01:00
Daniel Vetter
699d30950f gem_stress: move a few things out of gem_stress.h
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-18 01:12:52 +01:00
Daniel Vetter
f1de285e7e gem_stress: pass batch as arg to render_copy functions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-18 00:55:49 +01:00
Daniel Vetter
72f74ce355 gem_stress: remove logical_tile_no arg from render_copy functions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-18 00:36:37 +01:00
Daniel Vetter
205510badf gem_stress: add buf->size
Removes a dependency on gem_stress internals from the rendercpy
functions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-18 00:34:15 +01:00
Daniel Vetter
7f944349ef lib/drmtest: extract gem_aperture_size
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-15 17:14:56 +01:00
Daniel Vetter
cbaa8a389e lib/drmtest: extract helpers for signal interruptions
Also add some hackish stat to check it works.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-11 15:33:00 +01:00
Daniel Vetter
673e6b220a lib/drmtest: extract gem_set_domain and gem_sync
gem_sync just does a gtt sync by using set_domain(GTT, GTT).

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 16:05:34 +01:00
Daniel Vetter
aa67b22e42 lib/drmtest: extract gem_set_tiling
Way too much copy-pasting going on here.

Also fix a compiler warnings in gem_stress while fixup things up.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 14:59:58 +01:00
Chris Wilson
ceb9f7d934 tests/gem_stress: silence the compiler by using '%zu' for size_t
gem_stress.c: In function ‘main’:
gem_stress.c:980:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat]
2011-12-14 17:39:42 +00:00
Daniel Vetter
7af82bb0e5 tests: implement snb+ XY_SETUP_CLIP_BLT workaround
Better safe than sorry.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-11-27 02:39:14 +01:00
Daniel Vetter
74670c7bb9 gem_stress: ducttaping mandatory
In other news: We've been missing a unmapping_mapping_range somewhere
in the kernel. But lazy me never came around to digging up the real
cause.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-07-17 23:33:27 +02:00
Chris Wilson
75f7e81fbc gem_stress: Assert we have no pending ops when using the CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-08 14:04:24 +01:00
Chris Wilson
4227da8c3c gem_stress: Add an option to test handling of signals
As signals cause the syscalls to be interrupted, we often need to clean
up partial state before returning to userspace. Often a source of
unamusing bugs, so encourage gem_stress to provoke them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-02 09:13:20 +01:00
Daniel Vetter
336f85dafb gem_stress: some stats about incoherencies
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 22:02:52 +02:00
Daniel Vetter
1007956680 gem_stress: option to disable render copyfunc check
Too noisy - which is an another way of saying too broken :(

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 20:30:31 +02:00
Daniel Vetter
5b253cee37 gem_stress: option for tile_size
I want to know how large these corruptions can get!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 20:30:30 +02:00
Daniel Vetter
c0f34338e7 gem_stress: option to set tiles per buffer
gem_stress -p1 is much more evil than gem_stress -c1, it also manages
to tear appart untiled workloads!

Now duct-taping over it still works (--apply-duct-tape) ... hm.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 13:18:35 +02:00
Daniel Vetter
6daa883fa3 gem_stress: option to continue despite failures
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 00:35:01 +02:00
Daniel Vetter
9649dd7ef0 gem_stress: option to override the number of rounds to complete
gem_stress -c 1

... sometimes takes a while to hit a problem.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 00:58:45 +02:00