1988 Commits

Author SHA1 Message Date
Rodrigo Vivi
d074b44ab6 kms_frontbuffer_tracking: Increase the time we wait for PSR.
With commit (drm/i915: Delay first PSR activation.) in kernel
PSR might take a bit longer to really activate after the modeset.
The first PSR activation after modeset is taking 5 times the panel
power cycle delay time, which is 600ms for our machines here.
So timeout here needs to be a minimum of 3s. However let's use
5s as the safe value in case we find machines with higher power
cycle delay.

Since we do a lot of assert(psr_disabled), this commit is increasing
the time it takes to run the whole set of PSR tests by a few minutes,
which had been reduced by commit f4db3b18841
("kms_frontbuffer_tracking: reduce the PSR wait timeout to 2s").

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-07 09:05:55 -08:00
Bob Paauwe
8b22e051e8 igt/pm_rps: current freq < user specified min is not a fail (v3)
Since commit

  commit aed242ff7ebb697e4dff912bd4dc7ec7192f7581
  Author: Chris Wilson <chris@chris-wilson.co.uk>
  Date:   Wed Mar 18 09:48:21 2015 +0000

      drm/i915: Relax RPS contraints to allows setting minfreq on idle

it is now possible that the current frequency will drop be the user
specified minimum frequency to the "idle" or RPn frequency. Update the
 pm_rps tests to reflect that droping below the user specified minimum
is no longer considered a failure.

v2: Add check RPn <= current freq. (Me)
v3: Use RPn instead of MIN frequency in idle check (Imre)
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-12-04 22:26:06 +02:00
Daniel Vetter
6cf72724e2 tests/drv_hangman: Open drm fd before doing anything
This way we correctly auto-skip instead of falling over the
lack of i915 debugfs files first and fail the testcase due to
that.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-04 16:35:31 +01:00
Daniel Vetter
ee0808982f tests/drm_lib.sh: Skip when i915 debugfs wasn't found
Instead of failing. We might want to move this into i915 tests
eventually, but this is good for now.

v2: Use the correct exit code (Derek) and use the new symbolic values
Thomas added.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-04 16:35:00 +01:00
Daniel Vetter
d8d1eab318 lib: igt_fork_hang_helper must be run in fixtures
Because it opens an intel-specific drm fd. Fixes crashes when running
igt on no-intel.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-04 16:33:58 +01:00
Daniel Vetter
839a1426ce tests/kms_force_connector: Include in BAT set
Forcing connector state is a basic piece of our test infrastructure
that we use in all the kms_ tests. It allows us to run tests even if
no outputs are connected.

They're also really fast, so perfect candidates for inclusion into the
BAT set.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-04 10:50:50 +01:00
Daniel Vetter
db4f83ca5d lib/kms+tests: Use cached connector state
Speeds up testcases except for those where we want to exercise the
probing itself. The only exceptions left where we do a full probe are

- pm_rpm: We use it to make sure the kernel doesn't get things wrong
  with power domains, so we really want to exercise the full probe
  paths. And there the only place really is the specific validation
  done with the data gathered by get_drm_info.

- kmstest_force_ functions: Newer kernels should be better at
  re-probing state when the force sysfs fields change, but better safe
  than sorry.

v2: I also consolidated the start_n_modes and start_connectors while
at it - move one of the fixup hunks to this patch that accidentally
got misplaced (Thomas).

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-04 10:49:11 +01:00
Daniel Vetter
cdb398b5b9 tests/kms_force_connector: Fixes
The edid we inject stayed the same, but the kernel started to list
more modes for it. No idea whether that's the right thing here since
I'm not really an EDID expert. But then again the testcase wants to
check that the injection works, not validate the kernel's parser.

v2: Only check the preferred mode for more future-proofing (Thomas).

v3: Clarify commit message (Jani).

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-04 10:48:05 +01:00
Thomas Wood
02cdd9899d tests: add exit value constants for shell script tests
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-03 11:36:02 +00:00
Thomas Wood
8a58734c11 tests: replace drm_open_any in gem_create and gem_stolen
drm_open_any has been replaced by drm_open_driver.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-03 11:12:38 +00:00
Ankitprasad Sharma
67d32c210d igt/gem_create: Test to validate parameters for GEM_CREATE ioctl
This test validates the two parameters (size and flags) GEM_CREATE ioctl.

v2: Added IGT_TEST_DESCRIPTION (Thomas Wood)

v3: Removed use of hard coded values, updated comments (Tvrtko)

v4: Removed over-use of macros, updated with multiples of PAGE_SIZE (Tvrtko)

Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-03 10:40:49 +00:00
Ankitprasad Sharma
48c945322b igt/gem_pread: Support to verify pread/pwrite for non-shmem backed obj
This patch adds support to verify pread/pwrite for non-shmem backed
objects. It also shows the pread/pwrite speed.
It also tests speeds for pread with and without user side page faults

v2: Fixed Rebase conflicts (Ankit)

v3: Precalculating values to avoid redundant function calls (Dave)
Replaced igt_subtest by igt_subtest_f, added asserts for mmap, corrected
indentation (Tvrtko)

v4: Updated data types to avoid redundant type conversions (Tvrtko)
Corrected pagefault-pread time calculation (Ankit)

Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-03 10:40:40 +00:00
Ankitprasad Sharma
70c3be83a0 igt/gem_stolen: Verifying extended gem_create ioctl
This patch adds the testcases for verifying the new extended
gem_create ioctl. By means of this extended ioctl, memory
placement of the GEM object can be specified, i.e. either
shmem or stolen memory.
These testcases include functional tests and interface tests for
testing the gem_create ioctl call for stolen memory placement

v2: Testing pread/pwrite functionality for stolen backed objects,
added local struct for extended gem_create and gem_get_aperture,
until headers catch up (Chris)

v3: Removed get_aperture related functions, extended gem_pread
to compare speeds for user pages with and without page faults,
unexposed local_gem_create struct, changed gem_create_stolen
usage (Chris)

v4: Splitting patch to remove changes from gem_pread/gem_pwrite
to another patch (Ankit)

v5: Fixed Rebase conflicts (Ankit)
    Added IGT_TEST_DESCRIPTION (Thomas Wood)

v6: Added __gem_create_stolen for user to handle error, updated
gem_create_stolen to align with gem_create function, corrected
fill_purge test (out of bound access), added testcase to validate
allocating of more than 32 bit sized buffers (Tvrtko)

v7: Removed unused variables, Corrected comments & formatting (Tvrtko)

Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-03 10:40:29 +00:00
Thomas Wood
97bf3f9a55 tests/core_setmaster_vs_auth: add test description macro
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-02 16:17:18 +00:00
Thomas Wood
66dc90ed65 tests/core_setmaster_vs_auth: use igt_simple_main
This test has no subtests, so should use igt_simple_main.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-02 15:02:52 +00:00
Thomas Wood
0394844a47 tests/gem_request_retire: add test description
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-02 15:02:52 +00:00
Jani Nikula
72b6bec370 tests: fix ddx_intel_after_fbdev to use intel_reg
intel_reg_dumper is gone, replaced by 'intel_reg dump'.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-02 13:14:03 +02:00
Daniel Vetter
5830a7a04b tests: Add core_setmaster_vs_auth.c
Embarrasingly I noticed that I need to git add the file when resolving
the conflict and manually applying my patch. But then I added the
wrong file ... Reported by Thomas Wood.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-01 18:33:17 +01:00
Daniel Vetter
80546d4576 tests/pm_rpm: Don't compare edid blob IDs
The kernel is free to allocate blob ids however it wants to. And also
to reallocate them whenever it sees fit. The only thing we are allowed
to compare is the length and the actual date.

Removing this bogus check makes drm-resources-equal on my snb.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90546
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-01 17:56:07 +01:00
Daniel Vetter
8133295d02 tests: add core_setmaster_vs_auth
Tests that master state isn't leaked to new masters by checking
that auth magics for the old master don't work any more.

Based upon a simple test program provided by Thomas.

v2: Use comment Thomas suggested on intel-gfx.

Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-01 17:44:32 +01:00
Daniel Vetter
92e83cb379 tests: Rename drm_auth to core_auth
It really is a core drm testcase and not a libdrm testcase. While at it
also make it generic, since it is.

Cc: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-01 17:31:27 +01:00
Marius Vlad
4cfcea4056 tests/pm_rpm tests for set_caching and set_tiling ioctl(s)
v4: re-bind the gem objects each time before calling
disable_all_screens_and_wait().

v3: Use smaller sizes when allocating gem objects for caching tests.

v2: use mmap to gtt instead off cpu and various style-changes.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-11-27 20:29:19 +02:00
Paulo Zanoni
d2a17f4bc4 kms_frontbuffer_tracking: add tilingchange subtest
During the review of a recent FBC patch, Ville pointed a problem that
happens when we use the page flip IOCTL to switch between buffers that
have different tiling formats. This test should catch the problem
introduced by that patch - which was not merged, by the way, so the
test should be passing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-27 09:57:35 -02:00
Paulo Zanoni
98bb8428b2 kms_frontbuffer_tracking: assert the stride changes at stridechange()
We use igt_create_fb(), which decides the stride by itself: there's no
guarantee that making a buffer 512 pixels bigger is going to make its
stride change.

I had a fix for this problem that was supposed to be applied before
this patch, but due to a rework request I'm changing the order of the
patches, so we should expect to hit this assertion for now. At least
the root cause of the problem is clear now.

v2: Update the commit message due to the patch order changing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-27 09:57:35 -02:00
Paulo Zanoni
f23ea58f1f kms_frontbuffer_tracking: expand badstride and stridechange
Make those subtests try to change the stride using multiple APIs so we
can catch errors that affect full modesets, fast modesets and page
flips.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-27 09:57:35 -02:00
Paulo Zanoni
340599c986 kms_frontbuffer_tracking: move flip_type to struct test_mode
Handle it just like we handle t->format. IMHO, it's better.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-27 09:57:35 -02:00
Paulo Zanoni
b4c58857e5 kms_frontbuffer_tracking: do page flips using the planes API
Add a new FLIP_PLANES enum so we can do "page flips" using it too. The
goal is to exercise the fast modeset paths on the Kernel.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-27 09:57:35 -02:00
Paulo Zanoni
d63413771f lib/igt_fb: also pass the stride to igt_create_fb_with_bo_size()
If the caller is going to specify a custom size, it's likely that he
will also specify a custom stride. The automatic stride picked by
create_bo_for_fb() is too huge for tiled buffers, so if the caller
wants smaller buffers, then he'll need a smaller stride too, otherwise
the Kernel will reject the addfb IOCTL due to stride * height being
bigger than the size.

I want to make tests/kms_frontbuffer_tracking use
igt_create_fb_with_bo_size() so I can provide smaller buffers that
will fit into the CFB. I'm also planning to make all frontbuffers with
the same width/height/format have the same stride and size regardless
of tiling method so I can exercise specific code paths.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-27 09:57:35 -02:00
Chris Wilson
26507f3e21 igt/gem_cs_prefetch: Convert to intel_require_memory()
Replace the open-coded memory check with intel_require_memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-27 10:03:55 +00:00
Chris Wilson
e10ba6b51c igt/drm_read: Clear O_NONBLOCK between tests
Ensure that O_NONBLOCK isn't accidentally set when we want a nonblocking
file descroptor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-25 14:33:49 +00:00
Mika Kuoppala
32329b2e7d tests/drm_import_export: Always loop with mutex held
We assume that lock is held on start of the loop scope.
Some paths continuing inside loop didn't adhere to this
assumption, causing segfault on unlocking an already
unlocked mutex. Fix this by re-aquiring lock always.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93013
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2015-11-25 15:52:18 +02:00
Chris Wilson
3b1a55874d igt/drm_read: Check handling of pagefault on destination buffer
In theory, this should force i915_gem_fault() when we first use the
buffer (and not at mmap time) and so prevent a __copy_to_user_inatomic()
from writting to the buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-25 11:13:25 +00:00
Tvrtko Ursulin
dcdf21beb8 igt/gem_request_retire: Provoke context destruction with active VMAs
Test designed to trigger the
WARN_ON(!list_empty(&ppgtt->base.active_list))
in i915_gem_context_clean.

v2:
Simplify execbuf building and the test itself. Cleanup code. (Chris Wilson)

v3:
Removed asserts done by the helpers already. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-24 12:58:17 +00:00
Vivek Kasireddy
938b9306be igt/kms_rotation_crc: Add a new subtest to exhaustively test for fence leaks (v3)
In this subtest, as a first step, MAX_FENCES+1 number of framebuffers are
created backed up by objects that have multiple GGTT views (normal and
rotated). Next, we have the i915 driver instantiate a normal view followed
by a rotated view. We continue doing the above MAX_FENCES + 1 times.

v2:
- Add a igt_require() to check if there is enough GTT space left for
  MAX_FENCES+1 framebuffers. (Tvrtko)
- Make data2 local to test_plane_rotation_exhaust_fences(). (Tvrtko)
- If there is a failure, deallocate all the previously allocated
  framebuffers before asserting.

v3: Close the gem handle if set_tiling or addfb fails. (Tvrtko)

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: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2015-11-17 14:34:51 +00:00
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