3663 Commits

Author SHA1 Message Date
Daniel Vetter
484e27542d tests/kms_fbc_crc: Don't force fbc on old platforms
It's simply a bit too scary on pre-gen6 and imo not worth the bother
really until someone starts to implement all the hacks an w/a required
on these platforms. On later platforms the issues are just with
correctness and performance hence no risk for hanging machines.

Cc: Paulo Zanoni <przanoni@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-06-25 09:43:55 +02:00
Chris Wilson
44d444acaa overlay: Enable locale
Enabling locale allows us to use thousand separators and other such
human touches in the output.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-24 17:03:42 +01:00
Chris Wilson
453792c501 lib: Enable locale dependent output to a terminal
If we are in an interactive session, enable the locale. This allows for
features like setting thousand separators for printing large values. By
only enabling it for interactive terminals, we avoid changing outputs
for the test scripts (leaving them as the "C" locale).

Note this mainly affects the testcases, or binaries built using libigt.
Other binaries need to be localised separately.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
2015-06-24 17:03:04 +01:00
Paulo Zanoni
7eb5f07949 tests/kms_frontbuffer_tracking: rename set_screens_for_test
Rename it to prepare_subtest. This function used to be much smaller
when I decided its name.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:44:18 -03:00
Paulo Zanoni
7756e88445 tests/kms_frontbuffer_tracking: simplify flib_subtest fb handling
Get rid of fb2_region, use params->fb directly instead.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:43:02 -03:00
Paulo Zanoni
77e1bac6eb tests/kms_frontbuffer_tracking: simplify wait_user() calls
I often add new temoprary wait_user() calls when debugging things, and
having to add "if (opt.step)" is annoying, so let's make the step
level check inside wait_user(). As a bonus, our huge macro is 2 lines
shorter.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:41:22 -03:00
Paulo Zanoni
969cb3c575 tests/kms_frontbuffer_tracking: not all eDP panels support sink CRC
And require sink CRC support for PSR, since the pipe CRC is not
exactly useful there.

v2: Check for ENOTTY (Rodrigo).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91019
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:41:01 -03:00
Derek Morton
471ebbed53 igt/gem_fence_thrash: Reduce memory usage
On android platforms with 1Gb RAM gem_fence_thrash was failing
with an out of memory error.
This patch causes gem_close() to be called when a handle is
no longer required rather than relying on the cleanup when
the fd is closed. This greatly improves the memory footprint
of the test allowing it to run on 1Mb systems.

Also fixed a leak of the 'threads' variable.

v2: Simplified as per Chris Wilson's suggestion.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
[ickle: fix mmap leak from bo_copy()]
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-23 17:19:07 +01:00
Thomas Wood
154192a680 NEWS: Post-release bump
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-23 13:36:02 +01:00
Chris Wilson
0e528af623 igt: Add gem_exec_alignment
Simple test to see whether the kernel obey's the user's request
alignemnt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-22 15:55:21 +01:00
Chris Wilson
eb7d60e430 igt: Add gem_eio for inducing expected EIO
A few entry points in the GEM API are expected to raise EIO if we
encounter a wedged GPU. This testcase aims to do so by first injecting a
GPU hang with GPU resets disabled (thus causing the GPU to become wedged)
and then exercises the various API to check for the expected errors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-19 11:44:26 +01:00
Chris Wilson
4fbce7e462 testdisplay_hotplug: Add missing #include <sys/stat.h>
testdisplay_hotplug.c: In function ‘hotplug_event’:
testdisplay_hotplug.c:46:14: error: storage size of ‘s’ isn’t known
  struct stat s;
              ^
testdisplay_hotplug.c:54:2: error: implicit declaration of function ‘fstat’ [-Werror=implicit-function-declaration]
  fstat(drm_fd, &s);
  ^
testdisplay_hotplug.c:54:2: warning: nested extern declaration of ‘fstat’ [-Wnested-externs]
testdisplay_hotplug.c:46:14: warning: unused variable ‘s’ [-Wunused-variable]
  struct stat s;
              ^
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 10:38:47 +01:00
Chris Wilson
c83299d1fd lib: Use HAS_GPU_RESET rather than opencode our guess
Uses kernel commit 49e4d842f0d0892c3d26c93a81b9f22c1467030e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 15 12:23:48 2015 +0100

    drm/i915: Report to userspace if we have a (presumed) working GPU reset

to determine whether the kernel has a working GPU reset before injecting
a hang (and so skip tests requring hang recovery if not available).
2015-06-15 16:05:07 +01:00
Derek Morton
a5633c406c lib/tests/igt_segfault Add unit test to test segfault handling
Unit test to check a segfaulting subtest is handled correctly.

v2: Added script to check subtest results
v3: Removed script. Updated test to use fork to monitor return status.
v4: Added igt_segfault to .gitignore

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-06-15 15:45:55 +02:00
Damien Lespiau
4b944c92eb pm_rpm: Update the debugfs filename
v2: Try to open i915_pc8_status first to make the transition (or just
running on older kernels) better. (Paulo)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-13 18:41:49 +01:00
Thomas Wood
b88212c036 Update version to 1.11 and add the release date
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-11 16:08:23 +01:00
Thomas Wood
0cc16b37ab NEWS: Updates
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-11 16:06:33 +01:00
Thomas Wood
aa75f37397 tools: print a warning for tools replaced by intel_reg
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-11 14:48:58 +01:00
Thomas Wood
87f15fc3da overlay: update .gitignore
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-11 14:48:47 +01:00
Paulo Zanoni
d8acd24bdb tests: add kms_frontbuffer_tracking
This is a new test that should exercise the frontbuffer tracking
feature of the Kernel in a number of different ways. We use different
drawing methods, we use the primary, cursor and sprite planes, we can
test both on single and dual pipes, also on buffers not associated
with any CRTCs, etc.

We currently have assertions for both FBC and PSR, and we also have a
"nop" test mode that should disable both FBC and PSR, and can be
used for debugging.

This test is also capable of testing both FBC and PSR even if they are
disabled by default on the Kernel: the test knows how to change the
i915.ko parameters and then set them back after testing.

I am getting a significant number of failures when I run this test,
which means we have some work to do on the Kernel.

I also still have a small list of additional subtests that I plan to
add to this test, and those tests are documented on the main function.

v2:
 - Use igt_debugfs_open() (Thomas).
 - Use igt_test_description() (Thomas).
 - Don't check drm_open_any_master()'s result (Thomas).
 - Use igt_require_f() in some cases (Thomas).
 - Standardize some assertions.
 - Use the new module param functions.
 - Check if FBC is supported by the chipset.
 - Add new subtests (multidraw, enum fbs, fbc+psr).
 - Make tests a little shorter.
 - Reorganize which tests ara ran by default.
 - Better comments everywhere.
 - Rebase.

v3:
 - Fix a small typo.
 - Improve the log messages a little bit more.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-11 10:43:13 -03:00
Paulo Zanoni
75b286e821 tests/kms_psr_sink_crc: test even if PSR is disabled by default
Use the igt_set_module_param_int() call to enable it, then restore the
previous value after we are done testing.

With this, we can change the psr_enabled() function to psr_possible():
the only requirement should be that we have a PSR capable sink. The
test should now be able to make "Source_OK" and "Enabled" become true
whenever it wants.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-11 10:42:47 -03:00
Paulo Zanoni
a4dbdeffc2 tests/kms_fbc_crc: run even if FBC is disabled by default
We may not be perfect, but if we don't even test, we will probably
only get worse over time.

The function called makes sure we restore whatever was the original
FBC parameter when we exit the test, so this should not affect the
other tests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-11 10:42:27 -03:00
Paulo Zanoni
d9ff9b3971 lib/igt_aux: add functions to manipulate i915.ko parameters
Some i915.ko features have very nice IGT tests, which are never
executed because the features are disabled by default. This leads to
unnoticed regressions both in the Kernel and in the IGT tests.  We
have seen this multiple times, for example, on FBC and PSR.

We want to be able to run IGT and actually test these
disabled-by-default features in order to make sure we at least don't
break them even more. Sometimes they may be disabled for some specific
reason, and we don't want to increase the set of reasons without
noticing.

To help solving this problem, this commit adds some helper functions
that should make it easier to change certain i915.ko parameters and
then restore their original values at the end of the test. With this,
I'm hoping QA will be able to detect any regressions and automatically
bisect them - or, with PRTS, reject the patches before they are even
merged.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-11 10:41:51 -03:00
Paulo Zanoni
46a1791958 tests/template: add IGT_TEST_DESCRIPTION
So people that write tests based on the template don't forget to use
the macro.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-11 10:41:25 -03:00
Imre Deak
6b418f0264 tests/gem_storedw_batches_loop: add subtest for cached mappings
v2:
- add a subtest for uncached mappings too for LLC platforms where the
  default is cached mapping (Chris)

Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-06-08 20:27:47 +03:00
Chris Wilson
c5a6147a1b overlay: Fix parsing of gem-objects for '[k]' clients
Apparently '[]' are not non-whitespace characters and break '%s'.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-08 15:57:45 +01:00
Damien Lespiau
fd772e32a2 build: Add the automake subdir-objects option
automake 1.14 was complaining here:

overlay/Makefile.am:44: warning: source file 'x11/x11-window.c' is in a
subdirectory, but option 'subdir-objects' is disabled.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-05 16:55:47 +01:00
Tim Gore
c221e09420 tests/gem_reset_stats : mask off ring_stop bits
Function check_gpu_ok checks to make sure that any hangs
have cleared by testing for (flags == 0). Some tests set
the STOP_RINGS_ALLOW_BAN and STOP_RINGS_ALLOW_ERRORS flags
but these do not get cleared by an individual ring reset,
(a feature added recently to the driver), leading the
check_gpu_ok function to think that the gpu is still hung.

So I mask the flags with STOP_RING_ALL, to ignore the mode
bits and look only at the bits that stop the rings.

Once gpu_check_ok sees that the gpu is not hung I write 0
to stop_rings in order to clear it completely. This is
because igt_set_stop_rings will only write to stop_rings
if either a) they are currently 0 or b) we are writing 0.
If we leave the mode bits set then subsequent calls to
igt_set_stop_rings to create hangs will fail.

Signed-off-by: Tim Gore <tim.gore@intel.com>
2015-06-05 08:53:04 +01:00
Chris Wilson
a5a6d40ca8 igt/gem_streaming_writes: Reorder src/dst to avoid executing on snooped
During the streaming setup, we execute a dummy batch in order to bind
the objects into the GTT and query their offsets. For this, we should
not use a snooped buffer for the dummy batch, or else we may anger the
GPU. Given that we have a choice, use the other buffer for the dummy
batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-03 14:00:59 +01:00
Tvrtko Ursulin
85ee6e7b36 gem_userptr_benchmark: Test overlapping bo mmu notifier performance impact
Current userptr kernel implementation downgrades tracking VMA ranges (real
userspace ones) to an inefficient linear walk for any process which has
instantiated overlapping userptr objects.

This adds a test which shows the performance cliff on, most visibly, generic
userspace mmap(2) and munmap(2) operations between unsync, non-overlapping
and overlapping userptr objects.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Thomas Daniel <thomas.daniel@intel.com>
2015-06-02 13:51:41 +01:00
Chris Wilson
9777300846 igt/gem_streaming_writes: Map the whole batch for CPU accesses
The llc cpu path only partially mapped the batch buffer so confused the
CS when attempting to execute an empty batch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90809
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-02 11:26:18 +01:00
Ville Syrjälä
0d16473df4 tests/kms_3d: Reduce the number of expected stereo 3D modes
Currently the test expects to find 15 stereo 3D modes, however the
number of stereo modes we get from the current kernel EDID parser
is actually 13.

The extra two modes we had previously were GTF modes, which are no
longer getting added by the kernel since we have corresponding
CEA/DMT modes available. So having the GTF modes in the list was
not actually intentional.

The kernel commit that change the behaviour:
commit bfcd74d2aeda25a78f7cc92f80650218b1bce0ca
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Thu Apr 2 17:02:11 2015 +0300

    drm/edid: Add DMT modes with ID > 0x50

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90368
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-05-29 12:57:34 +03:00
Antti Koskipaa
f386741932 tests/pm_backlight: Add backlight test
This is a basic sanity test of the backlight sysfs interface.

v2:
 - Add jani's suggestion for immediate readback
 - Remove unused parameter from test_and_verify()
 - Add fade test

Issue: VIZ-3377
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-28 18:16:59 +01:00
Mike Mason
b1e40e97c8 scripts/run-tests.sh: add option to not retry incomplete tests on resume
This patch utilizes piglit's new --no-retry option. That option
prevents incomplete tests from being retried when resuming a
test run. This is necessary because retrying tests that cause
a crash or reboot prevents a test run from being resumed.

This patch also adds -s to the piglit command line. The -s option
forces test logs to be synced to disk after every test.
Without it, some logs can be lost if a test causes a crash
or reboot, making it impossible to resume the test run at the
correct point.

Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-28 17:23:57 +01:00
Derek Morton
f49723872b lib/igt_core.c: Flag the test as failing after a segfault
fatal_signal_handler() was trapping fatal errors but not
flagging the test as failing or setting an exit code.
The result was that the test would return Ok or Skipped
depending on what the other subtests did even though one
of the subtests had segfaulted.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-28 13:37:11 +02:00
Yunlian Jiang
95019c2a3c debugger: remove unnecessary struct per_thread_data
This removes unnecessary 'struct per_thread_data' and avoids the
compilation error 'variable length array in structure extension
will never be supported' by clang. The bug entry is
https://code.google.com/p/chromium/issues/detail?id=476001

Cc: Benjamin Widawsky <benjamin.widawsky@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Yunlian Jiang <yunlian@google.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-27 16:28:34 +01:00
Derek Morton
88c9a82318 lib: Enable building unit tests on android
Add a make file for android so the unit tests can be built.
Enabled asserts for the library code so the unit test behaviour
is correct.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-27 16:17:05 +01:00
Tvrtko Ursulin
f2a5896bdd kms_rotation_crc: Update rotation direction for kernel changes
commit 1e8df16778b0d8fd8102b3ee799b028f8f961089
Author: Sonika Jindal <sonika.jindal@intel.com>
Date:   Wed May 20 13:40:48 2015 +0530

    drm/i915/skl: Swapping 90 and 270 to be compliant with Xrand

Changed the rotation direction so IGT needs to be told.

Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-27 14:24:49 +01:00
Chris Wilson
308b0e856b igt/gem_linear_blits: tidy
Be clean and use memset(0) on ioctl args before use and downgrade some
of the lesser informatic messages to just debug.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-20 14:57:16 +01:00
Chris Wilson
e93fbc2873 igt/gem_streaming_write: Add a variant to exercise CS
Another issue in streaming writes is into the batch buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-20 14:57:16 +01:00
Chris Wilson
3d1f9a2236 igt/gem_streaming_writes: Remember to markup the write target!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 15:35:48 +01:00
Chris Wilson
65fec5e583 igt/gem_streaming_writes: Add more validation steps
Inalcude a pre-pass to check that the non-streaming, partial writes
work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 15:35:48 +01:00
Damien Lespiau
c0a0725fad list-workarounds: Print the line where the parsing error occured
Useful to understand the warnings the scripts prints.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-19 15:15:05 +01:00
Imre Deak
554aac5f3e tests/pm_rc6_residency: fix check if RC6P or RC6PP is enabled
The test checks the residency in a given RC6 state or any deeper states
that are also enabled. For example the RC6 subtest checks the combined
residency in RC6/RC6P/RC6PP. Since the kernel reported value for the RC6
residency doesn't include the RC6P or RC6PP residency we need to adjust
the RC6 value accordingly. A similar adjustment is needed for the RC6P
subtest.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90369
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
2b47e219be tests/pm_rc6_residency: fix counter readout in case of wrap-around
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
05e9edb2b9 tests/pm_rc6_residency: remove redundant idle loops
Currently the test runs a separate idle loop when reading out each RC6
counter. But there is no need for this, we can have a signle idle loop
and read out all the counters at once.

This prepares for an upcoming patch where we need to consider the RC6P
and RC6PP counters as well when checking RC6.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
a2ce95eb9e tests/pm_rc6_residency: sanitize the RC6 enabled mask check
The way the test checks for the RC6 enabled mask atm doesn't work:
calling igt_success outside of any subtests doesn't have any effect.
This means the test will run a 11 second idle loop for each RC6 state
regardless if the platform supports these or have them enabled. Fix this
by checking explicitly if a given RC6 state is enabled before reading
out/checking the corresponding counter.

With this fix we can also get rid of the GEN6/IVB checks, since the RC6
mask check makes them redundant. We still need the VLV/CHV checks, since
media RC6 doesn't have a separate bit in the mask.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
a76591a4be tests/pm_rc6_residency: factor out the code to measure residencies
The upcoming patches will add some additional logic around reading out
the counter values, so factor out the readout code to prepare for those
patches.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
7883bc8c1c tetst/pm_rc6_residency: sanitize counter check function arguments
The counter check function (residency_accuracy) cares only about the
counter delta, so no need to pass it the start/stop values separately.
Simplify things to prepare for the upcoming patches.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
a572fb15f3 tests/pm_rc6_residency: simplify the residency counter check
The temporary vars only obfuscated things, so get rid of them. Also
remove some redundant asserts and info messages.

The only functional change is that the counter delta will be checked
only against a percentage based accuracy range (90%-100%) and not
against a hard-coded limit (RC6_FUDGE). The two checks serve the same
purpose and the former one is clearer.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00