117 Commits

Author SHA1 Message Date
Paulo Zanoni
69856b5e7b tests/kms_flip: don't leak the connector_config struct
... in case we can't find a compatible mode. We already have
config[0], we can't return without freeing it first.

Caught by Valgrind.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-01-07 09:57:04 -02:00
Paulo Zanoni
056500bdc5 tests/kms_flip: don't leak the CRTC
The kms_flip program calls kmstest_get_connector_config, which returns
a struct containing some allocated variables, including a pointer to
the CRTC. The problem is that we copy the values returned by this
structure to the test_output struct, but we ignore the CRTC pointer.
So free the CRTC pointer instead of leaking it.

Caught by Valgrind.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-01-07 09:57:04 -02:00
Paulo Zanoni
02ad7e04dd tests/kms_flip: don't leak the connector when setting DPMS
Caught by Valgrind.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-01-07 09:57:04 -02:00
Chris Wilson
164d9d26ac kmstest: Fix up lifetimes of cairo objects
cairo_t is the short lived drawing context, whereas cairo_surface_t is
the heavyweight object that persists and is also tied to underlying GEM
objects. So make the kmstest API reflect the different weights and fix
the lifetime and underlying object reference leaks.

Based on the fix by Paulo Zanoni.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-31 12:30:30 +00:00
Imre Deak
13ef9e8d54 kms_flip: consolidate run_test_on_{crtc,crtc_pair}
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-10 15:46:00 +02:00
Imre Deak
1ac94b50af kms_flip: keep drm_fd open for the dpms restore exit handler
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69161

Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-12-10 14:07:37 +02:00
Imre Deak
2c6c4cf2a1 kms_flip: fix seq_step for 2xcrtc subtests
This also raises the absolute wait-for-vblank sequence step from 5 to
10, just to make it consistent with the corresponding 1x subtests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69161
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-10 14:07:37 +02:00
Ville Syrjälä
725da6ee74 rendercopy: Pass context to rendercopy functions
rendercopy does the batch buffer flush internally, so if we want
to use it with multiple contexts, we need to pass the context
in from caller.

v2: Modify rendercopy_gen8 as well

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-27 16:21:28 +02:00
Oscar Mateo
37f26d17b1 lib: Move kms stuff from drmtest.c over to igt_kms.c
This makes cairo dependencies easier to handle. Otherwise, we
would have to litter drmtest all over with "#ifndef ANDROID"

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
[danvet: Add missing _GNU_SOURCE to igt_kms.c and missing include to
intel_sprite_on.c]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-12 12:04:12 +01:00
Ben Widawsky
f4dfa37e85 bdw: Update obvious missing blit support
This provides a macro that allows us to update all the arbitrary blit
commands we have stuck throughout the code. It assumes we don't actually
use 64b relocs (which is currently true). This also allows us to easily find
all the areas we need to update later when we really use the upper dword.

This block was done mostly with a sed job, and represents the easier
in test blit implementations.

v2 by Oscar: s/OUT_BATCH/BEGIN_BATCH in BLIT_COPY_BATCH_START

CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
2013-11-06 09:34:35 -08:00
Daniel Vetter
223a61e12e lib: make igt_install_exit_handler never fail
Most callers didn't bother checking, so just move the asserts into
the function itself.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 21:10:59 +01:00
Daniel Vetter
1f0cf2df85 lib: make igt_set_vt_graphics_mode never fail
All tests agree that this is a letal failure, so no point
to pass it back to callers.

Also add some igt_require calls for the drm_fd where I've
noticed that it's missing.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 21:10:59 +01:00
Ville Syrjälä
fa05c0bced kms_flip: Add test for -ENOENT
Make sure we get -ENOENT when we pass a non-existing fb_id to
the page flip and setcrtc ioctls.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-10-21 20:23:18 +03:00
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