45 Commits

Author SHA1 Message Date
Ville Syrjälä
39aecb05d5 tests/kms_pipe_crc_basic: Use igt_assert_eq() to see the failing frame counts
Use igt_assert_eq() to compare the frame numbers during the frame
sequence tests so that we'll see exactly what the bad frame counts
are when the test fails.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 19:59:10 +02:00
Ville Syrjälä
a7a2c76a80 tests/kms_pipe_crc_basic: Add tests for O_NONBLOCK CRC reads
v2: Rebased due to __attribute__((warn_unused_result))

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 15:01:59 +02:00
Ville Syrjälä
9090745030 lib: Add igt_pipe_crc_new_nonblock()
Add support for reading the CRC in non-blocking mode. Useful for tests
that want to start the CRC capture, then do a bunch of operations, then
collect however many CRCs that got generated. The current
igt_pipe_crc_new() + igt_pipe_crc_get_crcs() method would block until
it gets the requested number of CRCs, whreas in non-blocking mode we
can just read as many as got generated thus far.

v2: __attribute__((warn_unused_result)), document the
    new igt_pipe_crc_get_crcs() return value (Daniel)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08 15:01:59 +02:00
Ville Syrjälä
47db6fbd99 tests/kms_pipe_crc_basic: Skip invalid pipe/port combos
Don't try to test invaliud pipe/port combos. Fixes the test on
VLV w/ DSI since the pipe<->DSI port mapping is fixed. Should also
fix other platforms with similar restrictions.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-10-23 15:40:09 +03:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
Apply the new API to all call sites within the test suite using the following
semantic patch:

// Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls
@@
identifier i =~ "\bdrm_open_any\b";
@@
- i()
+ drm_open_driver(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_master\b";
@@
- i()
+ drm_open_driver_master(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_render\b";
@@
- i()
+ drm_open_driver_render(DRIVER_INTEL)

@@
identifier i =~ "\b__drm_open_any\b";
@@
- i()
+ __drm_open_driver(DRIVER_INTEL)

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Thomas Wood
804e11f40d lib: add a single include header
Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21 09:37:10 +01:00
Daniel Vetter
562bbe12f6 tests: Remove usage of igt_crc_equal and _non_null
Tests should positively check for crc matches, not for mismatches.
Enforce this by only exposing and igt_assert function for comparing
crcs.

For the few tests which didn't just do this as consistency checks but
to do functional tests add FIXME comments that some reference crc
values are missing.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23 11:02:28 +01:00
Daniel Vetter
e588f6dfa6 lib/debugfs: Add igt_assert_crc_equal
Because of hash collisions tests should only ever compare crc
checksums for equality. Checking for inequality can result in random
failures.

To ensure this only expose and igt_assert function and use that.
Follow-up patches will rework the code for tests which don't follow
this requirement and try to compare for CRC inequality.

v2: Rebase on top of Matt's kms_plane changes.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23 11:02:28 +01:00
Tvrtko Ursulin
e36091d1c7 tiling: Convert framebuffer helpers to use fb modifiers
This converts the IGT API only, underneath legacy set_tiling is still used.

v2: One got away in kms_flip.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-12 14:23:48 +00:00
Daniel Vetter
3cd45dec2e lib/igt_gt: Document and consolidate
Also move forcewake and stop_rings code from igt_debugfs to igt_gt
since it fits better. And move the hang injection fork helpers from
igt_aux to igt_gt, too.

Also push the intel_gen call into igt_hang_ring while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:36 +01:00
Daniel Vetter
57259d714d lib/igt_debugfs: Don't setup crc in _new
The problem is that this causes writes to registers, and if the pipe
is off they might go nowhere (e.g. when runtime pm is enabled).
Furthermore we can only really check once the modeset setup is done,
but again most tests set up the CRC structure before calling
igt_commit and friends. We could add crc restore support to the
kernel's rpm code, but that will end up being rather invasive and
fragile hard-to-test code.

Now originally this was needed back when CRC support wasn't available
everywhere. But that's fixed now.

So given all this just drop that sanity check and make sure that we
only touch the debugfs file (and so the hw state) when we know the
pipe is running in the desired configuration.

A complementary kernel patch will try to catch offenders by returning
-EIO if the pipe is off.

v2: Forgot to git add one hunk.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86092
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-24 16:29:27 +01:00
Imre Deak
c256af5d44 test/kms, pm: use drm_open_any_master
These tests require DRM master right, so make sure they have it from the
beginning. This gives an early indication if another DRM master is running
and makes the given test skip (with a proper explanation of the reason)
instead of exiting with error.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-09-30 16:46:28 +03:00
Chris Wilson
3b94d3f8ce igt: Prettify igt_assert_eq() failure messages
This just improves the language about the exact failure to reduce
confusion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 13:20:36 +01:00
Damien Lespiau
b013b21179 kms_pipe_crc_basic: Adjust to the new igt_create.*fb() API
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-21 14:54:01 +01:00
Daniel Vetter
33f0884f3c lib/igt_kms: set_vt_graphics_mode is a low-level helper
So give it a kmstest_ prefix and shuffle it around a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Daniel Vetter
dd8fba44cd lib/igt_kms: Unify pipe name helpers
And add api doc while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Thomas Wood
eef768f283 tests: enable extra connectors in kms_flip and kms_pipe_crc_basic
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11 11:47:46 +01:00
Damien Lespiau
089e8d0a6b kms_pipe_crc_basic: Add a bit a debugging output
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07 17:38:39 +01:00
Damien Lespiau
017f146c57 kms_pipe_crc_basic: Make the number of CRCs a parameter
Let's make the test a bit more generic and have the number of CRCs we're
collecting a define so it can be changed easily.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07 17:37:42 +01:00
Damien Lespiau
f18700b304 kms_pipe_crc_basic: Cycle between 2 differently colored buffer
Instead of just testing if the CRCs are stable, we also test 2 different
fbs to make sure that the CRC is actually changing.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07 17:37:38 +01:00
Damien Lespiau
dbb80a63b4 kms_pipe_crc_basic: Split the main test function a bit more
Let's put the per-output test in its own function to get rid of 1 level
of indentation. We'll need it to cycle through 2 different framebuffers
to make sure we compute different CRCs if the fbs are different.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07 17:37:34 +01:00
Daniel Vetter
ff3c122098 tests/kms_pipe_crc_basic: Add gpu hang tests
Currently pipe CRC support is broken after gpu hangs. This tests for
this bug.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-22 17:30:16 +02:00
Daniel Vetter
f75ec0b452 tests/kms_pipe_crc_basic: Add suspend tests
Currently broken ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-22 16:27:44 +02:00
Daniel Vetter
e624fa8a2e tests: sprinkle igt logging
All the cases that simply dump some debug information and couldn't be
converted to some of the fancier macros.

Some information output removed when it's redundant with the subtest
status.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 00:36:04 +02:00
Daniel Vetter
9aea7ae541 lib/igt_fb: switch to igt_ prefix from kmstest_
Shorter and more in line with our general igt_ prefix for everything
which isn't somehow intel or i915-gem or otherwise hw specific - these
helpers here are all fully generic framebuffer handling functions
based on kms + cairo.

Well, the actual buffer alloc is done with i915 gem, but meh ;-)

Two special cases:
- bpp_depth_to_drm_format and drm_format_to_bpp completely lacked
  prefixes, so just add igt_.
- write_fb was a bit misleading given that we have gem_write for
  uploading to buffers. Rename that to write_fb_to_png to make it
  crystal clear what this thing does even without looking at docs.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
70182167d6 lib: remove kmstest_create_fb
Use the new-style function using drm fourcc codes instead everywhere.

To easily use thew fourcc based interface also expose
bpp_depth_to_drm_format from the library. Finally include drm_fourcc.h
from the igt_kms.h header since pretty much everyone needs this now.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
924115bfcd lib: more unecessary header removal
This time big with media_fill.h

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 20:18:51 +01:00
Daniel Vetter
f2e5dc0114 lib/igt_debugfs: s/igt_pipe_crc_check/igt_require_pipe_crc/
Functions which provide feature checks through igt_skip should be of
the form <prefix>_require_<feature>.

Otoh feature checks which return in a boolean whether the feature is
available should be of the form <prefix>_has_<feature>, e.g.
gem_has_blt.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17 09:47:50 +01:00
Daniel Vetter
cc8f0e6e3a lib/igt_debugfs: Remove debugfs from pipe crc functions
All tests have now lost explicit references to igt_debugfs_t!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17 09:47:50 +01:00
Daniel Vetter
9a7609a8e4 lib/igt_debugfs: Remove debugfs from igt_debugfs_fopen
Also add a missing igt_assert to kms_fbc_crc and again add the missing
Returns: section to the api doc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17 09:47:50 +01:00
Daniel Vetter
f962dee636 test/kms_pipe_crc_basic: Fix up igt_kms conversion breakage
Apparently the framework doesn't ignore disabled pipes correctly, so
help it out a bit.

Again an awesome track record for our QA and bug scrubbers :(

Oh and while I rant: Docs for this stuff, please ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13 19:44:40 +01:00
Daniel Vetter
36a83a6c5c lib/igt_debugfs: drop drm_fd argument from igt_pipe_crc_new
It's nowhere used and removing it gives us a cleaner, more
orthogonal interface.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-12 21:22:52 +01:00
Damien Lespiau
e292e00de0 kms_pipe_crc_basic: Remove spurious inclusion of glib.h
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-18 14:17:10 +00:00
Damien Lespiau
82108d9656 kms_pipe_crc_basic: Remove igt_display_get_n_pipes() usage in main
The fixture won't be run when listing the subtests and thus we can't use
igt_display_get_n_pipes() in the list of tests. The alternative here is
to list the subtests with the maximum values and skip when not supported
on the platform.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 17:51:35 +00:00
Damien Lespiau
2043e6b265 lib: Fix igt_ouput_get_plane() typo (output)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 17:45:48 +00:00
Damien Lespiau
c7e3413a08 kms_pipe_crc_basic: Use kmstest_create_color_fb()
Reducing again the per-test number of lines.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Damien Lespiau
d39f5a059b kms_pipe_crc_basic: Use igt_display_get_n_pipes() instead of hardcoding 3
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Damien Lespiau
a260599b6f kms_pipe_crc_basic: Use for_each_connected_output()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Damien Lespiau
417987353e kms_pipe_crc_basic: Port to the new modeset API
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00: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
Daniel Vetter
a4d3a6c013 lib: make igt_pipe_crc_start never fail
It's what callers expect - pipe_crc_new is the function where
we pass a potential failure back to callers.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-06 14:51:14 +01:00
Daniel Vetter
c1b7e722da lib: add igt_pipe_crc_check
No need to duplicate this all over the place.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-06 14:51:14 +01:00
Daniel Vetter
3e37eb3c6c tests: drm_open_any doesn't fail
Or more precisely: It already has an igt_require. So we cant ditch it
from tests.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-06 14:51:14 +01: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
Daniel Vetter
51dc087864 tests: Use kms_ prefix a bit more
I was a bit on the fence about the basic pipe CRC test since that
doesn't really test kms, but debug infrastructure in debugfs.

Otoh running this one for a full kms testrun is always good, to make
sure that all the other (real) CRC based tests work sanely.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04 19:49:10 +01:00