368 Commits

Author SHA1 Message Date
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
Daniel Vetter
e14596a6d0 lib: fix igt_exit assert when only listing subtests.
Ooops. Reported by Paulo. Also add a new testcase for make check to
make sure this actually works.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 18:30:22 +01:00
Damien Lespiau
9e21c255e7 lib: Don't forget to close the pipe ctl fd in igt_pipe_crc_reset()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-11-01 16:25:52 +00:00
Daniel Vetter
5d24a67c1b lib/drmtest: Scream harder when igt_exit isn't called for subtest tests
We really need this since otherwise the magic return value handling
for running testcases with piglit (or on QA's validation
infrastructure) doesn't work properly.

We need to be careful though to only install this check on success.

See also the previous commits to sprinkle igt_exit() calls over all
the tests that missed it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-29 11:34:32 +01:00
Damien Lespiau
69c200b0bb lib: Add a drm_open_any_render() that will try to use render nodes
I was fedup with having to run my tests as root and not being able to
use my usual setup for tests that only exercise the GT part of the GPU.

Render nodes to the rescue!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-28 11:00:07 +00:00
Damien Lespiau
8329acb752 lib: Close non intel fds in drm_get_card()
When going through card%u devices, close the ones that we were able to
open but weren't intel devices.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-28 11:00:07 +00:00
Damien Lespiau
949ce5b8a1 lib: Remove stale comment
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-28 11:00:07 +00:00
Damien Lespiau
c3707ab387 lib: Add a function to dump a scratch buf into a png
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-24 13:44:32 +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
Ville Syrjälä
987bcd9a5b lib: Allow pipe_crc_free(NULL)
Prevent pipe_crc_free() from segfaulting on NULL ptr.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-10-21 20:00:32 +03:00
Ville Syrjälä
471ec64de8 lib/drmtest: Add kmstest_paint_color_alpha()
kmstest_paint_color_alpha() just like kmstest_paint_color() except you
also get to specify the alpha channel.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-10-21 20:00:32 +03:00
Daniel Vetter
3d2d73ed45 kmstest: don't pollute stderr for impossible output configs
Otherwise on machines where the only output available is restricted to
one pipe we'll have tons of "warn" results for no gain in the piglit
runner. All tests that use the kmstest helpers already check the
return value and do something sensible (like skip the tests if there's
really no config available).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-20 19:24:08 +02:00
Damien Lespiau
09e9f0b216 rendercopy: Add a way to dump an .aub file with the rendercopy bos
v2 (by Ben): Remove libdrm dependency since intel-gpu-tools now requires
a higher version anyway. Remove associated #ifdef ENABLE_AUB_DUMP

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2013-10-18 09:49:41 -07:00
Daniel Vetter
5038b7e4c2 lib: fix the assert in igt_stop_helper
So much for developing different patches on different machines and
then not retesting after rebasing. Reported by Ben on irc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-18 17:56:02 +02:00
Damien Lespiau
768e32a3ab lib: Don't wait for a vblank when enabling the CRCs
This was a previous attempt to solve the first CRC being bogus. We know
wait for it and discard it at the end of the function.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-18 14:30:53 +01: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
548323c87d lib/drmtest: Check that helper processes have died correctly
If the test gets stopped sometimes a helper process falls over.
We need to report this. Since we currently don't track helper
process to precisely we can't shut up the 2nd test failure messge.
This shouldn't happen anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-17 13:35:51 +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
Damien Lespiau
f673775fe8 lib: Add igt_wait_for_vblank() helper
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:32:09 +01:00
Damien Lespiau
d4e7ddf15d lib: Make igt_debugfs_open() take the mode as argument
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:32:09 +01:00
Damien Lespiau
952d4b0a9c lib: Add a igt_display.h with a few enums and defines from the kernel
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:32:09 +01:00
Damien Lespiau
252dca1c7b lib: Add kmstest_paint_color()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:32:09 +01:00
Damien Lespiau
5a97ea91e1 lib: Add a igt_assert_cmpint()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:02:08 +01:00
Damien Lespiau
ffa2107abc lib: Add igt_debugfs_fopen()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:02:08 +01:00
Damien Lespiau
51b63e334c lib: Add a small helper to open debugfs files
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15 19:02:08 +01:00
Daniel Vetter
ffdece38e2 tests/gem_suspend: test debugfs/sysfs reads while s/r
Just a very quick hack cobbled together with /bin/sh and exec. We
can't use system since that does stupid things with singals ... Still
we need to whack the child process pretty hard to get rid of it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-10 14:20:43 +02:00
Daniel Vetter
590f610140 lib/drmtest: extract rawer __gem_set_tiling
For tests that expect failures. Also apply the existing gem_set_tiling
helper a bit wider.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 20:50:50 +02:00
Damien Lespiau
21a89a9f07 lib: Adjust dump_modes() to the new stereo encoding
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
a7d1937cd7 testdisplay: Use DRM_MODE_FLAG_3D_MASK
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
79f4cfedbf lib: Add a helper to write a png from a struct kmstest_fb
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Damien Lespiau
dac45f5f06 lib: Split create_image_surface() out of create_cairo_ctx()
So we can use it in the next commit.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Damien Lespiau
bde7060e3c lib: Add a helper to paint a PNG using cairo
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Damien Lespiau
30e0710ca3 lib: Dump information about the supported 3D stereo formats
When dumping the details of a mode, let's add the 3D formats the mode
supports.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Daniel Vetter
64cfe4eefe lib/drmtest: Improve printf-like igt_skip_on/require
Ben Widawsky suggested to use vasprintf, which perfectly fits the bill.

Also fix the logic conversion bug in tests/gem_storedw_batches_loop that
crept in again :(

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19 19:56:03 +02:00
Daniel Vetter
e5cdd62624 lib/drmtest: igt_assert|require with format strings
v2: Add a comment about the pitfalls around va_list handling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19 19:40:32 +02:00
Daniel Vetter
d1b9bc0dc1 lib/drmtest: check that igt_exit is called for subtest tests
I get this wrong for almost every conversion to subtests ...

v2: Don't install the check when just listing subtest names.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-17 00:13:47 +02:00
Daniel Vetter
a031a1bf93 lib/drmtest: ducttape over fork race
Whatever the reason (and I've thought there isn't one) if we fork and
kill right away the child seems to not reliably die. We can work
around this little race by forcing the default SIGQUIT handler. This
should break anything since we reset our atexit handling anyway, so if
the helper needs any atexit handling the special signal helpers will
be reinstated.

Note that inserting sufficient amounts of printf between the fork and
kill makes this unnecessary.

While add it also add the retry loop for the waitpid call, in case
there's another guy constantly interrupting us.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-13 16:48:08 +02:00
Daniel Vetter
932716dd91 lib/drmtest: skip suspend tests in simulation
The simulator doesn't like this nor really support it :(

v2: We've tried to a more gentle resume testing using the pm_test
infrastructure, but that alos failed. So add a FIXME comment that we
need to improve things a bit here.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-13 11:19:10 +02:00
Daniel Vetter
506ef293ab lib/drmtest: drop unused oldsig variabel
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-12 12:57:26 +02:00
Daniel Vetter
212de08d0f lib/drmtest: Restore default sighandlers
Forked tests ended up restoring the sighandlers already inherited
from the parent, resulting in endless signal loops through our
atexit handler.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 15:46:43 +02:00
Daniel Vetter
661f252f7e lib/drmtest: don't frob signals in __igt_fork_helper
We shut up the exit handlers already by clearing the array.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 15:05:20 +02:00
Daniel Vetter
9fb316a6db lib/drmtest: clean up children in an exit handler
Also be a bit more careful with killing them in general.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 14:29:00 +02:00
Daniel Vetter
bbc820302b lib/drmtest: handle SIGBUS in the exit handlers
Our kernel likes to occasionally kill process with a SIGBUS when this
shouldn't ever happen. Hence also handle this signal in the exit
handler infrastructure.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 12:11:54 +02:00
Daniel Vetter
14dd7cb8aa lib/drmtest: Reject igt_fork from within igt_fork earlier
We reject it in igt_waitchildren already, but earlier is better.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 11:51:40 +02:00
Daniel Vetter
5f790db084 lib/drmtest: Fix igt_stop_signal_helper for subtest listing
We need to bail out early for otherwise we'll hit the
!signal_helper->running assert.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 11:09:08 +02:00
Daniel Vetter
b3a61c8028 lib/drmtest: skip when prefault control isn't available
Instead of crashing with an igt_assert. Fixes the only crashing test
when running igt on non-intel systems.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 10:47:07 +02:00
Daniel Vetter
2b218f69d7 lib/drmtest: Use ARRAY_SIZE
Less fragile ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 10:40:25 +02:00
Daniel Vetter
57e6746181 lib/drmtest: double-check that we clean up helper processes
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10 18:22:17 +02:00
Daniel Vetter
e73c1a07f3 lib/drmtest: consolidate the helper process killing in one exit handler
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10 18:22:17 +02:00
Daniel Vetter
edd723457c lib/drmtest: create helpers for forking helper threads
The upshot is that we can share the logic to make sure the helpers
are all properly stoved again in a 2nd step.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10 17:40:06 +02:00