1891 Commits

Author SHA1 Message Date
Joonas Lahtinen
577fb75ed8 tests/gem_mmap_gtt: clarify BO domain setting functions
Add suffix and complementary function for CPU domain.

v2:
- Change function signatures to be consistent with the rest

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14 17:43:05 +01:00
Thomas Wood
c06bba1256 tests: install the test list
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14 17:43:05 +01:00
Thomas Wood
e72686b83b tests: create a single combined test list
All tests now respond in a consistent way such that separate lists for
tests with and without subtests are no longer necessary.

v2: fix other references to the test list

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14 17:43:05 +01:00
Thomas Wood
b47032e191 lib: add a define for test failure exit status
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14 17:43:05 +01:00
Chris Wilson
9fd6e07369 igt/prime_self_import: Ensure driver state is consistent between counts
Similar to gem_flink_race, we need to make sure that when we count
objects, the driver is in an identical state. We do this by flushing all
work before counting.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90003
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-13 10:49:47 +01:00
Chris Wilson
2e526ae9cd igt/gem_flink_race: Explicitly quiesce the GPU before counting objects
By explicitly quiescing the GPU we force it to a known and ideally
identical state when counting objects. In particular, this should make
the batch-pool status the same and not cause us to detect a negative
leak.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-12 13:43:00 +01:00
Chris Wilson
007ff02cbc igt/gem_mmap_wc: Explicitly check for use-after-close
We already rely on the mmap(object) surviving close(), but make the test
explicit and early.

Secondly, we don't technically need to call set_domain after writing
through the CPU then reading through WC, since the CPU cache is
consistent for those two paths. Test it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-10 10:07:26 +01:00
liu,lei
d36465d520 Correct kms_fbc_crc case
Debugfs i915_fbc_status shows "FBC unsupported on this chipset"
not "unsupported by this chipset" if the platform doesn't support
FBC feature. That typo will cause case fail on some platforms such
as byt, bsw.

Signed-off-by: Lei Liu <lei.a.liu@intel.com>
2015-04-09 15:45:50 +02:00
Shuang He
b556c9e8e5 tests: Fix duplicate 'kms_flip_event_leak' entry in tests/Makefile.sources
Or, it will cause piglit failure to run I-G-T test case

Signed-off-by: Shuang He <shuang.he@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-04-09 10:12:33 +02:00
Chris Wilson
1f6a64ee80 igt/gem_exec_lut_handle: Put some operations back!
In order to force relocations, we have to remember to clear the presumed
offsets that get filled in by each pass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-08 21:39:47 +01:00
Chris Wilson
e22525064d igt/gem_exec_lut_handle: Trim a few operations from submission
Move all the execbuffer construction upfront and do it once per round,
rather than per relocation pass. It helps reduce runtime, but more
importantly it removes the test overhead from out of the kernel
measurement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-08 21:14:46 +01:00
Thomas Wood
9d98ccb860 tests: use standard install prefix for programs, scripts and data
Use the pkglibexec and pkgdata prefixes rather than setting bindir and
datadir. This also removes the extra 'tests' directory from within the
package libexec and data directories.

Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-08 17:58:32 +01:00
Thomas Wood
4e11307e07 tests: ensure scripts and data are included in the distribution
Prefix the test scripts and data variables with dist_ to ensure they are
included in the distribution.

Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-08 17:58:32 +01:00
Thomas Wood
564dfd45a9 tests/kms_fbc_crc: fix fread() return value assertion
Use 1 as the element size to check the number of bytes returned is
greater than 0, rather than checking the number of elements returned.

This fixes a regression from commit 47f6b13 (igt.cocci: check the
return values of various functions).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89833
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-08 17:58:32 +01:00
Jeff McGee
7968098fb7 tests/pm_sseu: Require Gen8+ early in setup
Pre-Gen8 devices should be skipped early instead of failing
when test resources are not found.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89822
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
2015-04-07 10:56:14 +02:00
Chris Wilson
a6c3b32622 igt/kms_vblank: Simple accuracy test
Queue 60 event to arrive at the same vblank from different points in
time and make sure it just works.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-06 10:44:46 +01:00
Chris Wilson
43a1f64e72 igt/gem_cpu_reloc: Pretty print execbuf failures
References: https://bugs.freedesktop.org/show_bug.cgi?id=85672
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-03 09:25:42 +01:00
Chris Wilson
71de427b53 igt/gem_persistent_relocs: Add note about known byt/full-ppgtt issue
References: https://bugs.freedesktop.org/show_bug.cgi?id=84859
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-03 09:09:04 +01:00
Chris Wilson
e8457edba6 igt/gem_exec_blt: Prevent assertion failure when running as a test load
gem_exec_blt is used by other scripts to provide a background load, for
example by drv_missed_irq. This mode doesn't act like a normal test and
igt complains bitterly about it.

Let's just ignore igt here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=88041
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02 20:17:16 +01:00
Tim Gore
8938e1ed47 tests/Android.mk : skip kms_pipe_b_c_ivb if no cairo
test kms_pipe_b_c_ivb depends on cairo, so add it to
the list of test not to build unless "ANDROID_HAS_CAIRO"
is set.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-02 16:36:11 +01:00
Tim Gore
ebb46bb2e2 tests/gem_concurrent.c: rename to gem_concurrent_all
Recent patch #7763349a9a87.. renamed gem_concurrent_blit.c
to gem_concurrent.c and then added entries to Makefile.am
to make two identical executeables (but with different
names) from this source file. This executeable changes its
behaviour based on argv[0]. But, this has broken the
Android build, which does not use autotools.

This patch instead renames the source file to match
the name of one executable (gem_concurrent_all.c) and
creates a second source file which simply #includes the
first. The Makefile.am entries are also removed.
This restores the simple test.c -> test executeable
relationship seen in the rest of IGT and allows the
Android build system to work without parsing Makfile.am
or having to incorporate a special workaround for this
test.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-02 16:35:42 +01:00
Joonas Lahtinen
a95033fdbc tests: install test programs to libexec
Install the test programs by default so that they can be packaged.

Tested with the testdisplay test so that it still runs after the
modifications as it depends on a data file to be present. Need to
pass -r option to enable QR code display on success (PNG data file).

Packaging is useful when building a complete software stack for a
DUT from scratch. This should bring us closer to achieving a
built-from-scratch testing workflow.

Package maintainers can always decide to ignore the installed files.

v2:
- Install more tests including scripts and their data

v3:
- Add clarification to commit message about why we do this.
  (Chris Wilson & Thomas Wood)
- Change libexec into pkglibexec to comply to standard
  (Thomas Wood)
- Do not install $(common_files). (Thomas Wood)
- Make it really obvious the installed files are tests by using
  tests directory name to avoid any confusion with packagers.

v4:
- Fixed commit message.

v5:
- Add file locator helper to retain backwards compatibility.
  (Thomas Wood)
- Test with testdisplay -r option that draws the .png file.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-02 16:32:47 +01:00
Chris Wilson
590e47c94f igt/kms_vblank: Include a test for comparing blocking drmWaitVblank
The other aspect of the spinlock/interrupt on-off overhead is that when
we wait for vblank it immediately turns off, and then we immediately turn
it back on for the next wait.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02 11:45:17 +01:00
Ander Conselvan de Oliveira
992f9f6403 tests: Add test for pipe B and C interactions in IVB
The tests exercise different combinations of enabling pipe B with modes
that require more than 2 lanes and then enabling pipe C.

v2: Added a couple more tests for different pipe transitions. (Ander)
    Use custom modes to make the test reliable. (Daniel)

v3: Add IGT_TEST_DESCRIPTION. (Thomas)
    Rename test to kms_pipe_b_c_ivb. (Ander)

v4: Fix subtest enumeration. (Thomas)

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-31 10:22:23 +01:00
Thomas Wood
ea453dbb4a gem_exec_blt: fix subtest enumeration
Wrap the sysfs_read and sysfs_write calls in an igt_fixture block so
they are not executed during subtest enumeration.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-30 17:09:22 +01:00
Chris Wilson
af3e32cee2 igt/gem_evict_everything: Simplify mlocked_evictions
igt_fork/igt_waitchildren already perform the magic required to raise
errors based on the exit error code of the child, so take advantage of
that and kill the overlycomplicated message passing!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-30 17:05:16 +01:00
Chris Wilson
9c6e6db03d Revert "tests/gem_exec_lut_handle"
This reverts commit a5934091b84e3f8804fb3fed35374c5a976dd07e.

Unnerf igt/gem_exec_lut_handle. Sadly completely breaking the
measurement is not a good excuse to hide regressions.
2015-03-30 11:11:20 +01:00
Chris Wilson
068f9ceb62 igt/gem_evict_everything: Use mlock to reduce available memory
The idea here is to check what happens when a large process requests
memory from us - we create and utilize a bunch of surfaces then have to
relinquish some but continue using the whole working set (so as to force
reloads).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29 15:57:50 +01:00
Chris Wilson
b9b82fdc5f igt/gem_exec_parse: Use a macro for pretty printing the test failure
By moving the assert up a level, we get an much improved assertion
failure message (e.g. it includes the batch string that fails).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29 14:13:05 +01:00
Chris Wilson
a1e4ec4a68 igt/gem_cs_prefetch: Use gem_execbuf for pretty printing of failures
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29 14:13:05 +01:00
Chris Wilson
11291fd52f igt/gem_exec_(blt|nop): IGT magic
$ ./gem_exec_nop --list-subtests
render
bsd
blt
vebox
gem_exec_nop: igt_core.c:946: igt_skip: Assertion `in_fixture' failed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26 20:53:06 +00:00
Thomas Wood
47f6b1305c igt.cocci: check the return values of various functions
Add rules to fix unused-result warnings when compiling with
_FORTIFY_SOURCE defined and apply them to the library and tests.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26 15:50:59 +00:00
Thomas Wood
76dad7f414 Add default debug flags for tests
Include debugging symbols in tests by default to improve stack traces
and also set the compiler optimisation level to improve the debugging
experience.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26 15:50:05 +00:00
Thomas Wood
277ca2b992 lib: print a stack trace when a test assertion fails
Add an optional dependency on libunwind to print stack traces when a
test assertion fails.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26 15:50:05 +00:00
Chris Wilson
2659cbbf64 igt/gem_exec_(nop|blt): Repeat measurements at min/max GPU frequencies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26 14:04:56 +00:00
Chris Wilson
7763349a9a igt/gem_concurrent_blit: Separate out the combinatorial explosion
Apparently nobody else likes testing and debugging GEM coherency issues.
However, this also means that QA is skipping these vital tests. Split
out a set of canaries into igt/gem_concurrent_blit and keep the rest in
igt/gem_concurrent_all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89497
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26 08:15:19 +00:00
Chris Wilson
c666a19e0c igt/gem_exec_blt: Repeat measurement and average
Through away the unstable outliers for a more consistent measurement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26 08:15:19 +00:00
Chris Wilson
cd8d3809a6 igt/gem_exec_nop: Repeat and average to stabilize measurements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26 08:15:19 +00:00
Chris Wilson
4f78f9ffa2 igt/gem_exec_blt: Do a warmup run first
Sometimes it takes a pass for the GPU to come up to full speed, so do a
"cold" pass first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26 08:15:19 +00:00
Chris Wilson
6259d0a36b igt/gem_exec_blt: Repeat measurements for stablity
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26 08:15:18 +00:00
Jeff McGee
07707aff75 tests/pm_sseu: Create new test pm_sseu
New test pm_sseu is intended for any subtest related to the
slice/subslice/EU power gating feature. The sole initial subtest,
'full-enable', confirms that the slice/subslice/EU state is at
full enablement when the render engine is active. Starting with
Gen9 SKL, the render power gating feature can leave SSEU in a
partially enabled state upon resumption of render work unless
explicit action is taken.

v2: Add test description and apply recommendations of igt.cocci
    (Thomas Wood).
v3: Skip instead of fail if debugfs entry i915_sseu_status is not
    available.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Tested-by: Lei Liu <lei.a.liu@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-25 17:52:27 +00:00
Jeff McGee
301b9e4bb3 tests/drv_getparams: Skip instead of fail on EINVAL
Avoid failing on older kernels where the GETPARAM interfaces
don't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89669
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
2015-03-25 14:41:52 +01:00
Tim Gore
9ba93c43cf tests/gem_tiled_fence_blits: split into subtests
The gem_tiled_fence_blits test tends to get oom killed
on low memory (< 4GB) Android systems. This is because the
test tries to allocate (sysinfo.totalram * 9 / 10) in
buffer objects and the remaining 10% of memory is not
always enough for the Android system.
As with a similar issue with gem_render_linear_blits,
this problem is resolved by splitting into subtests.
A "basic" subtest uses minimal memory buffers to test
the basic operation, and a "normal" subtest which is
skipped if there is insufficient memory.

I also took the opportunity to cull some numeric literals.

Signed-off-by: Tim Gore <tim.gore@intel.com>
2015-03-25 14:41:52 +01:00
Jesse Barnes
392e8ee75f tests/pm_rps: add test descriptions
Document a copule of the subtests with their purpose, methods, and
expected results.

Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-03-23 12:50:48 -07:00
Daniel Vetter
1765838e34 tests/gem_tiled_swapping: Fix up L-shaped testing
I've fumbled this, resulting in this this skipping everywhere.
Unfortunately no QA test report for this regression ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-03-23 11:02:28 +01:00
Daniel Vetter
a5934091b8 tests/gem_exec_lut_handle
Reduce default number of repeats a lot. High repeat count is only
useful for microbenchmarking, not that much for regression testing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87131
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23 11:02:28 +01:00
Daniel Vetter
a5c6b8df8b tests/kms_cursor_crc: Add dpms and suspend tests
There was some confusion about whether we restore cursors correctly
after dpms and suspend/resume. Apparently we still do!

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23 11:02:28 +01:00
Daniel Vetter
562bbe12f6 tests: Remove usage of igt_crc_equal and _non_null
Tests should positively check for crc matches, not for mismatches.
Enforce this by only exposing and igt_assert function for comparing
crcs.

For the few tests which didn't just do this as consistency checks but
to do functional tests add FIXME comments that some reference crc
values are missing.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23 11:02:28 +01:00
Daniel Vetter
e588f6dfa6 lib/debugfs: Add igt_assert_crc_equal
Because of hash collisions tests should only ever compare crc
checksums for equality. Checking for inequality can result in random
failures.

To ensure this only expose and igt_assert function and use that.
Follow-up patches will rework the code for tests which don't follow
this requirement and try to compare for CRC inequality.

v2: Rebase on top of Matt's kms_plane changes.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23 11:02:28 +01:00
Daniel Vetter
4fec18e5e0 lib/core: add interactive debug point to igt_fail
Useful for inspecting the screen state in kms tests when they fail.

Also move the screen clearing in kms_cursor_crc to the bottom.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23 11:02:28 +01:00