16 Commits

Author SHA1 Message Date
Daniel Vetter
071e9ca1ca lib: add igt_main macro
In the past new testcases with subtest often forgot to add the call to
igt_exit at the end of their main() function. That is now caught with
a bit more obnoxious asserts, but it's still a nuissance.

This little igt_main macro takes care of that (and also of calling the
subtest machinery initialization code correctly).

If no one objects I'll roll this out for all the simple cases (i.e.
those tests that don't have additional argv parsing on top of the
subtest machinery).

v2: Roll it out across the board.

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
Daniel Vetter
0369fe19b8 lib: consolidate pipe crc exit handler
No need to sprinkle this all over:
- exit handlers will only be registered once
- they're always called when exiting, so no need to explictly call
  them.

This allows us to hide all the pipe crc cleanup in the library.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 21:10:59 +01:00
Daniel Vetter
8bb5730d28 tests/debugfs_pipe_crc: set mode before creating CRC helper
Otherwise the automagic skipping for DP ports on gmch platforms
won't work.

v2: We also need to just skip that connector, not the entire subtest.

kms_cursor_crc still needs to be updated.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 20:43:16 +01:00
Daniel Vetter
842007154d tests: use "auto" pipe CRC source
Makes stuff work on DP ports on gmch platforms automatically.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 20:43:15 +01:00
Ben Widawsky
164b540936 debugfs_pipe_crc: skip on simulation
As with other display tests, they're not working (and in this case,
cause hangs).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-10-31 14:16:41 -07:00
Daniel Vetter
780807099a tests: Use igt_exit for tests with subtest
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-29 11:15:43 +01:00
Ville Syrjälä
0786d5cc8f lib: Check pipe source validity in igt_pipe_crc_new()
Have igt_pipe_crc_new() check whether the selected source is actually
supported.

v2: Make debugfs_pipe_crc.c not crash

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-10-21 20:00:32 +03:00
Daniel Vetter
f698984bae tests/debugfs_pipe_crc: new subtest to check CRC frame numbers
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-20 16:11:57 +02:00
Damien Lespiau
5e3047ce52 tests/debugfs_pipe_crc: Test the read CRCs are not null
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-18 12:27:21 +01:00
Daniel Vetter
43f5384c08 tests/debugfs_pipe_crc: test all connectors
Diff looks a bit ugly, but it's just due to the added indentation.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-17 14:18:35 +02:00
Daniel Vetter
070904bf59 tests/debugfs_pipe_crc: test all pipes
And skip them if there's no suitable connector.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-17 14:10:43 +02:00
Daniel Vetter
e6ad75c1c4 tests/debugfs_pipe_crc: fix fb leak
Also remove the unused connector_t->mode.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-17 14:09:52 +02:00
Daniel Vetter
173a4cf1da tests/debugfs_pipe_crc: fall back to PIPE source
With PLANE1 and PIPE CRC sources the test will work on all currently
shipping (and planed fwiw) platforms.

Also add all the other new sources for non-ivb/hsw chips.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-17 13:35:51 +02:00
Daniel Vetter
0412f32670 tests/debugfs_pipe_crc: correctly skip on unsupported platforms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-16 14:12:49 +02:00
Damien Lespiau
4ba97ddf96 debugfs_pipe_crc: Let's check CRCs!
Let's add a new test that sets a mode, wait for a few vblanks (3) and
then make sure we read 3 identical CRCs.

Some subtests check for various parsing errors.

In the process, improve the debugfs helpers to deal with CRCs.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:40:07 +01:00