54 Commits

Author SHA1 Message Date
Daniel Vetter
4acaf0004d tests/kms_flip: More leeway for dummy load tests
At least on my old atom i945 they take forever. Also, metric tons of
pipe B underruns while running rcs-flip-vs-panning. No idea why that
happens.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-20 20:37:21 +02:00
Daniel Vetter
45cd89ab3d tests/kms_flip: Unconfuse the framenumber step checking
We run flips and vblank waits in parallel, which means the step
for each is the maximum. If we'd switch to an interleaved scheme
(to be able to check the correlation) we'd need to add them instead.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-20 16:11:57 +02:00
Daniel Vetter
8e11f8778a tests/kms_flip: no absolute vblank wait on the first frame
We don't have a reference value for the vblank counter yet, so
will end up waiting for a long time for the vblank counter to
wrap around again.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-20 16:11:57 +02:00
Daniel Vetter
e313dee22b tets/kms_flip: disable correlation check
It's broken since it doesn't take the order the events arrived into
account and so will fall over for longer seq_step values in the vblank
event: Since the flip completes right away, but the vblank later on
they won't have the same timestamp.

For now just give up, we could resurrect this by strictly alternating
between a flip and a vblank wait.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-20 16:11:57 +02:00
Daniel Vetter
a5d40a9bf2 tests/kms_flip: fix igt_assert
I've blown the conversion in

commit 37e5b318c5dac290611099e2eec21df1e49fa71f
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Oct 4 18:42:26 2013 +0200

    tests/kms_flip: use igt_assert more

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70332
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-11 20:55:27 +02:00
Daniel Vetter
98a2b5b01f tests/kms_flip: Skip if the kernel doesn't let y-tiled bo slip through
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-11 20:55:27 +02:00
Daniel Vetter
9f3794f5fd tests/kms_flip: exit handler needs a fixture
Since it can fail.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70332
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-11 20:55:27 +02:00
Daniel Vetter
304c458d54 tests/kms_flip: Skip if no clone configuration could be found
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-07 22:55:14 +02:00
Daniel Vetter
37e5b318c5 tests/kms_flip: use igt_assert more
I've left the time delta checks as-is since those are tricky math and
my mind is feeble.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-04 18:42:26 +02:00
Daniel Vetter
54b5f7251a tests/kms_flip: check flip count in both directions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-04 18:12:39 +02:00
Daniel Vetter
16b61932bb tests/kms_flip: use igt_assert in the dpms helpers
No need to route the error code around really.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-03 22:45:53 +02:00
Daniel Vetter
0b19cb5dc2 tests/kms_flip: Check the dpms confusion
Some kernels inadvertedly forwarded dpms changes to crtcs connected to
shared encoders even though that specific output wasn't enabled.
Hilarity ensued.

Note that we only have shared encoders on hsw (DP+HDMI) and with sdvo
cards (multi-function encoders).

v2: Do a full OFF->ON->OFF transition to make sure something actually
happens.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-03 22:31:11 +02:00
Daniel Vetter
1f0addb689 tests/kms_flip: scale test runtime
On machines with many outputs and many crtcs it takes too long.
So scale the runtime by the number of output combinations we're trying
to light up.

Compensate the test runtime a bit by doubling most subtests' duration.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-30 22:55:12 +02:00
Daniel Vetter
3f89d5403e tests/kms_flip: fail harder
At least for pipe A/B we should always fail the test if we can't light
up the preferred mode - the kernel should filter out impossible modes
and for our hw pipe A/B are the least constrained.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-30 22:55:12 +02:00
Daniel Vetter
225a91bc54 lib/drmtest: include sys/mman.h from drmtest.h
We need it for mmapping to get at PROT_READ|WRITE anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:38:29 +02:00
Chris Wilson
472c9dac03 kms_flip: Fix use of fb_width for PAN subtests
We need to be careful to remember that fb-width is not always the same
as hdisplay, since for panning we allocate a larger framebuffer. So fix
up the printfs to use hdisplay/vsisplay since that should be uniform
across the array.

Regression from
commit 919d68901187fa797a9b648fcf87c838fae22fa3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 29 15:33:53 2013 +0100

    kms_flips: Operate on an array of crtc

Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68832
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 13:53:29 +01:00
Chris Wilson
90a25055e3 kms_flip: Remove debugging leftovers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 18:04:11 +01:00
Chris Wilson
a60f930018 kms_flip: Set everything to zero to disable a CRTC
Just setting fb=0 is not enough as the kernel thinks userspace is
insane.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 18:04:11 +01:00
Chris Wilson
93550043ca kms_flip: Use the first mode if we find no matching modes for the crtc pair
We will check that we can set the mode on both crtcs before use, so
hopefully this will work...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 17:41:01 +01:00
Chris Wilson
865b7821e3 kms_flip: Hook up primary events for page-flips
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 17:41:01 +01:00
Chris Wilson
1f2b3e99f9 kms_flip: Run on pairs of connected outputs.
The goal is to flip the same framebuffer on a pair of CRTCs (clone mode)
and check that (a) the flip works in all combinations of workloads, and
(b) that we can hit the desired refresh rate under the simplest, most
ideal of conditions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 16:19:41 +01:00
Chris Wilson
919d689011 kms_flips: Operate on an array of crtc
This should be no functional change as we operate on an array of
crtc[1]. Later we shall test clone mode across a number of crtc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 16:19:41 +01:00
Chris Wilson
d0ed912107 kms_flip: Exercise flip-vs-render
For machine with split BCS/RCS rings, we also need to test whether we
correctly wait upon outstanding render work before flipping and changing
modes. This should also serve to exercise the ring selection code for
flips.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 16:19:41 +01:00
Daniel Vetter
8dbd1fb9d4 lib/drmtest: igt_skip when drm_get_card fails
Also add printf support to igt_skip to make sure there's always a
reason why we fail a testcase.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19 11:09:25 +02:00
Daniel Vetter
5951ffb6a0 lib/drmtest: rip out drm_open_any_master
It's unused. Also most of our tests failed to ask for the right type
of drm fd anyway. So it's imo better to just let them fall over when
they don't get master but want it, like they already do today.

This also allows us to garbage-collect the master parameter to
drm_get_card and associated code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19 10:34:34 +02:00
Daniel Vetter
15c19229f4 lib/drmtest: add igt_subtest_name and use it in kms_flip
Useful when the testname is constructed with igt_subtest_f.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 18:03:09 +02:00
Daniel Vetter
b3880d3a96 tests: roll out igt_fixture
Also sprinkle igt_assert and igt_require over the setup code to clean
up code while at it. To avoid gcc getting upset about unitialized
variables just move them out of main as global data (where they always
get initialized to 0) - gcc can't see through our igt_fixture and
igt_subtest maze properly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 18:02:46 +02:00
Daniel Vetter
a1ca8ef5b1 tests: use igt_exit() consistently with subtests
This is mostly important to get the SKIP reporting right, but I've
found a few stragglers that wanted to get converted over to the igt
result reporting completely.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 16:08:00 +02:00
Daniel Vetter
5e25fcc285 tests: use igt_fail instead of exit(param != 0)
Mostly a sed job with too manual fixups:
- one case of using _exit instead of exit
- and one case which under some conditions use 77, so convert that
  check to an igt_skip.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:15:17 +02:00
Daniel Vetter
83440953e5 tests: s/assert/igt_assert
Just a wholesale rollout for now, we can refine later on.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Daniel Vetter
1caaf0a6b6 s/drmtest_/igt_/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:20:22 +02:00
Daniel Vetter
814b135541 s/drmtest_subtest_block/drmtest_subtest/
The _block postfix meant to convey that a C statement/block must
follow can be misread as the verb to block. So drop it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:15:16 +02:00
Daniel Vetter
9f6365e4ea lib/drmtest: Add drmtest_subtest_block macro
Doesn't do more than an if (drmtest_run_test(name)) right now, but
as soon as we get a bit of infrastructure to handle test failures and
skipping, this will get more interesting.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Damien Lespiau
5fa15f79d0 tests: Black list tests we don't want to run on simulation
Let's start by a small set of tests, to eventually consider running
more.

The current list should then be:

gem_mmap
gem_pread_after_blit
gem_ring_sync_loop
gem_ctx_basic
gem_pipe_control_store_loop
gem_storedw_loop_render
gem_storedw_loop_blt
gem_storedw_loop_bsd
gem_render_linear_blits
gem_tiled_blits
gem_cpu_reloc

gem_exec_nop
gem_mmap_gtt

v2 add (Daniel Vetter)
gem_exec_bad_domains
gem_exec_faulting_reloc
gem_flink
gem_reg_read
gem_reloc_overflow
gem_tiling_max_stride
prime_*

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:49:02 +01:00
Daniel Vetter
db94faede5 tests/kms_flip: don't run blocking relateve vblank waits with interrupts
They simply take forever with the current kernel implementation. And
since everyone switched over to the event based interface I don't see
much incentive to try to fix that.

So just disable them.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-04 01:52:04 +02:00
Chris Wilson
4541cbeba4 tests/kms_flip: Repeat all of the tests whilst being rudely interrupted
Once upon a time, our modesetting code used to fail if it was
interrupted. So lets make sure that never happens whilst flipping.
2013-07-01 12:52:43 +01:00
Chris Wilson
6de9736394 tests/kms_flip: Suppress failure from setting mode
We may fail to set a mode if it fails some hidden constraints, such as
bandwidth on the third pipe. This is expected, so skip testing such
modes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66111
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-24 12:06:00 +01:00
Imre Deak
f68d964c57 lib: refactor kmstest_create_fb
Factor out parts that will be used by an upcoming patch adding
kmstest_create_fb2.

Also call the fb paint functions directly, there is not much
point in passing a function pointer for that.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
bfb0cdd668 lib: add kmstest_get_connector_config
This is used by multiple test cases, so make it shared.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
7fcd94b286 kms_flip: add subtests for the DPMS OFF->modeset->flip sequence
Add a double buffer and a single buffer version of the above sequence,
to check if the modeset does a DPMS ON.

Tested on IVB, with and without the relevant kernel fix, got the
expected results.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-22 18:18:28 +02:00
Imre Deak
404f353394 kms_flip: do a DPMS ON when exiting with error
Currently when exiting with error, we'll get stuck in a DPMS OFF state
if the error happens while we have DPMS OFF set in the test sequence.
This happens even though we switch back to text mode at exit. This might
be a bug in itself to be fixed later, but in any case we want a working
console, so do an explicit DPMS ON.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-22 18:18:28 +02:00
Imre Deak
0009a4af3d kms_flip: set VT graphics mode
This is one reason for some of the sporadic kms_flip failures.
One such is https://bugs.freedesktop.org/show_bug.cgi?id=59834.

v2:
- use unsigned long for KDSETMODE/KDGETMODE
- fix passing the parameter to KDGETMODE as it should be by value
- actually testing that it works..

v3:
- don't do an explicit DPMS_ON, only switch to graphics mode.

v4:
- use the newly added drmtest_set_vt_graphics_mode(), which will also
  take care of restoring the original mode. (Daniel)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-08 21:00:45 +02:00
Imre Deak
d2f7a66fee kms_flip: suppress uninitialized var warning
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-08 20:56:57 +02:00
Daniel Vetter
1677c21291 tests/kms_flip: don't leak gpu hang state
We need to clear out the error_state. While at it also make sure that
the hang was indeed detected.

Whoever writes the next test to race against gpu hangs should probably
extract these two functions into the drmtest library. Which just one
user that's not really worth it right now.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-06 18:30:19 +02:00
Ville Syrjälä
7da0af8855 kms_flip: Don't access freed data
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Ville Syrjälä
069e35e0fc kms_flip: Add flip-vs-bad-tiling test
flip-vs-bad-tiling tests that page flipping to a Y-tiled buffer returns
an error correctly, rather than triggering kernel BUG for instance.

Create a third fb for this purpose. After the fb has been created,
change its tiling mode to Y. When performing a flip, target this
Y-tiled fb and make sure we get the expected error value.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Ville Syrjälä
7ab8e53b5d kms_flip: Add a flip-vs-panning-vs-hang test
The flip-vs-panning-vs-hang is just like the regular flip-vs-panning
test, except it also hangs the GPU. This will test whether panning
works after a pending page flip has been cancelled by a GPU reset,
and also whether page flip events get delivered correctly.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Ville Syrjälä
1f5957c64e kms_flip: Split the "no events" logic into a separate flag
Do not use the TEST_HANG flag to determine whether page flip events are
used. Add a new TEST_NOEVENT flag that can be used to disable the use
of events instead.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Damien Lespiau
7ee278f176 build: Guard the inclusions of config.h with HAVE_CONFIG_H
autoconf can be configured to not generate a config.h but to give the
defines with command line arguments instead. In this case, there's no
config.h to include.

To work in both cases autoconf adds a HAVE_CONFIG_H define on the command
line to signal there's a config.h to include.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:45:34 +00:00
Ville Syrjälä
8c4bb7022b kms_flip: Add flip-vs-modeset-vs-hang test
The flip-vs-modeset-vs-hang test will:
1. simulate a GPU hang
2. exec a nop batch
3. schedule a page flip
4. perform a modeset operation

With the current buggy kernel driver, the modeset operation will
hang indefinitely waiting for the flip to complete. Since the
rings are stopped, that will never happen. The current GPU reset
code doesn't play well with page flips either, so a GPU reset
won't fix things.

Once the kernel driver is fixed, the eventual GPU reset will
save the day.

The nop batch buffer is required only because the kernel can't
currently detect GPU hangs, unless there is at least one user
submitted request pending.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-30 16:06:29 +01:00