2004 Commits

Author SHA1 Message Date
Ville Syrjälä
92a803ffb0 tests/kms_3d: Use XRGB8888 instead of ARGB8888
We don't allow ARGB8888 anymore on primary planes on most platforms,
so use XRGB8888 instead as the format.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:42:26 +02:00
Ville Syrjälä
cba86e980f tests/kms_3d: Use igt_assert_eq()
Would be nice to see how many stereo modes we managed to extract from
the EDID if it doesn't match the expected 13. So use igt_assert_eq()
which prints the real count on failure.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:42:22 +02:00
Ville Syrjälä
e42936d86b tests/kms_addfb_basic: Add clobbered-modifier subtest
Make sure the kernel doesn't clobber the modifiers when the user didn't
pass any.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
29cd8a092e tests/kms_flip: Add a note that the test was skipped when modeset fails
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
a09880d1c3 tests/kms_flip: Modeset pipes in reverse order
To make more multi-pipe tests run on IVB, do the modesets in the reverse
order (ie. pipe C first, pipe A last). This way pipe B can't reserve the
2 shared FDI lanes before pipe C is set up.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
5bb87dc0e5 tests/kms_flip: Disable all pipes before each test
Currently kms_flip leaks the state of the pipes from one subtest to the
next. Meaning a single pipe test can actually have two or more pipes
actually up and running, and similarly a two pipe test can have three
pipes running.

This is particularly nasty on IVB since one of the pipes still running
but not actually part of the test maybe have reserved the shared FDI
lanes, thus preventing one of the pipes taking part in the test from
being enabled.

To avoid such problems explicitly disable all pipes before each
subtests.

v2: Use kmstest_unset_all_crtcs() (Paulo)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
2f894820ac tests/kms_flip: Use human readable pipe and connector names
Print the pipes and connectors in a human readable form instead of using
the integer IDs.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Derek Morton
c8beadb811 tests/gem_exec_nop: Improved test run time
Reduced the Sleep period to 200mS and reduced the repetition count to 7
to decrease the test run time significantly.

v2: Changed uS to us
v3: removed the output formatting change as the issue will be addressed
in a seperate patch from Thomas Wood.
v4: mS -> ms

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-13 14:08:54 +00:00
Maarten Lankhorst
464424dcee tests/kms_setmode: Handle MST correctly.
There is a MST encoder for each crtc, and each MST connector
will be connected to the encoder bound to that crtc.

This breaks the kms_setmode assertion that is only 1 encoder per
connector, so make an exception to that rule for displayport.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2015-11-12 13:33:42 +01:00
Chris Wilson
143a216058 igt/gem_mmap_gtt: Require SET_TILING to work before doing large tiled tests
Older generations are more limited in how much they can fence, and the
limits is enforced in the SET_TILING ioctl. So if it reports an EINVAL,
we cannot perform the tiled test and may just skip it instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-12 09:30:39 +00:00
Chris Wilson
0c26652911 igt/gem_concurrent_all: Add testcases that split the copying across rings
More inter-ring concurrency tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-11 17:27:22 +00:00
Thomas Wood
3dce57a699 tests/kms_force_connector: reset connectors and edid on exit
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:52:44 +00:00
Thomas Wood
a8f6357430 tests/kms_force_connector: clear forced edid in reset
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:50:53 +00:00
Thomas Wood
5652985a54 tests/kms_force_connector: use comparison macros
Use the comparison macros to make debug output clearer.

v2: fix incorrect comparison

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:50:53 +00:00
Thomas Wood
d014339009 tests/kms_force_connector: add an option to reset connector force states
v2: add missing igt_exit call and fix reset_connectors definition

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:49:46 +00:00
Thomas Wood
01e1fca582 tests/kms_force_connector: skip if the required connector is connected
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:21:12 +00:00
Thomas Wood
5570060d33 tests/kms_force_connector: free the display struct when no longer needed
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:21:12 +00:00
Thomas Wood
e9ed1a37fc tests/kms_fbc_crc: ensure context is initialized correctly
Initialization was included in commit a976d7e (tests/kms_fbc_crc:
refactor context handling code), but won't be executed since it is
declared before the first label within a switch statement.

kms_fbc_crc.c:178:2: warning: ‘context’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  rendercopy(batch, context,
  ^
kms_fbc_crc.c:271:22: note: ‘context’ was declared here
   drm_intel_context *context = NULL;

                      ^
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-11 14:20:56 +00:00
Thomas Wood
52a393a311 tests: remove duplicate struct member initializers
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Thomas Wood
24b7bbc726 tests: remove unnecessary igt_exit calls
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Thomas Wood
36b8143c22 Add missing noreturn attribute to various functions
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Daniel Stone
bc37e0297c kms_atomic: Add basic atomic modesetting tests
Add tests for KMS atomic modesetting, to exercise the basic interface
and test failure/corner cases. Should ensure coherency between the
legacy and atomic interfaces.

v2: New patch.
v3: Disable connector checking for now, as it was causing GPU hangs on
    newer kernels.
v4: Rebase.
v5: Use do_ioctl or do_ioctl_err consistently. Use igt_assert_*()
    helper macros rather than igt_assert() directly.
    Move assertions into helper/check functions. Define atomic commit
    helper.
v6: Use do_ioctl_err, and define macros to move errors to
    actual callsite, rather than helper functions.

Co-authored-by: Micah Fedke <micah.fedke@collabora.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:12 +00:00
Daniel Stone
b7a555e997 tests/core_prop_blob: Add multiple blobs per connection
This should hit the bug fixed in:
    commit 8731b269f01e16193390c7276e70530366b8d626
    Author: Maneet Singh <mmaneetsingh@nvidia.com>
    Date:   Thu Oct 8 10:10:24 2015 -0400

        drm: Correct arguments to list_tail_add in create blob ioctl

        Arguments passed to list_add_tail were reversed resulting in deletion
        of old blob property everytime the new one is added.

        Fixes

        commit e2f5d2ea479b9b2619965d43db70939589afe43a
        Author: Daniel Stone <daniels@collabora.com>
        Date:   Fri May 22 13:34:51 2015 +0100

            drm/mode: Add user blob-creation ioctl

        Signed-off-by: Maneet Singh <mmaneetsingh@nvidia.com>
        [seanpaul tweaked commit subject a little]
        Signed-off-by: Sean Paul <seanpaul@chromium.org>
        Cc: stable@kernel.org # v4.2
        Reviewed-by: Daniel Stone <daniels@collabora.com>
        Reviewed-by: Jani Nikula <jani.nikula@intel.com>
        Signed-off-by: Dave Airlie <airlied@gmail.com>

which was introduced with the initial blob support in:
    commit e2f5d2ea479b9b2619965d43db70939589afe43a
    Author: Daniel Stone <daniels@collabora.com>
    Date:   Fri May 22 13:34:51 2015 +0100

        drm/mode: Add user blob-creation ioctl

        Add an ioctl which allows users to create blob properties from supplied
        data. Currently this only supports modes, creating a drm_display_mode from
        the userspace drm_mode_modeinfo.

        v2: Removed size/type checks.
            Rebased on new patches to allow error propagation from create_blob,
            as well as avoiding double-allocation.

        Signed-off-by: Daniel Stone <daniels@collabora.com>
        Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
        Tested-by: Sean Paul <seanpaul@chromium.org>
        Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:12 +00:00
Daniel Stone
de7ccdd083 tests: Run igt.cocci
Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:11 +00:00
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
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ä
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
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
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
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ä
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ä
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