72 Commits

Author SHA1 Message Date
Matt Roper
cd99ddead3 kms_cursor_crc: Add test for unthrottled cursor movement
We've had  bugs in the past that caused cursor updates to be synced to
vblank, resulting in sluggish cursor movement.  Add a test to try to
make sure we don't regress and reintroduce these bugs.

Cc: kalyan.kondapally@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-16 15:35:28 +01: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
Damien Lespiau
09ea86eac1 kms_cursor_crc: Move comment to the appropriate place
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-11 17:06:56 +01:00
Daniel Vetter
a5c6b8df8b tests/kms_cursor_crc: Add dpms and suspend tests
There was some confusion about whether we restore cursors correctly
after dpms and suspend/resume. Apparently we still do!

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
Daniel Vetter
4fec18e5e0 lib/core: add interactive debug point to igt_fail
Useful for inspecting the screen state in kms tests when they fail.

Also move the screen clearing in kms_cursor_crc to the bottom.

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
Matt Roper
07be8fec15 igt.cocci: Replace igt_assert() with igt_assert_CMP() where possible
The integer comparison macros give us better error output by including
the actual values that failed the comparison.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-06 18:06:10 +01:00
Matt Roper
9ca2cc12b4 kms_cursor_crc: Kernel now checks for integer overflow
As of kernel commit

    commit a679064a7e9e8799177a64a31668a34a1bc6a4f1
    Author: Matt Roper <matthew.d.roper@intel.com>
    Date:   Fri Jan 30 16:22:37 2015 -0800

        drm/i915: Switch planes from transitional helpers to full atomic helpers

the kernel now checks for cursor coordinates that would result in
integer overflow and returns -ERANGE, similar to the checking that was
already done for other plane types.  We update kms_cursor_crc here to
reflect this small behavior change:
 * Check for success at extreme boundary conditions INT_MAX-{width,height}
   rather than INT_MAX
 * Add new check for success at SHRT_MAX; if the driver were to
   internally use short values and overflow, we could have the cursor
   reappear on the screen.
 * Add a test for failure with proper error code at INT_MAX-{width,height}+1

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2015-02-10 09:20:39 -08:00
Ville Syrjälä
5d46f68eab tests/kms_cursor_crc: Restore the valid pipe/connector combo check
The valid pipe/connector combo check was lost in
 commit 57259d714d3fe1170cf931af72648219856a9918
 Author: Daniel Vetter <daniel.vetter@ffwll.ch>
 Date:   Mon Nov 24 16:08:32 2014 +0100

    lib/igt_debugfs: Don't setup crc in _new

Restore it to make the test again useful on CHV.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-09 22:35:36 +02:00
Damien Lespiau
d49ef76e98 kms_cursor_crc: Remove value to 'return' in a void function
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-12-09 17:07:22 +00: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
Thomas Wood
3d0dca47c6 docs: add some test descriptions
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 13:24:29 +00:00
Paulo Zanoni
bba1cd0091 tests/kms_cursor_crc: HSW/BDW only have square cursors
When I look at cursor_size_ok() (from the Kernel's intel_display.c), I
see that only 845g and i865g support non-square cursors, so SKIP the
tests on HSW/BDW instead of failing them.

This problem happened because support for non-square cursors was being
developed for HSW/BDW, but it ended up not being merged due to a small
problem and priority changes. Let's make those tests SKIP until we
have proper support on the Kernel: after that, we can revert this
patch.

v2: Improve commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84268
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-17 19:00:50 -03:00
Thomas Wood
6a8d33c2bb lib: add a function to indicate activity
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30 17:54:12 +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
Damien Lespiau
32a0308e2d kms_cursor_crc: Remove two unused local variables
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-26 16:48:02 +01:00
Ville Syrjälä
25c55d3fc2 tests/kms_cursor_crc: Add basic non-square cursor testing
To minimally verify that non-square cursors work on the platforms where
they're supported perform the tests first with WxH cursor and then
repeat with WxH/3 cursor.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-09-18 12:56:56 +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
0c14af65ea kms_cursor_crc: Use I915_TILING_NONE to create fbs
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
Daniel Vetter
fb38cf260b tests/kms_cursor_crc: Align opening {
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Daniel Vetter
8bf115ed99 lib/igt.cocci: Add stanza for for_each_pipe
Damien dodged this ...

Also run the script while at it.

v2: Don't just capture identifiers for pipe, but also expressions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-11 17:43:22 +02:00
Matt Roper
3f46e81558 tests/kms_cursor_crc: Call drmModeMoveCursor() directly
We're calling drmModeSetCursor() to change the cursor image and never
actually doing a display commit (aside from when we display the cursor),
so call the move ioctl directly rather than igt_plane_set_position() to
ensure the changes actually take effect.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04 12:04:26 +01:00
Matt Roper
07087ada29 tests/kms_cursor_crc: Combine data_t and test_data_t
If a subtest fails, cleanup_crtc() never gets called and then the
test_data_t structure for the test is lost, including the CRC file
descriptor that we never got a chance to release; this causes all
subsequent tests to fail with -EBUSY at igt_pipe_crc_new().

The split between permanent data_t and temporary test_data_t doesn't
seem to serve a purpose, so just combine the fields from both into
data_t.  This will prevent us from losing the CRC filedescriptor so that
we can properly close and reopen it after a failed test.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04 12:04:23 +01:00
Antti Koskipaa
21fb118f3b kms_cursor_crc: Test cursor size change ioctl
Now that we support cursor changes other than 64x64, a bug was found
where the size change was only applied at cursor enable time, rather
than at every update. Add a testcase for that.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-02 17:49:53 +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
Ville Syrjälä
a461515b33 kms_cursor_crc: Fix the test on platforms where the pipe->port mapping has restrictions
On gen2 for instance the LVDS port can only be fed from pipe B. Check
whether the combinations is valid before trying to run the test. Also
clean up the state back to PIPE_ANY properly so that following tests
can again go through all the combinations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75131
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:20 +03:00
Ville Syrjälä
5b90833941 kms_cursor_crc: Wrap igt_require() in igt_fixture
igt_require() must be within a fixture or subtest.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
f688a56ee8 kms_cursor_crc: Replace snprintf()+%s with just %d
There's no point in first printing the int to temp string using %d
and then printing that out with %s. Just stick the %d into the final
string.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
fb2ccb1ade kms_cursor_crc: Allow the test to run without cursor cap support
Assume that only 64x64 cursor size is supported if the cursor size caps
aren't supported by the kernel. This allows the test to run on older
kernels.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
f8e5a3fc7e kms_cursor_crc: Wrap cursor fb creating into igt_fixture
We don't want to attempt creating the cursor fb when enumerating
subtests. So wrap it into igt_fixture. Also destroy the cursor
fb after the tests.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
f6e869732c kms_cursor_crc: Simplify the pipe_crc mess
Instead of allocating an array of igt_pipe_ctc_t objects, just allocate
one and stick it into test_data.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
aaef7ad376 kms_cursor_crc: Add background picture
This gives the cursor something to be on, instead of just a black
background. Slows the test down only one second over six minutes.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
fafcff90a8 kms_cursor_crc: Add random cursor placement test
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
470e5ce6c3 kms_cursor_crc: Add moving cursor test
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
795eddc639 kms_cursor_crc: Add reference software rendering
This patch first render the cursor with hardware rendering and
then with software, acquiring the CRC in both cases so they can be
properly compared. Say goodbye to crc_must_match variable.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
ead0173c4d kms_cursor_crc: Separate onscreen and offscreen tests
Also remove onscreen boolean from parameter list. All test-related
data should be put into test_data from now.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
fe8041b8f9 kms_cursor_crc: Use a function pointer to call test
More tests are coming, and this allows us to not repeat the boilerplate
code in run_test() for each subtest.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
7ec631c242 kms_cursor_crc: Move cursor enable and disable calls where they belong
We can't have the hw cursor enabled during software render tests.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
[vsyrjala: collect the crc before disalbing the cursor]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:15 +03:00
Antti Koskipaa
a593d613f9 kms_cursor_crc: Remove some test cases and change cursor to color
Currently this test is quite useless, since it only checks for valid CRCs when
the correct output from a test is a completely black screen (invisible or visible
but black cursor, or cursor is offscreen) and disables the check when anything
visible is onscreen.

This patch changes the cursor to a colorful one and removes the test cases
that become redundant because of this change. The cursor is designed to be
asymmetrical such that future tests involving rotation, mirroring, etc. produce
different CRCs and failures can be detected.

This (temporarily) disables CRC testing until the next patch which will add
software rendering of the cursor and the CRC generation.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:16:38 +03: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
2fc2fa5471 lib/igt_kms: s/kmstest_create_fb2/kmstest_create_fb/
Simplify the name since the old _fb function is now gone.

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
52edf3a177 tests/kms_cursor_crc: Fix up breakage
I've accidentally broken the new cursor size extensions, but it
wasn't quite correct before already: Variables which are set in
igt_fixtures _must_ be outside of the stackframe of the igt_fixture
block.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 14:46:21 +01:00
Daniel Vetter
701a755bde tests/kms_cursor_crc: Review from Imre for Sagar's patch
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-20 17:32:14 +01:00
Sagar Kamble
ba3a1a86b7 kms_cursor_crc: Enabling this test for all cursor sizes
v1: Added 128x128 and 256x256 cursor size support.

v2: Refined the test to use igt_subtest_f and automate enumeration.

v3: Restructuring test enumeration using drmGetCap. [Daniel's review comments]

Signed-off-by: Sagar Kamble <sagar.a.kamble@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-20 17:32:14 +01:00