1626 Commits

Author SHA1 Message Date
Damien Lespiau
282f5605b0 kms_rotation_crc: Document the two steps in prepare_crtc()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
05f3897dc1 kms_rotation_crc: Don't compile the test on Android with no cairo support
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
f7a37f02f7 kms_rotation_crc: Add the test to .gitignore
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
8767a794bb kms_rotation_crc: Properly paint the whole frame buffer
The -1 meant we weren't properly filling the whole fb.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
1bcac4dcb3 kms_rotation_crc: Don't commit with no fb set up
prepare_crtc() was trying to commit a display state without any fb to
scan out...

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
c4564e0a51 kms_rotation_crc: Allow the sprite test to run even without universal planes
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
2eaa50f02e kms_rotation_crc: No need to test for NULL before freeing the pipe CRC object
igt_pipe_crc_free() does that check already.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
05f90b0308 kms_rotation_crc: Remove plane from the state
having everythin in the data_t structure makes it hard to understand
what should be set when. Replace that by explicit function parameters.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
fe8373d437 kms_rotation_crc: Remove the sleep(2)
One can inspect the output of the igt_kms API by setting
IGT_DISPLAY_WAIT_AT_COMMIT=1.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
ffc954e739 kms_rotation_crc: Remove 'output' from the state
This restore the balance between prepare_crtc() and cleanup_crtc(), both
now taking the output as a parameter.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
b146e8128d kms_rotation_crc: Remove the test on output->valid
This test is already done by the for_each_connected_output() macro.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
aef475b6f9 kms_rotation_crc: Use for_each_pipe()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
8843bef280 kms_rotation_crc: Remove now unnecessary defines
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
39abe7790f kms_rotation_crc: Use igt_plane_set_rotation()
More code we can remove from the test.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
8facccfae4 kms_rotation_crc: Don't store 'pipe' in the state
This variable is only needed for prepare_crtc(), need need to put it in
the test state.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
f7250d041d kms_rotation_crc: Don't store rotate in the test state
We don't use it anywhere else than the test function.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
eb81a922c7 kms_rotation_crc: Always disable the plane in cleanup
There's no need for this check, always use set_fb(NULL) on the plane.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
13e979c764 kms_rotation_crc: Unify the two tests
The only difference is which plane we are talking about. So we really
need one function here with a paramater.

Well, almost. For the primary plane we need to ensure we support
unviversal planes.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
063d22ecea kms_rotation_crc: Just store the igt_plane_t in data
Now that we're always using an igt_plane_t, we can get rid of ->type to
use ->directly without those switch() or if()/else

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
0b3a30ee5a kms_rotation_crc: Skip the tests if rotation is not supported
This happens when the kernel lacks the rotation patches.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
5edab97f7f kms_rotation_crc: Style issue: binary operators need spaces before and after
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
7ae5d9b347 kms_rotation_crc: Use drm_plane from igt_plane_t
So we don't need all that extra code to grab the drm_plane structure for
the primary_plane.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
7e7c625441 kms_rotation_crc: Remove useless comments
A typical example of what comments shouldn't be:

 case DRM_PLANE_TYPE_PRIMARY: /* primary */

Well, yes!, it's written just there, PRIMARY!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
19743a1435 kms_rotation_crc: Factor out common primary/sprite code in prepare_crtc()
This results in less code, always a good thing. Also, we only really
need one reference CRC.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
92b29b18ca kms_rotation_crc: Factor out the square drawing function
Making function to the similar things is very common in programming.
Let's do it once again.

Cairo being a drawing library, it can be used to do the rotation!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
78fac76523 kms_rotation_crc: Fix style issue: single statement conditionals
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
de9c1687f9 kms_rotation_crc: Fix style issue: '{' at the end of lines
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
1025a114c6 kms_rotation_crc: Require universal planes for the testing primary rotation
Otherwise the test will fail instead of just skipping.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
143984a4f1 kms_rotation_crc: Test the validity of the output first
So we don't need code to unwind what we just did.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
9cf7e8d35f kms_rotation_crc: Update the copyright to have this year as well
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
bbd5e2ec6c kms_rotation_crc: Align a few wrapped lines to the opening brace
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:21 +01:00
Damien Lespiau
f00f767cea kms_rotation_crc: Make more functions static
More of the same. This time no need to move code around, just adding
static.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:21 +01:00
Damien Lespiau
0506f10623 kms_rotation_crc: Make check_plane_type() static
Clearly, someone tried to solve the following warning:
  kms_rotation_crc.c:189:6: warning: no previous prototype for ‘check_plane_type’ [-Wmissing-prototypes]

Without really understanding what was the warning about. Make
check_plane_type() static and move it before its user to get rid of the forward
declaration.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:21 +01:00
Sonika Jindal
e3611394cc tests/kms_rotation_crc: IGT for 180 degree HW rotation
Testcase for 180 degree HW rotation

Cc: sagar.a.kamble@intel.com

Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
2014-07-11 15:12:21 +01:00
Thomas Wood
b81020526f lib: allow the edid to be reset
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11 11:47:46 +01: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
Thomas Wood
13cd79c128 lib: add the ability to set an EDID data block on a connector
Add a function to set an EDID data block on a connector and include a
set of generic EDID blocks for testing.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11 11:47:46 +01:00
Thomas Wood
37ffb22d3c lib: add function to change connector states
Add an API function and a test program to force a particular state on a
connector.

v2: mask the correct part of the minor number to get the card number (Chris
    Wilson)

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11 11:47:46 +01:00
Chris Wilson
9b6ae3cb6f igt/gem_userptr_blits: Verify that userptr bo work on unshared memory
If the parent passes a userptr to some private memory, we expect to
still be able to use the userptr in the child.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-11 10:41:29 +01:00
Chris Wilson
9344aa78e8 igt/gem_userptr_blits: Shared memory allocations
The forked tests allocate the bo (and thus for userptr, the memory) in
the parent and pass them to all children. The difference for userptr is
that we allocate system memory which the kernel then copies into each
child. As the children need to access the memory for their checks, it
does need to be shared - so allocate the userptr from shared memory!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80208
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-11 10:41:28 +01:00
Daniel Vetter
282482db70 tests: Run igt.cocci
New stuff caught.

Plus manually simplify the massive igt_fail_on_f(file == NULL, ...) to
a simple igt_assert(file). We already print the errno (if
applicapable) and the condition, which is equally informative.

Cc: Yi Sun <yi.sun@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-10 20:06:54 +02:00
Daniel Vetter
329f7a3734 drv_module_reload: Unbind the right console driver
We want to unbind fbcon, but only fbcon and only if it's there.

This was broken by the recent patch in 3.16-rc to kick out the vgacon
driver. I've forgotten to push out the relevant fix from the machine
used to create the kick vgacon patches.

v2: Dropped duplicated /, spotted by Damien.

Reported-by: Damien Lespiau <damien.lespiau@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-10 19:55:07 +02:00
Damien Lespiau
82e3d3379b drv_module_reload: Don't declare success when failing
We weren't returning straight away when failing to unload the driver, so
the test happilly executed gem_suspend and printed ""module successfully
loaded again".

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-10 18:05:41 +01:00
Daniel Vetter
6b986a2044 tests/gem_render_copy_redux needs legacy drm nodes
... since it uses flink. Fixes a regression due to:

commit 6d6dfcfb883818b40b58bac61cc72cab428a7a03
Author:     David Herrmann <dh.herrmann@gmail.com>
AuthorDate: Sun Mar 16 14:38:40 2014 +0100

    drm: enable render-nodes by default

Cc: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-09 20:45:54 +02:00
Tim Gore
f705ef158a intel-gpu-tools: Dont build kms_univeral_plane if no cairo
kms_univeral_plane is a new test that requires cairo.
I have added it to the list of tests not to build on
Android unless ANDROID_HAS_CAIRO is set.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-09 13:54:07 +02:00
Damien Lespiau
c5b9615b83 kms_plane: Specify the pipe when grabbing reference CRCs
When changing the pipe we were using, test_grab_crc() wasn't correctly
setting the pipe constraint before waiting for the CRC on the pipe, and
so we ended up waiting for a CRC on a pipe that wasn't lit up.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-09 11:10:01 +01:00
Damien Lespiau
8d60b8267e kms_plane: Add a debug message when grabbing the CRC of a colored fb
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07 18:27:14 +01:00
Yi Sun
b5333b416f kms_plane: Add panning test for primary plane
Get CRCs of a full red and a full blue surface as reference.

Create a big framebuffer that is twice width and twice height as the
current display mode.

Fill the top left quarter with red, bottom right quarter with blue
Check the scanned out image with the CRTC at position (0, 0) of the
framebuffer and it should be the same CRC as the full red fb
Check the scanned out image with the CRTC at position (hdisplay,
vdisplay) and it should be the same CRC as the full blue fb

v2: Fix a few things here and there (Damien)

Cc: Lei Liu <lei.a.liu@intel.com>
Cc: Yi Sun <yi.sun@intel.com>
Signed-off-by: Lei Liu <lei.a.liu@intel.com>
Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07 18:27:10 +01:00
Damien Lespiau
de538cfc7c kms_plane: Make the gathering of reference CRCs test agnostic
We're going to add tests for panning. Both position and panning tests
share the need to grab reference CRCs of single coloured fb, so let's
separate this function from the position test.

Cc: Lei Liu <lei.a.liu@intel.com>
Cc: Yi Sun <yi.sun@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07 17:59:52 +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