57 Commits

Author SHA1 Message Date
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
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
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
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
1d2c9d5e57 lib: Include drm_fourcc.h from igt_kms.h
This include is needed for the DRM_FORMAT* defines used in the fb
creation helpers.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Damien Lespiau
063194074e kms_cursor_crc: Use kmstest_create_color_fb()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Damien Lespiau
1c608a2af8 tests/kms_cursor_crc: Use igt_pipe_crc_collect_crc()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Damien Lespiau
d435829ae9 kms_cursor_crc: Port the test to the new modeset API
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Damien Lespiau
969435a407 tests/kms_cursor_crc: Move the array of cursor fb_ids to the stack
This array is not used outside ouf create_cursor_fb(). A stack allocated
array is enough.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Ville Syrjälä
fee27cf822 tests: Drop glib.h include from kms_cursor_crc and kms_fbc_crc
kms_cursor_crc and kms_fbc_crc don't need glib.h. This was just some
copy-paste error on my part.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-01-13 17:11:18 +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
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
Ville Syrjälä
3d371a7284 kms_cursor_crc: Fix crc readout after a subtest failure
If a subtest fails, it'll leave the pipe CRC file open, which will
prevent subsequent subtests from opening the file. Make sure the file
is cloesed before trying to open it again.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-27 16:20:09 +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