3459 Commits

Author SHA1 Message Date
Daniel Vetter
d5579f472e tests/drv_suspend: Unrename tests
Renaming tests massively confuses QA's test result tracking and
blacklisting. So except when really good reasons are around we
shouldn't do it.

Here I think just adding the -hibernat suffix and leaving test names
unchanged is enough.

Cc: David Weinehall <david.weinehall@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-26 16:32:43 +01:00
Thomas Wood
26f40811d7 lib: small documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-25 16:59:22 +00:00
Thomas Wood
d9224c3479 lib/tests: update .gitignore 2015-02-25 16:59:22 +00:00
Thomas Wood
4ff4ea601a lib: print the signal name to stderr when handling a signal
Print the received signal name to stderr when handling a signal. This
uses an array of handled signal names since strsignal() only provides
descriptions.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-25 16:50:13 +00:00
Thomas Wood
aecad4fc2e tests: remove extra file
Remove a file accidentally added in commit 6f582f7 (tests: Add
gem_ctx_param_basic).

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-25 16:48:25 +00:00
Thomas Wood
8fb19782f8 lib: remove handled option arguments from argv
Remove options from argv that have been handled by getopt to allow
additional non-option parameters to be processed in the test application.

This fixes issues when using options such as --debug with tests that accept
additional non-option parameters.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-25 16:48:25 +00:00
Thomas Wood
55cc132b32 lib: use defines for igt_simple_init and igt_subtest_init
Using defines removes an extra function call and prepares for changes
to the command line argument handling.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-25 16:48:25 +00:00
Thomas Wood
efddb93680 tests: improve pipe enumeration
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-25 16:48:25 +00:00
Praveen Paneri
0f3a5809e7 tests/gem_bad_blit.c : Fix dst address for Gen8 onwards
Gen8 Onwards use 48 bit addressing for src and dst base
addresses. This patch fixes this for destination base address.

Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-25 16:07:51 +01:00
Marc Herbert
c6d18ee56b lib/igt_kms.c: remove tests dependency on VT /dev/tty0
Required to run on any recent, freon-based and X11-free ChromeOS release.

v2:
- igt_debug() instead of igt_warn()
- return KD_GRAPHICS instead of -1UL
- print previous mode in debug statements. Among others this help a tiny
  bit with the now confusing debug output ("cannot change" immediately
  followed by a misleading "mode changed").

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-24 23:39:15 +01:00
David Weinehall
7890b09348 tests/drv_suspend: hibernation test
intel-gpu-tools currently has a bunch of tests for suspend,
but currently none (that I could find) for hibernate.

Attached is a rudimentary patch to add said test.  It does so
by repurposing the drv_suspend driver to handle both suspend
and hibernate, since the difference is miniscule.

I decided to split the suspend/autoresume functions in
igt_aux.c though, to be able to leave the igt_system_uspend_autoresume()
function unchanged (the other option would be to
introduce a boolean function argument and have that
decide what parameters to pass to rtcwake).

The timeout passed to rtcwake probably needs tuning (it might
even need to be dynamically adjusted, since the time hibernation takes
varies wildly depending on the amount of non-cache memory in use).

Signed-off-by: David Weinehall <david.weinehall@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-02-24 16:46:22 +02:00
Chris Wilson
5b93daf5cb lib: Use strtol not strtod for overiding the PCI ID
Simply to avoid the roundtrip through floating points and any extra
headaches from worrying about the implications

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-18 16:09:28 +00:00
Chris Wilson
eaa7e6183c lib: Cache DRM device id to reduce number of ioctls
The DRM device id for the igfx is fixed, since there can only be one in
the system. So once we query it for the first time we can safely report
that value on every subsequent request, cutting out a lot of noisy
ioctls from inside tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-18 16:04:12 +00:00
Thomas Wood
a22548fec0 lib: small documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-17 11:24:04 +00:00
Thomas Wood
f8fd4c977a lib: print recent log messages to stderr when a test or subtest fails
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-17 11:24:04 +00:00
Thomas Wood
a5f21726cd lib: add a ring buffer for log entries
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-17 11:24:04 +00:00
Matt Roper
89201c5328 tests/kms_universal_plane: Fix subtest enumeration
We shouldn't use the contents of data.display to determine which pipes
to run subtests on since this structure is initialized in an igt_fixture
and won't contain any useful data when enumerating subtests (i.e.,
--list-subtests won't return anything).

Instead, just assume we have three pipes in the main loop and ensure
that each subtest will skip if we don't really have that many.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-17 11:24:04 +00:00
Lu, Han
e8e28931b1 tools/intel_audio_dump: add support for Skylake
This patch adds support for dumping audio registers of Skylake.

Signed-off-by: Lu, Han <han.lu@intel.com>
2015-02-16 12:35:40 +08:00
Damien Lespiau
cd6644230b quick_dump: Add interrupt and PPAT registers to the SKL dump
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-02-13 17:00:15 +00:00
Daniel Vetter
3c8aa2fb6e tests/gem_ctx_param_basic: Include header, not source
Oops. Reported by Tim Gore.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 14:54:25 +01:00
Daniel Vetter
3cd45dec2e lib/igt_gt: Document and consolidate
Also move forcewake and stop_rings code from igt_debugfs to igt_gt
since it fits better. And move the hang injection fork helpers from
igt_aux to igt_gt, too.

Also push the intel_gen call into igt_hang_ring while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:36 +01:00
Daniel Vetter
25c4347078 doc: Consolidate naming conventions into docbook
Duplication just means it gets out of sync.

Also update they keyword list in the Makefile, not everything was listed.
And add a new "invalid" keyword.

While at it update NEWS.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:36 +01:00
Daniel Vetter
14185f04bd tests/gem_wait: Adjust makefile
I've forgotten to do this in

commit e4753d2d96fbb88077e70820793137f45f02c9ba
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Sep 29 14:42:33 2014 +0200

    tests/gem_wait_render_timeout: Convert to subtests

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:36 +01:00
Daniel Vetter
2eca38eab9 lib/igt_aux: s/swap/igt_swap/
It collides with the subtest naming convention glossary entry for swap.
Which makes the docbook xml stuff unhappy.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:36 +01:00
Daniel Vetter
3e9b4e37e6 tests: Align subtest with naming convention
Yeah, historically grown but we should try to be somewhat consistent.
It helps with filtering testcases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:36 +01:00
Daniel Vetter
bf5035a728 tests/gem_ppgtt: Start rcs before bcs for context tests
This way the igt_require for the ctx support is hit before we've
launched a bazillion threads and need to wait until they're all done.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:36 +01:00
Daniel Vetter
7a03ddf994 tests: Add invalid pad tests for ctx create/destroy
We've missed them, and the kernel isn't nasty enough and forgot to
check them. To add these tests convert the existing create/destroy
tests over to subtests.

v2: Do the basic create/destroy in ctx_bad_destroy in a fixture
so that all the tests skip properly.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:36 +01:00
Daniel Vetter
6f582f70e1 tests: Add gem_ctx_param_basic
Boring ioctl validation. Luckily no gaps found while doing it.

v2: git add ftw!

v3: Fixes:

- args->size is an outparam for get, adjust test.
- Pick an invalid param, not an invalid ioctl number ... tsk.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:36 +01:00
Daniel Vetter
75c075cb26 lib/ioctl: Document ctx param functions
And move them so that they're grouped with the other context wrappers.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Daniel Vetter
364efcdf9b tests/gem_reset_stat: Use new ctx helpers
A bit more invasive since getting rid off all the places meant
to flatten some of the control flow with implicit igt_require.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
ccc4261dc3 tests/gem_ctx_*: Use helpers
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
09b8211d41 lib/ioctl: Add gem_context_destroy helpers
We also need a raw version for some tests.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
8d21b39251 lib/ioctls: make gem_context_set/get_param infallible
We have separate require checks already, so these failing is a bug in
the test logic.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Daniel Vetter
15801b4dad igt/ioctls: doc for gem_mmap
Just spotted while driving around. gtkdoc needs the full parameter
list otherwise it doesn't recognize it as a function. So add them.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
a3e34ce258 lib/ioctl: gem_ prefix for igt_require_mmap_wc
We stick to the overall prefix even for magic require functions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
c18b2d57a9 lib/ioctl: api polish for gem_context_has_param
Just push the igt_require down to align with the usual style.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Daniel Vetter
c66b2425e7 lib/gt: api polish for igt_can_hang_ring
Align with common igt library style:
- Push the igt_require into the function.
- Push the intel_gen into the function.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Matt Roper
9ca2cc12b4 kms_cursor_crc: Kernel now checks for integer overflow
As of kernel commit

    commit a679064a7e9e8799177a64a31668a34a1bc6a4f1
    Author: Matt Roper <matthew.d.roper@intel.com>
    Date:   Fri Jan 30 16:22:37 2015 -0800

        drm/i915: Switch planes from transitional helpers to full atomic helpers

the kernel now checks for cursor coordinates that would result in
integer overflow and returns -ERANGE, similar to the checking that was
already done for other plane types.  We update kms_cursor_crc here to
reflect this small behavior change:
 * Check for success at extreme boundary conditions INT_MAX-{width,height}
   rather than INT_MAX
 * Add new check for success at SHRT_MAX; if the driver were to
   internally use short values and overflow, we could have the cursor
   reappear on the screen.
 * Add a test for failure with proper error code at INT_MAX-{width,height}+1

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2015-02-10 09:20:39 -08:00
Ben Widawsky
9846e7f2c5 gem_render_copy: Provide an all pixels check
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-02-09 14:20:44 -08:00
Thomas Wood
38a0c41340 lib/tests: check that invalid subtest names are rejected
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
f0516f3d35 lib/tests: verify subtest enumeration output
Check that the subtest list is not empty if using --list-subtests
returns with an exit code of 0, and that the list is empty if it returns
with 79.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
16cfa37a50 lib: add exit status message to simple tests
Add an exit status message to simple tests, similar to the one printed
for subtests. This includes the test outcome and the time taken to run
the test.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
9942a40437 lib: add subtest start and exit status code messages to debug output
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
2b05ecfb06 lib: validate subtest names
Subtest names should only contain '-', '_' and alphanumeric characters.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
61737903ad lib: print warning and critical messages when listing subtests
These messages are sent to stderr and could indicate an issue when
enumerating subtests.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
a228223ffa lib: warning messages should be sent to stderr
This is a regression from commit df11a0f (lib: add a critical warning
level).

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Michał Winiarski
bef692d9f3 tests/gem_userptr_blits: Race between close and invalidate
It was possible for invalidate range start mmu notifier callback to race
with releasing userptr object. If the object is released prior to
taking a spinlock in the callback, we'll encounter a null pointer
dereference.

v2: Moved expressions inside igt_assert(), added mem barrier (Chris)

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>
2015-02-04 10:29:12 +01:00
Imre Deak
87edb51940 rendercopy/gen9: fix gem_render_copy 3d state setup
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test
will fail.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-02-02 15:27:10 +02:00
Thomas Daniel
51d87b8049 tests/prime_self_import: further fix object counts
A previous commit:

commit 2f2c491cf3167befe7c79e4b17afb4f6284dfc84
Author: Mika Kuoppala <mika.kuoppala@intel.com>
Date:   Fri Mar 28 10:52:46 2014 +0200

    lib/drmtest: don't dup quiescent fd

introduced a regression for drm object leak checking.  A following commit:

commit 8741c2289f17e9bcb740a01cad4764a71c918eea
Author: Mika Kuoppala <mika.kuoppala@intel.com>
Date:   Wed May 7 16:46:19 2014 +0300

    tests/gem_flink_race,prime_self_import: fix object counts

fixed the regression for some cases but missed the export-vs-gem_close-race
subtest.  Note that test behaviour depends on whether the subtest is run as
part of the whole prime_self_import test (fail), or as a single subtest (pass).
Using execlists on Gen8+ reverses the pass/fail due to lazy context allocation
which is presumably why this has now been noticed.

This commit applies the same fix to the export-vs-gem_close-race subtest.

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87627
Signed-off-by: Thomas Daniel <thomas.daniel@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-01-29 16:40:06 +02:00
Chris Wilson
7848d21472 igt/gem_tiled_wc: Use correct offsets
A last moment "tidification" in

commit 5e9fac54918e424d928bc15b90e4c65d4cfdd356
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jan 22 07:52:09 2015 +0000

    igt/gem_tiled_wc: Fix! Finish!

wreaked havoc again.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88816
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-27 09:40:27 +00:00