4139 Commits

Author SHA1 Message Date
Daniele Ceraolo Spurio
0e388f409a tests/gem_exec_params: test all valid execution flags
The control subtest has been extended to check the execution flags for
all the rings that are present in the HW.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-10 09:16:33 +01:00
Tomeu Vizoso
2629f3aeef lib: Fix build when vc4 headers are present
Automake seems to not like variable assignments indented with tabs.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: 9e5478dc4345 ("lib: Only compile igt_vc4 is we have it")
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-09 16:25:35 +01:00
Daniel Vetter
9e5478dc43 lib: Only compile igt_vc4 is we have it
Unbreaks compilation fail.

Also appease gcc in gem_exec_basic because.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-02-09 09:46:03 +01:00
Eric Anholt
467a9fac9b igt/vc4_wait_bo: Add tests with rendering performed.
These caught an unexpected bug with clear colors (we'd get the last
executed clear's color in our new BO), while failing to catch the bug
I'd been hoping to find all along.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
e7e094f444 igt/vc4_create_bo: Test various paths in BO creation.
create-bo-0 fails on the current kernel, and it's something I want to
fix.

v2: Use do_ioctl_err().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
59f98997ab igt: Add a helper function for creating VC4 BOs.
v2: Use do_ioctl().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
b8badc2436 igt: Add a helper function for mapping VC4 BOs.
v2: Use do_ioctl().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
4880e13d04 igt: Add a helper function for getting a VC4 BO that's been drawn to.
v2: Use do_ioctl().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
7f421acb60 igt/vc4_wait_bo: Add a test for VC4's wait-for-BO ioctl.
The pad subtest fails currently.

v2: Use do_ioctl() and do_ioctl_err().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
d333a0ed69 igt/vc4_wait_seqno: Add a test for VC4's wait-for-seqno ioctl.
v2: Use do_ioctl_err().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
3f83f07039 igt: Add support for DRIVER_VC4 flags on tests.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Eric Anholt
ceca9ef8d0 configure.ac: Test for libdrm_vc4 and build vc4 tests based on it.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-08 16:34:13 -08:00
Damien Lespiau
8d441ee491 list-workarounds: Fix python 2 print statement
That script is a python 3 script, so we can't use the python 2 print
statement, it's a function now.

I missed it in the review because reviewing a diff without additional
context gives you a partial story.

Cc: Sameer Kibey <sameer.kibey@intel.com>
Cc: Dylan Baker <baker.dylan.c@gmail.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2016-02-08 12:01:48 +00:00
Kibey, Sameer
fb9df0e510 list-workarounds: Extend the script to Mesa
Updated the list-workarounds script so that it
can parse Mesa directory if provided. Moved the
common code to a separate function to allow
reuse for both kernel and mesa.

The new command line is:
Usage: list-workarounds [options] path-to-kernel
       -k path-to-kernel -m path-to-mesa

The legacy usage is retained to avoid breaking
backwards compatibility. New parameters -k and
-m are added for the new behavior.

Either kernel or mesa or both paths can be specified.
If path-to-mesa is invalid, error is reported.

Signed-off-by: Sameer Kibey <sameer.kibey@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
2016-02-05 23:44:38 +00:00
Chris Wilson
6b3c832cfb igt/gem_workarounds: Convert to real GPU hang injection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 17:38:02 +00:00
Chris Wilson
6f7372f664 igt/gem_exec_alignment: Fix off-by-one in buffer objects
When reducing the buffer count to fit into the aperture whilst aligned,
remember to adjust the pointer so that the batch is the last object!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 16:13:23 +00:00
Chris Wilson
b081257d74 igt/gem_exec_alignment: Mark batch buffer as also requiring 48B
If we completely fill the lower 4G of address space with our alignment
objects, then we also need to mark the batch as requiring high-address.
Though the kernel should be reordering in this case...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 15:35:58 +00:00
Chris Wilson
ffbc59a3ef lib: Silence a common debug message when creating a context
In context tests, we may create thousands of contexts, the noise from
each requirement passing drowning out the real information. Let's only
do the requirement test (to detect if contexts are meant to be supported
or plain broken) only on the error path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 13:31:29 +00:00
Chris Wilson
e7faf33ec7 igt/gem_ctx_thrash: Rewrite to avoid extraneous allocations
The goal of the test is to exercise what happens when we fill the Global
GTT with the contexts. To that end, we only need to allocate 2/4GiB of
context objects, and can forgo filling each context with buffers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94005
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05 09:12:31 +00:00
Chris Wilson
0e96238bf3 igt/gem_userptr_blits: Limit amount of mlocked surfaces
When testing surface eviction we don't need that many surfaces as we
mlock surplus memory. Reducing the number of surfaces speeds up the test
and prevents a couple of integer overflow bugs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94004
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 17:48:16 +00:00
Chris Wilson
7b5a818581 igt/gem_reset_stats: Convert from stop-rings to real hang injection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 15:25:40 +00:00
Chris Wilson
9cc2b1336b igt/gem_ctx_exec: Convert from stop-rings to a real GPU hang/reset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 11:22:00 +00:00
Chris Wilson
38fe49d9a8 tests/drv_hangman: Convert to using central list of engines
Rather than encoding our own list of engines, use the common one for
greater coverage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 11:22:00 +00:00
Chris Wilson
01e467a631 igt/drv_hangman: Make the batchbuffer check more robust
All the external viewer expects of the GPU error capture is to extract
the exact batch that triggered the hang. Everything else is internal
detail to aide in post-mortem debugging of the kernel driver (i.e.
subject to change) and not of the userspace portion (under control of
the test).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 11:08:07 +00:00
Chris Wilson
0753057446 igt/drv_hangman: Inject a true hang
Wean drv_hangman off the atrocious stop_rings and use a real GPU hang
instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:36 +00:00
Chris Wilson
8f6957a05a igt/gem_ringfill: Add exercising the default-ring to basic testing
ringfill generates a few very common errors when submitting requests,
and historically these have been where we have had many implementation
bugs, repeated over and over again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:35 +00:00
Chris Wilson
348742ec0d igt/gem_streaming_writes: Set bb start alignment to 64b for Ironlake
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:35 +00:00
Chris Wilson
3992babd98 igt/gem_busy: Refactor to use gem_require_ring()
Now that gem_require_ring() does the right thing with BSD1/BSD2 we can
use it to our advantage here.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04 09:49:29 +00:00
Paulo Zanoni
3005665ead tools/intel_residency: use setitimer instead of {,u}alarm
It seems that Android doesn't have ualarm(). Let's use setitimer()
instead.

The tool still won't compile on Android due to igt_fb requiring Cairo,
but we're supposed to solve this in another patch since our igt_fb
calls don't actually require Cairo.

Reported-by: Derek Morton <derek.j.morton@intel.com>
Tested-by: Derek Morton <derek.j.morton@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:31:42 -02:00
Paulo Zanoni
ec5deb218d tests/pm_rpm: find an appropriate CRTC instead of hardcoding CRTC 0
BSW does not allow CRTC 0 to be used on every connector, so we need to
write code to actually find a suitable CRTC.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93124
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:31:18 -02:00
Paulo Zanoni
84157ad1b4 tests/pm_rpm: remove POWER_DIR definition
Unused ever since we moved some code from pm_rpm.c to lib/. This is
currently defined inside igt_aux.c.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:30:55 -02:00
Paulo Zanoni
7ca55f433c tests/igt_fb: rename igt_get_all_formats to igt_get_all_cairo_formats
I recently had this discussion with Daniel where I didn't want to use
igt_drm_format_to_bpp() because it uses the format_desc array, and
igt_fb currently assumes that all the format_desc formats have a
matching valid Cairo format, so I wouldn't be able to easily add
formats such as ARGB2101010.

The function that has the assumption mentioned above is
igt_get_all_formats: its current users call igt_get_all_formats, and
then call cairo-dependent functions, such as igt_get_cairo_ctx on the
returned formats.

In order to document the current behavior and prevent any problems in
case we start adding new formats without matching Cairo versions to
format_desc, rename igt_get_all_formats to igt_get_all_cairo_formats
and make it explicitly check for CAIRO_FORMAT_INVALID.

Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:30:15 -02:00
Paulo Zanoni
55229f173e lib/igt_fb: fix igt_get_all_formats documentation
We give the callers a const pointer to a static variable that we reuse
between multiple calls: they're not supposed to free it, and they
don't free it today.

Fix the documentation and leave the still reachable pointer instead of
reworking the function and its callers.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:29:51 -02:00
Paulo Zanoni
12c1eb653f lib/igt_draw: use igt_drm_format_to_bpp()
Don't reimplement the function.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:29:30 -02:00
Paulo Zanoni
0432201e6d kms_frontbuffer_tracking: standardize the used FB sizes
We want to make sure that both tiled and untiled buffers have the same
size for the same width/height/format. This will allow better control
over the failure paths exercised by our tests: when we try to flip
from tiled to untiled, we'll be sure that we won't execute the error
path that checks for buffer sizes.

v2: Use the new igt_calc_fb_size() instead of implementing our own
size calculation (Daniel).
v3: We can now use igt_drm_format_to_bpp() (Daniel).

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:29:08 -02:00
Paulo Zanoni
096e020743 kms_frontbuffer_tracking: use igt_drm_format_to_bpp()
The only format from fb_get_bpp() not supported by
igt_drm_format_to_bpp() is ARGB2101010, but we don't really use it in
kms_frontbuffer_tracking, so we can do the switch.

Adding ARGB2101010 to igt_fb won't be that simple since there's no
equivalent Cairo format, and igt_fb users assume that all formats
known by igt_fb have equivalent Cairo formats.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:28:47 -02:00
Paulo Zanoni
be6f3fadaf lib/igt_fb: make the automatic buffer sizes/strides smaller
The big motivation behind this patch is that the current power-of-two
granularity from igt_fb is way too big. There was more than one
occasion where I had to work around this problem on
kms_frontbuffer_tracking, and during my last workaround I was
requested to just make igt_fb use more minimal buffers.

I also need to export the size computation function so I won't need to
reimplement it inside kms_frontbuffer_tracking.

v2:
 - Fix the Yf sizes (Ville).
 - Don't change the Gen 2/3 behavior for both tiled and non-tiled.
v3:
 - Edit the commit message, clarify that v1 was wrongly treating gen
   2/3 non-tiled as tiled (Chris).

Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:28:11 -02:00
Chris Wilson
d63e72f0ad igt/gem_cs_tlb: Increase BB start alignment to 64bytes
Ironlake requires 64byte alignment for its MI_BATCH_BUFFER_START.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-28 17:03:21 +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
3ec8b1d28e igt/gem_ringfill: Set MI_MEM_VIRTUAL flag for gen<6
bit22 of MI_STORE_DWORD is confusing as the meaning changed between
physical/virtual addressing in early gen and GTT/ppGTT in later gen. It
looks like gen4 and gen5 still need the flag.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-28 14:04:07 +00:00
Chris Wilson
eaa03678b0 lib: Hide BSD1/BSD2 rings on hardware without BSD2
The kernel happily lets us run on I915_EXEC_BSD2 even with such hardware
existing. Sigh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-28 14:04:07 +00:00
Chris Wilson
506d683da1 tests: Add gem_exec_reloc
The first steps towards basic relocation handling. In today's edition,
we ask how well does the kernel fare if we pass it relocations via
mmappings of our buffer objects.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-28 12:18:22 +00:00
Chris Wilson
d18d1eca81 igt/gem_reset_stats: Convert residual calllers of gem_exec() to gem_execbuf()
Missed from e3b68bb66683ad4cb4c80df904a3a21c98a2b6c2 due to rebasing
fun.

gem_reset_stats.c: In function 'inject_hang_ring':
gem_reset_stats.c:227:19: error: implicit declaration of function 'gem_exec' [-Werror=implicit-function-declaration]
gem_reset_stats.c:227:2: warning: nested extern declaration of 'gem_exec' [-Wnested-externs]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 20:23:45 +00:00
Chris Wilson
a1b47ef6ae igt/gem_concurrent_blit: Disable libdrm buffer cache for child inheritance
It just ends up with buffer leaks all over. On the flip side, it does
allow us to inherit the bufmgr directly without worry of stomping over
the aliased entries (and causing double closes).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 19:59:16 +00:00
Chris Wilson
37f4da0d98 igt/gem_concurrent_all: Pass buffer data down
In order reduce the number of parameters being passed everywhere, whilst
simultaneously making more information available to the lower levels,
pass the struct buffers around.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 19:59:16 +00:00
Chris Wilson
5dea5deffc igt/gem_cs_prefetch: Check each ring
Since each engine has its own ring, each is subject to CS prefetching
and has its own layout that needs probing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 18:34:05 +00:00
Chris Wilson
de70769cc0 Add I915_EXEC_DEFAULT to list of known engines
I dropped this from the list of rings for some tests when refactoring to
a common array. Almost all of the tests should be run over the default
exec engine to ensure ABI backwards compatiblity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 16:42:10 +00:00
Chris Wilson
d130899084 igt/gem_sync: Use common array of rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 14:47:19 +00:00
Chris Wilson
dd6b45235b igt/gem_ringfill: Use common array of rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 14:47:19 +00:00
Chris Wilson
8cd5289334 igt/gem_cs_tlb: Use common array of rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 14:47:19 +00:00