3903 Commits

Author SHA1 Message Date
Chris Wilson
f40a984413 igt/gem_userptr_blits: Correct the number of objects required
Since we allocate 2 times count number of objects, that is the number of
objects we should be using when checking for sufficient RAM to use for
the test.

References: https://bugs.freedesktop.org/show_bug.cgi?id=92799
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-03 16:52:57 +00:00
Chris Wilson
ce65232cf5 benchmarks/gem_wait: Remove pthread_cancel()
Apparently the pthread shim on Android doesn't have pthread cancellation,
so use the plain old volatile to terminate the CPU hogs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-30 15:51:21 +00:00
Chris Wilson
9024a72d29 benchmark/gem_wait: poc for benchmarking i915_wait_request overhead
One scenario under recent discussion is that of having a thundering herd
in i915_wait_request - where the overhead of waking up every waiter for
every batchbuffer was significantly impacting customer throughput. This
benchmark tries to replicate something to that effect by having a large
number of consumers generating a busy load (a large copy followed by
lots of small copies to generate lots of interrupts) and tries to wait
upon all the consumers concurrenctly (to reproduce the thundering herd
effect). To measure the overhead, we have a bunch of cpu hogs - less
kernel overhead in waiting should allow more CPU throughput.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-30 15:04:55 +00:00
Vivek Kasireddy
fe548fab0a igt/kms_rotation_crc: Add a subtest to validate Y-tiled obj + Y fb modifier (v3)
The main goal of this subtest is to trigger the following warning in
the function i915_gem_object_get_fence():
	if (WARN_ON(!obj->map_and_fenceable))

To trigger this warning, the subtest first creates a Y-tiled object and
an associated framebuffer with the Y-fb modifier. Furthermore, to
prevent the map_and_fenceable from being set, we make sure that
the object does not have a normal VMA by refraining from rendering to the
object and by setting the rotation property upfront before calling commit.

v2: Do not call paint_squares and just use one output.

v3: Convert an if condition to igt_require and move the plane rotation
requirement further up before the fb allocation.

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-30 09:15:55 +01:00
Paulo Zanoni
a2c67866fb kms_frontbuffer_tracking: remove opt.only_feature
That option is not needed anymore since:

commit 982934625ac67234c6d85c6cf29a5a487e54d4f0
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Wed Sep 16 14:36:24 2015 +0100
    lib: allow wildcard matching when specifying subtests

In fact, using "--run-subtest 'fbc-*'" is better than using --fbc-only
due to how SKIPs are handled. In the former, only the tests matching
the expression are tried, so the number of SKIPs only contains the
number of tests on the specified pattern that were skipped. If you
used --fbc-only, all the non-fbc tests would count as SKIPs, so it
would be harder to know which of the tests marked as skipped were
actual FBC tests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-23 15:01:05 -02:00
Paulo Zanoni
efc2e39a45 kms_frontbuffer_tracking: add stridechange subtest
This is a corner case not exercised by the other subtests. The test is
expected to pass both with the current Kernel tree and with the
patches that are on the mailing list.

The patches currently on the mailing list change how the CFB is
allocated, and this subtest is designed to make sure everything still
works as expected.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-23 15:00:45 -02:00
Paulo Zanoni
196179a2bc kms_frontbuffer_tracking: add flag to not assert feature status
This will be used by the stridechange subtest.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-23 15:00:21 -02:00
Paulo Zanoni
a4697fc8ba kms_frontbuffer_tracking: unset crtcs after getting the base blue CRC
This fixes the failures for cases where you use --run-subtest to run
single subtests that don't use any drawing patterns.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-23 14:59:56 -02:00
Ville Syrjälä
3660bd4e9c tests/kms_flip: Dump the timestamps, counters, etc. with higher debug levels
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-10-23 15:40:09 +03:00
Ville Syrjälä
75cf16e585 tests/kms_flip: Improve the accuracy of out frame time calculation
Don't use the rounded vrefresh info to predict the frame duration.
Instead calculate if from the clock.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-10-23 15:40:09 +03:00
Ville Syrjälä
8a17af80e0 lib: Skip suspend/hibernate tests if the system doesn't support them
Do a dry run with rtcwake first to determine if the system even supports
the intended suspend state. If not, skip the test.

Fixes a bunch of stuff on my BYT FFRD8 that doesn't support S3.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-10-23 15:40:09 +03:00
Ville Syrjälä
47db6fbd99 tests/kms_pipe_crc_basic: Skip invalid pipe/port combos
Don't try to test invaliud pipe/port combos. Fixes the test on
VLV w/ DSI since the pipe<->DSI port mapping is fixed. Should also
fix other platforms with similar restrictions.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-10-23 15:40:09 +03:00
Chris Wilson
46ec33e847 igt/gem_concurrent_all: Add snoop concurrency tests
Another caching mode worth exploring for bad flushing behaviour.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-23 10:45:36 +01:00
Chris Wilson
5ec54d8a21 Update CONTEXT_PARAM for GTT_SIZE reporting
Add the new PARAM identifier for reporting the context's GTT size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-19 11:37:07 +01:00
Chris Wilson
a22719358d lib: Fix querying context GTT size
We need a new ioctl to find the correct GTT size to use when submitting
execbuffers (as opposed to wishing to know the global GTT size).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-19 11:33:01 +01:00
Matt Roper
cd99ddead3 kms_cursor_crc: Add test for unthrottled cursor movement
We've had  bugs in the past that caused cursor updates to be synced to
vblank, resulting in sluggish cursor movement.  Add a test to try to
make sure we don't regress and reintroduce these bugs.

Cc: kalyan.kondapally@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-16 15:35:28 +01:00
Chris Wilson
e3ac13e16a tests/gem_pwrite_snooped: Fix use of GCC pragmas
Apparently GCC treats the #pragma directive as a code block and so we
returned unconditionally from memchr_inv() on the first byte fubaring
the test.

commit b04691b3e8e62bd105f0f4d8d3b9e7da187f0c90
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Tue Sep 8 11:16:46 2015 +0100

    tests/gem_pwrite_snooped: disable const cast warning

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92227
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-16 11:04:33 +01:00
Derek Morton
0ab76a22d1 benchmarks/gem_blt: Include igt.h in gem_blt.c
To fix a build error on android

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-15 16:59:59 +01:00
Derek Morton
f050dc663d tests/core_prop_blob: Fix core_prop_blob for android
core_prop_blob was using ioctls not in the android kernel. Added a
igt_require_propblob() function and local defines/structures so the
test will compile and skip on kernels where the feature is unsupported.

v2: moved igt_require_propblob() to core_prop_blob.c (Daniel Vetter)
Moved gem_blt.c to a seperate patch (Thomas Wood)

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
[Thomas: fix compiler warning]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-15 16:59:42 +01:00
Tvrtko Ursulin
061a38fca0 kms_rotation_crc: Exercise page flips with 90 degree rotation
Do some page flipping on the rotated plane just to exercise
that code path.

v2: Actually render to flip fb and fixed flip counter.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Cc: Arun R Murthy <arun.r.murthy@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-14 15:45:23 +01:00
Matt Roper
1a593d2a5d kms_universal_plane: Add gen9-specific test
Gen9 adds some new capabilities not present on previous platforms
(primary plane windowing, 90/270 rotation, etc.).  Add a new subtest to
check how these new features interact with the use of the universal
plane API.

For now we just check whether pageflips work as expected in a windowed
setting.  We may want to add some rotation testing in future patches.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-14 15:45:23 +01:00
Rodrigo Vivi
5bc210a5b5 lib/kbl: Add Kabylake PCI IDs
Also, following kernel definition Kabylake is Skylake.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-14 15:45:23 +01:00
Lu, Han
3e9726b337 tools/intel_audio_dump: add support for Broxton
This patch adds support for dumping audio registers of Broxton.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-14 15:45:23 +01:00
Ville Syrjälä
f52e7ec787 Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace
 __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it.

Mostly done with coccinelle, with some manual help:
@@
identifier I;
expression E1, E2, E3, E4, E5, E6;
@@
(
-  I = __gem_mmap__gtt(E1, E2, E3, E4);
+  I = gem_mmap__gtt(E1, E2, E3, E4);
...
-  igt_assert(I);
|
-  I = __gem_mmap__cpu(E1, E2, E3, E4, E5);
+  I = gem_mmap__cpu(E1, E2, E3, E4, E5);
...
-  igt_assert(I);
|
-  I = __gem_mmap__wc(E1, E2, E3, E4, E5);
+  I = gem_mmap__wc(E1, E2, E3, E4, E5);
...
-  igt_assert(I);
)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-12 19:57:58 +03:00
Ville Syrjälä
b8a77dd6c8 Make gem_mmap__{cpu,gtt,wc}() assert on failure
Rename the current gem_mmap__{cpu,gtt,wc}() functions into
__gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name
that assert that the pointer is valid. Most callers will expect a valid
pointer and shouldn't have to bother with failures.

To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g'
over the entire codebase.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 19:16:26 +03:00
Ville Syrjälä
106fe21373 lib: Die if framebuffer GTT mapping fails
Cairo helpfully allocates a new buffer for us when
cairo_image_surface_create_for_data() is called with a NULL ptr. That
means if gem_mmap__gtt() fails, we get a totally silent failure and
nothing ever drawn into the framebuffer. Very confusing.

Put in an igt_assert() to make sure we managed to mmap something.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 18:36:24 +03:00
Ville Syrjälä
7eaae3c201 Sprinkle igt_assert(ptr) after gem_mmap__{cpu,gtt,wc}
Do the following
 ptr = gem_mmap__{cpu,gtt,wc}()
+igt_assert(ptr);

whenever the code doesn't handle the NULL ptr in any kind of
specific way.

Makes it easier to move the assert into gem_mmap__{cpu,gtt,wc}() itself.

Mostly done with coccinelle, with some manual cleanups:
@@
identifier I;
@@
<... when != igt_assert(I)
     when != igt_require(I)
     when != igt_require_f(I, ...)
     when != I != NULL
     when != I == NULL
(
  I = gem_mmap__gtt(...);
+ igt_assert(I);
|
  I = gem_mmap__cpu(...);
+ igt_assert(I);
|
  I = gem_mmap__wc(...);
+ igt_assert(I);
)
...>

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 18:33:30 +03:00
Ville Syrjälä
91d295cf06 Remove gem_mmap__{cpu,gtt,wc} return value MAP_FAILED asserts
gem_mmap__{cpu,gtt,wc} never return MAP_FAILED, it gets converted to
NULL internally. So don't go asserting that the returned value is
not MAP_FAILED.

Done with coccinelle:
@@
type T;
identifier I;
@@
(
 I = gem_mmap__gtt(...);
|
 I = gem_mmap__cpu(...);
|
 I = gem_mmap__wc(...);
)
 ...
(
- igt_assert(I != MAP_FAILED);
+ igt_assert(I);
|
- igt_assert(I && I != MAP_FAILED);
+ igt_assert(I);
|
- igt_assert(I != (T *) MAP_FAILED);
+ igt_assert(I);
|
- igt_assert(I != NULL);
+ igt_assert(I);
)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 17:09:45 +03:00
Ville Syrjälä
8986bbc0ce lib: Document that gem_mmap__{cpu,gtt,wc} return NULL on failure
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 16:59:13 +03:00
Ville Syrjälä
9792e7b580 s/gem_mmap/gem_mmap__gtt/
Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any
point in having it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 16:47:05 +03:00
Paulo Zanoni
bfea74a9f6 kms_frontbuffer_tracking: add fliptrack subtest
The current upstream Kernel code stops and then restarts FBC at every
page flip. I am working on patches to keep FBC enabled all the time,
so this brings the possibility of having the hardware tracking
mechanism looking at the old buffer instead of the new one. This test
should catch this problem.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:02:50 -03:00
Paulo Zanoni
f0c067ddb3 kms_frontbuffer_tracking: don't mode unset when checking sink CRC support
There's no reason to do a mode unset since we don't care about whether
FBC or PSR are enabled or disabled. This should save about a second
for each time you invoke the program.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:02:30 -03:00
Paulo Zanoni
c1daf330e9 kms_frontbuffer_tracking: add scaledprimary subtest
It's not testing a lot since we lack the Kernel Stolen Memory Checker,
but some day this will be useful.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:02:06 -03:00
Paulo Zanoni
bb2ebe92ef kms_frontbuffer_tracking: set the universal planes cap in the setup
... instead of just setting it for the fullscreen_plane subtest and
then unsetting it. We want to use it more, so just make sure all the
code knows how to deal with multiple planes per CRTC.

This also allows us to do some upfront caching of the plane
information, so the code for the tests gets simpler.

There's a new test that's going to use all these changes.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:01:46 -03:00
Paulo Zanoni
68cb0de70c kms_frontbuffer_tracking: change pattern 1's last rect to 1x1
Make sure the tracking mechanism is able to track a write in the very
last pixel.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:01:20 -03:00
Paulo Zanoni
f974422c21 lib/igt_fb: don't forget to close parens on message printed
Restore the anxiety levels back to the normal values.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:00:59 -03:00
Daniel Stone
bbd193b478 tests: Add blob-property test
Exercises the new blob-creation ioctl, testing lifetimes and behaviour
of user-created blobs, as well as exercising all the invariant
conditions we guarantee from modes exposed as blob properties.

v2: Renamed to core_prop_blob, skip test if blob not available.
v3: No changes.
v4: Consistently return 0/errno.
v5: Use do_ioctl_err and igt_assert_fd.
    Use igt_assert_*() helper macros rather than direct igt_assert().

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
2015-10-07 17:57:27 +01:00
Daniel Stone
668c053e6a lib/igt.cocci: De-opencode ioctls
Use do_ioctl and do_ioctl_err where possible.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07 17:57:26 +01:00
Daniel Stone
c8cec6b885 lib/drmtest: Add do_ioctl_err to expect failure
do_ioctl demands that the ioctl returns success; add a variant named
do_ioctl_err, which expects the ioctl to fail, and demands a particular
result.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07 17:57:26 +01:00
Daniel Stone
31821fce59 lib/igt.cocci: Add greater-than to igt_assert_lt*
Change m >= n patterns to igt_assert_lte(n, m), and ditto for strict
greater-than.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07 17:57:26 +01:00
Daniel Stone
6ead44d70b lib/igt_core: Add igt_assert_fd
Skip open-coding and assert that fds are valid.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07 17:57:26 +01:00
Daniel Stone
715a17bb35 lib/igt_core: Add igt_assert_neq_*() variants
Similar to igt_assert_eq_*(), add variants for non-equality of types
other than int.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07 17:57:26 +01:00
Daniel Vetter
c9112dca9e lib/core: Fix docs for igt_assert_lt(e)
Logical negation is hard.

v2: The second integer isn't plural (Daniel).

Cc: "Morton, Derek J" <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-07 18:24:54 +02:00
Chris Wilson
d878e18dfd benchmarks/gem_blt: Fix compilation after rebase and add batch-size
Add an option to do more than one copy per batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-06 17:04:31 +01:00
Chris Wilson
8253e7dc84 benchmarks: Measure BLT performance
Execute N blits and time how long they complete to measure both GPU
limited bandwidth and submission overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-06 10:24:07 +01:00
Derek Morton
1b492e311c benchmarks: Fix build errors on Android M-Dessert
Android M-Dessert treats implicit declaration of function warnings
as errors resulting in igt failing to build.

This patch fixes the errors by including missing header files as
required. Mostly this involved including igt.h in the benchmarks.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-02 09:42:30 +02:00
Ville Syrjälä
983dfe5b68 tests/pm_rc6_residency: Measure the sleep duration
The code is confused about the units of CODE_TIME. The comment
says 50 microsseconds, but the actual code makes it 50
milliseconds. Avoid the whole mess by measuring the sleep
duration ourselves. Since the time measurement is taken around
the whole operation it obviously includes a bit of extra, but
at least it's much less than the fixed 50 ms.

For instance on one VLV board I now get something like this:
- Residency in rc6 or deeper state: 3002 ms (ratio to expected duration: 0.98)
+ Residency in rc6 or deeper state: 3001 ms (sleep duration 3003 ms) (ratio to expected duration: 1.00)
so the reported ratio is now much closer to reality.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-28 18:23:52 +03:00
Ander Conselvan de Oliveira
571942f0c4 testdisplay: Fix segfault after first modeset fails
When testing all modes on a connector with a single mode, if the modeset
fails, the code attempts to remove fb_info[-1], because old_fb still has
the inital value of -1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90625
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-25 11:42:14 +01:00
Thomas Wood
93f1250013 lib: fix fopen mode in igt_debugfs_search
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-25 09:42:42 +01:00
Thomas Wood
6c89204da7 lib: add igt_debugfs_search
Add igt_debugfs_search to search each line in a debugfs file for a
specified substring.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-24 14:24:18 +01:00