platform/upstream/intel-gpu-tools.git
10 years agocore: increase the exit handler limit
Thomas Wood [Thu, 17 Jul 2014 10:19:04 +0000 (11:19 +0100)]
core: increase the exit handler limit

Increase the maximum number of exit handlers since some tests now
require more that the previous limit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81320
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib/igt.cocci: Add s/assert/igt_assert/
Daniel Vetter [Tue, 15 Jul 2014 08:21:37 +0000 (10:21 +0200)]
lib/igt.cocci: Add s/assert/igt_assert/

People use it way too often, and it upsets the test library. The only
valid places to use this is of igt infrastructure self-tests where you
need to check something _without_ all the other abi use checks
igt_fail and friends do. For those tests just #define an internal
assert to hide it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_userptr_blits: Polish
Daniel Vetter [Tue, 15 Jul 2014 08:12:55 +0000 (10:12 +0200)]
tests/gem_userptr_blits: Polish

- Drop return values for test functions - we rely on the implicit
  control flow from igt_ checks.
- Don't use assert directly, this upsets the test flow logic (and
  results in a CRASH result instead of FAIL).

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_userptr_blits: Race between object creation and multi-threaded mm ops
Tvrtko Ursulin [Mon, 14 Jul 2014 13:19:17 +0000 (14:19 +0100)]
tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

Userptr v23 was not thread safe against memory map operations and object
creation from separate threads. MMU notifier callback would get triggered
on a partially constructed object causing a NULL pointer dereference.

This test excercises that path a bit. In my testing it would trigger it
every time and easily, but unfortunately a test pass here does not guarantee
the absence of the race.

v2: Added explicit cancellation point and removed the stop flag.
    Use only igt_assert().

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_core: Fixup gtkdoc for logging functions
Daniel Vetter [Mon, 14 Jul 2014 21:02:18 +0000 (23:02 +0200)]
lib/igt_core: Fixup gtkdoc for logging functions

Without the () gtkdoc won't recognize them as function references.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests: Move gem_render_copy_redux to the list of multi-subtests tests
Damien Lespiau [Mon, 14 Jul 2014 17:01:05 +0000 (18:01 +0100)]
tests: Move gem_render_copy_redux to the list of multi-subtests tests

Can we find a way to fix those for good? My preference goes to not
having that single/multi split but always have a test being a list of
one or more subtests.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Add argc/argv to igt_simple_init
Daniel Vetter [Mon, 14 Jul 2014 12:42:23 +0000 (14:42 +0200)]
lib: Add argc/argv to igt_simple_init

There's a pile of ideas around to add generally useful options like
--debug to all igt tests. Or unify the runtime behaviour between
simple and subtest tests a bit more.

The first step to get there is to add argc/argv to igt_simple_init so
that we can get at the argument list.

Cc: Tim Gore <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agointel-gpu-tools: Dont build kms_force_connector if no cairo
Tim Gore [Fri, 11 Jul 2014 14:31:39 +0000 (15:31 +0100)]
intel-gpu-tools: Dont build kms_force_connector if no cairo

kms_force_connector 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>
10 years agoigt/gem_userptr_blits: Add missing RAM check before coherency tests
Chris Wilson [Mon, 14 Jul 2014 09:30:36 +0000 (10:30 +0100)]
igt/gem_userptr_blits: Add missing RAM check before coherency tests

-ENOCOFFE.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_userptr_blits: Add missing RAM check before coherency tests
Chris Wilson [Mon, 14 Jul 2014 09:30:36 +0000 (10:30 +0100)]
igt/gem_userptr_blits: Add missing RAM check before coherency tests

References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_close_race: Increase GPU load
Chris Wilson [Sat, 12 Jul 2014 08:06:39 +0000 (09:06 +0100)]
igt/gem_close_race: Increase GPU load

Increate the GPU load slightly, but mitigate the CPU overhead from
clflushing by keeping the object alive using flink. This has also the
side-effect of magnifying the desired busy-close race.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71029
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agooverlay: Baytrail needs a custom GPU frequency parser
Chris Wilson [Thu, 3 Jul 2014 10:18:02 +0000 (11:18 +0100)]
overlay: Baytrail needs a custom GPU frequency parser

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_close_race: Trim object size
Chris Wilson [Fri, 11 Jul 2014 22:36:15 +0000 (23:36 +0100)]
igt/gem_close_race: Trim object size

The challenge here is to race GPU activity versus the gem_close. Using a
large objects makes the window of GPU activity larger - except on !llc
systems we then incur massive overhead from clflush, likely destroying
any race (due to mutex contention). And that mutex contention is
amplified by the number of cores - bad news for Baytrail.

Give up and make the objects smaller and hope that the test is run
frequently enough to catch the race.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71029
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_tiled_swapping: Speed up slightly
Chris Wilson [Fri, 11 Jul 2014 19:38:38 +0000 (20:38 +0100)]
igt/gem_tiled_swapping: Speed up slightly

The exercise is moving tiled objects in and out of swap. They are moved
en-block and we test them all, therefore we can randomly test different
bytes from each buffer to have reasonable coverage of all tiles. This
shifts the bulk of the work from checking the tiled bo to kswapd.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoconfigure: Only build overlay if dri2proto is present
Chris Wilson [Fri, 11 Jul 2014 19:38:30 +0000 (20:38 +0100)]
configure: Only build overlay if dri2proto is present

Instead of making dri2proto mandatory, disable intel-gpu-overlay if it
is not installed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agolib/igt.cocci: Add stanza for for_each_pipe
Daniel Vetter [Fri, 11 Jul 2014 15:41:27 +0000 (17:41 +0200)]
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>
10 years agolib: Extract gem_get_tiling() from a couple of tests.
Damien Lespiau [Thu, 19 Jun 2014 23:14:52 +0000 (00:14 +0100)]
lib: Extract gem_get_tiling() from a couple of tests.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Use the igt_kms enum to encode the plane rotation
Damien Lespiau [Thu, 10 Jul 2014 17:39:17 +0000 (18:39 +0100)]
kms_rotation_crc: Use the igt_kms enum to encode the plane rotation

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Remove unnecessary includes
Damien Lespiau [Thu, 10 Jul 2014 17:37:36 +0000 (18:37 +0100)]
kms_rotation_crc: Remove unnecessary includes

Turns out we didn't need most of them.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Always use the primary plane to compute the reference CRC
Damien Lespiau [Wed, 9 Jul 2014 13:00:59 +0000 (14:00 +0100)]
kms_rotation_crc: Always use the primary plane to compute the reference CRC

Trying to disable the primary planes isn't exactly working at the
moment. W/A it until it works.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Document the two steps in prepare_crtc()
Damien Lespiau [Thu, 10 Jul 2014 16:44:28 +0000 (17:44 +0100)]
kms_rotation_crc: Document the two steps in prepare_crtc()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Don't compile the test on Android with no cairo support
Damien Lespiau [Wed, 9 Jul 2014 20:24:26 +0000 (21:24 +0100)]
kms_rotation_crc: Don't compile the test on Android with no cairo support

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Add the test to .gitignore
Damien Lespiau [Wed, 9 Jul 2014 20:23:27 +0000 (21:23 +0100)]
kms_rotation_crc: Add the test to .gitignore

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Properly paint the whole frame buffer
Damien Lespiau [Wed, 9 Jul 2014 11:03:50 +0000 (12:03 +0100)]
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>
10 years agokms_rotation_crc: Don't commit with no fb set up
Damien Lespiau [Tue, 8 Jul 2014 18:27:39 +0000 (19:27 +0100)]
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>
10 years agokms_rotation_crc: Allow the sprite test to run even without universal planes
Damien Lespiau [Tue, 8 Jul 2014 18:24:24 +0000 (19:24 +0100)]
kms_rotation_crc: Allow the sprite test to run even without universal planes

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: No need to test for NULL before freeing the pipe CRC object
Damien Lespiau [Tue, 8 Jul 2014 17:56:15 +0000 (18:56 +0100)]
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>
10 years agokms_rotation_crc: Remove plane from the state
Damien Lespiau [Tue, 8 Jul 2014 17:51:25 +0000 (18:51 +0100)]
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>
10 years agokms_rotation_crc: Remove the sleep(2)
Damien Lespiau [Tue, 8 Jul 2014 17:48:35 +0000 (18:48 +0100)]
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>
10 years agokms_rotation_crc: Remove 'output' from the state
Damien Lespiau [Tue, 8 Jul 2014 17:46:57 +0000 (18:46 +0100)]
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>
10 years agokms_rotation_crc: Remove the test on output->valid
Damien Lespiau [Tue, 8 Jul 2014 17:45:16 +0000 (18:45 +0100)]
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>
10 years agokms_rotation_crc: Use for_each_pipe()
Damien Lespiau [Tue, 8 Jul 2014 17:43:44 +0000 (18:43 +0100)]
kms_rotation_crc: Use for_each_pipe()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Remove now unnecessary defines
Damien Lespiau [Tue, 8 Jul 2014 17:38:05 +0000 (18:38 +0100)]
kms_rotation_crc: Remove now unnecessary defines

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Use igt_plane_set_rotation()
Damien Lespiau [Tue, 8 Jul 2014 17:36:32 +0000 (18:36 +0100)]
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>
10 years agokms_rotation_crc: Don't store 'pipe' in the state
Damien Lespiau [Tue, 8 Jul 2014 17:28:53 +0000 (18:28 +0100)]
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>
10 years agokms_rotation_crc: Don't store rotate in the test state
Damien Lespiau [Tue, 8 Jul 2014 17:27:10 +0000 (18:27 +0100)]
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>
10 years agokms_rotation_crc: Always disable the plane in cleanup
Damien Lespiau [Tue, 8 Jul 2014 17:20:51 +0000 (18:20 +0100)]
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>
10 years agokms_rotation_crc: Unify the two tests
Damien Lespiau [Tue, 8 Jul 2014 17:13:47 +0000 (18:13 +0100)]
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>
10 years agokms_rotation_crc: Just store the igt_plane_t in data
Damien Lespiau [Tue, 8 Jul 2014 17:06:44 +0000 (18:06 +0100)]
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>
10 years agokms_rotation_crc: Skip the tests if rotation is not supported
Damien Lespiau [Tue, 8 Jul 2014 17:01:59 +0000 (18:01 +0100)]
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>
10 years agokms_rotation_crc: Style issue: binary operators need spaces before and after
Damien Lespiau [Tue, 8 Jul 2014 16:51:07 +0000 (17:51 +0100)]
kms_rotation_crc: Style issue: binary operators need spaces before and after

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Use drm_plane from igt_plane_t
Damien Lespiau [Tue, 8 Jul 2014 16:49:03 +0000 (17:49 +0100)]
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>
10 years agokms_rotation_crc: Remove useless comments
Damien Lespiau [Tue, 8 Jul 2014 12:59:42 +0000 (13:59 +0100)]
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>
10 years agokms_rotation_crc: Factor out common primary/sprite code in prepare_crtc()
Damien Lespiau [Tue, 8 Jul 2014 11:59:03 +0000 (12:59 +0100)]
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>
10 years agokms_rotation_crc: Factor out the square drawing function
Damien Lespiau [Tue, 8 Jul 2014 11:49:03 +0000 (12:49 +0100)]
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>
10 years agokms_rotation_crc: Fix style issue: single statement conditionals
Damien Lespiau [Tue, 8 Jul 2014 11:28:41 +0000 (12:28 +0100)]
kms_rotation_crc: Fix style issue: single statement conditionals

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Fix style issue: '{' at the end of lines
Damien Lespiau [Tue, 8 Jul 2014 11:26:38 +0000 (12:26 +0100)]
kms_rotation_crc: Fix style issue: '{' at the end of lines

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Require universal planes for the testing primary rotation
Damien Lespiau [Tue, 8 Jul 2014 11:18:47 +0000 (12:18 +0100)]
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>
10 years agokms_rotation_crc: Test the validity of the output first
Damien Lespiau [Tue, 8 Jul 2014 11:10:44 +0000 (12:10 +0100)]
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>
10 years agokms_rotation_crc: Update the copyright to have this year as well
Damien Lespiau [Tue, 8 Jul 2014 11:08:20 +0000 (12:08 +0100)]
kms_rotation_crc: Update the copyright to have this year as well

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Align a few wrapped lines to the opening brace
Damien Lespiau [Tue, 8 Jul 2014 11:02:42 +0000 (12:02 +0100)]
kms_rotation_crc: Align a few wrapped lines to the opening brace

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Make more functions static
Damien Lespiau [Tue, 8 Jul 2014 10:58:43 +0000 (11:58 +0100)]
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>
10 years agokms_rotation_crc: Make check_plane_type() static
Damien Lespiau [Tue, 8 Jul 2014 10:55:20 +0000 (11:55 +0100)]
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>
10 years agotests/kms_rotation_crc: IGT for 180 degree HW rotation
Sonika Jindal [Wed, 18 Jun 2014 08:57:27 +0000 (14:27 +0530)]
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>
10 years agoigt_kms: Introduce a for_each_pipe() macro
Damien Lespiau [Tue, 8 Jul 2014 17:43:22 +0000 (18:43 +0100)]
igt_kms: Introduce a for_each_pipe() macro

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoigt_kms: Add support for setting plane rotation
Damien Lespiau [Tue, 8 Jul 2014 15:02:05 +0000 (16:02 +0100)]
igt_kms: Add support for setting plane rotation

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoigt_kms: Add a way to query of the plane supports rotation
Damien Lespiau [Tue, 8 Jul 2014 14:23:05 +0000 (15:23 +0100)]
igt_kms: Add a way to query of the plane supports rotation

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoigt_kms: Provide a get_plane_property() shorthand
Damien Lespiau [Tue, 8 Jul 2014 13:56:54 +0000 (14:56 +0100)]
igt_kms: Provide a get_plane_property() shorthand

So one doesn't have to write the plane type all the time.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoigt_kms: Factor out a generic get_property() out of get_drm_plane_type()
Damien Lespiau [Tue, 8 Jul 2014 13:34:16 +0000 (14:34 +0100)]
igt_kms: Factor out a generic get_property() out of get_drm_plane_type()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/igt_core: Don't log when listing subtests
Daniel Vetter [Fri, 11 Jul 2014 08:24:30 +0000 (10:24 +0200)]
lib/igt_core: Don't log when listing subtests

I've noticed some spam in the userptr list ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoREADME: update the test run instructions
Thomas Wood [Fri, 11 Jul 2014 09:47:43 +0000 (10:47 +0100)]
README: update the test run instructions

Describe using the new run-tests.sh script and also update the Piglit
instructions now that using a symlink is no longer supported.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agoscripts: add a script to help run tests with Piglit
Thomas Wood [Tue, 1 Jul 2014 10:35:16 +0000 (11:35 +0100)]
scripts: add a script to help run tests with Piglit

Add a script to facilitate running the tests with Piglit by providing
simplified options for listing, filtering and creating summaries of test
runs.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: allow the edid to be reset
Thomas Wood [Wed, 9 Jul 2014 09:38:05 +0000 (10:38 +0100)]
lib: allow the edid to be reset

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotests: enable extra connectors in kms_flip and kms_pipe_crc_basic
Thomas Wood [Wed, 18 Jun 2014 13:28:43 +0000 (14:28 +0100)]
tests: enable extra connectors in kms_flip and kms_pipe_crc_basic

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: add igt_enable_connectors and igt_reset_connectors
Thomas Wood [Wed, 28 May 2014 13:06:01 +0000 (14:06 +0100)]
lib: add igt_enable_connectors and igt_reset_connectors

igt_enable_connectors forces connectors to be enabled where doing so is
known to work well. igt_reset_connectors resets the force state on all
connectors.

10 years agolib: add the ability to set an EDID data block on a connector
Thomas Wood [Tue, 27 May 2014 13:47:25 +0000 (14:47 +0100)]
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>
10 years agolib: add function to change connector states
Thomas Wood [Fri, 16 May 2014 16:22:46 +0000 (17:22 +0100)]
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>
10 years agoigt/gem_userptr_blits: Verify that userptr bo work on unshared memory
Chris Wilson [Fri, 11 Jul 2014 09:38:32 +0000 (10:38 +0100)]
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>
10 years agoigt/gem_userptr_blits: Shared memory allocations
Chris Wilson [Fri, 11 Jul 2014 09:16:54 +0000 (10:16 +0100)]
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>
10 years agoWait for any pid in order to reap failure quicker
Chris Wilson [Fri, 11 Jul 2014 09:15:19 +0000 (10:15 +0100)]
Wait for any pid in order to reap failure quicker

When waiting for the forked tests, we can respond quicker to a failure
(such as oom) by waiting for any child to exit rather than waiting for
each child in order. Then when we see that a test failed, we can kill
all other children before aborting.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoNEWS: Updates
Daniel Vetter [Thu, 10 Jul 2014 18:19:18 +0000 (20:19 +0200)]
NEWS: Updates

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests: Run igt.cocci
Daniel Vetter [Thu, 10 Jul 2014 18:04:19 +0000 (20:04 +0200)]
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>
10 years agodrv_module_reload: Unbind the right console driver
Daniel Vetter [Thu, 10 Jul 2014 17:46:46 +0000 (19:46 +0200)]
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>
10 years agodrv_module_reload: Don't declare success when failing
Damien Lespiau [Thu, 10 Jul 2014 13:03:37 +0000 (14:03 +0100)]
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>
10 years agocore: Apply the same treatment to the in errno message in __igt_fail_assert()
Damien Lespiau [Wed, 9 Jul 2014 10:40:16 +0000 (11:40 +0100)]
core: Apply the same treatment to the in errno message in __igt_fail_assert()

Just like the it was done for the requirement message, display the errno
message only if errno is set, and display it at the end of the assert
message.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agocore: Only display the errno message if errno is set
Damien Lespiau [Wed, 9 Jul 2014 10:36:27 +0000 (11:36 +0100)]
core: Only display the errno message if errno is set

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agocore: Put the requirement failure messages together
Damien Lespiau [Wed, 9 Jul 2014 10:32:22 +0000 (11:32 +0100)]
core: Put the requirement failure messages together

The errno message was a bit in the middle here, it makes more sense to
group the messages about why the test requirement wasn't met together.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/gen6_render: removed duplicate defines
Mika Kuoppala [Wed, 18 Jun 2014 11:34:04 +0000 (14:34 +0300)]
lib/gen6_render: removed duplicate defines

Textually the same so no harm was done and no warnings
from compiler either.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agotests/gem_render_copy_redux needs legacy drm nodes
Daniel Vetter [Wed, 9 Jul 2014 18:45:54 +0000 (20:45 +0200)]
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>
10 years agointel-gpu-tools: Dont build kms_univeral_plane if no cairo
Tim Gore [Tue, 8 Jul 2014 09:04:28 +0000 (10:04 +0100)]
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>
10 years agokms_plane: Specify the pipe when grabbing reference CRCs
Damien Lespiau [Wed, 9 Jul 2014 10:05:06 +0000 (11:05 +0100)]
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>
10 years agokms_plane: Add a debug message when grabbing the CRC of a colored fb
Damien Lespiau [Mon, 7 Jul 2014 13:41:15 +0000 (14:41 +0100)]
kms_plane: Add a debug message when grabbing the CRC of a colored fb

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_plane: Add panning test for primary plane
Yi Sun [Fri, 23 May 2014 00:28:47 +0000 (08:28 +0800)]
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>
10 years agokms_plane: Make the gathering of reference CRCs test agnostic
Damien Lespiau [Mon, 7 Jul 2014 12:30:41 +0000 (13:30 +0100)]
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>
10 years agopipe_crc: Make collect_crc() ensure the CRC looks somewhat valid
Damien Lespiau [Mon, 7 Jul 2014 14:17:56 +0000 (15:17 +0100)]
pipe_crc: Make collect_crc() ensure the CRC looks somewhat valid

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agopipe_crc: Warn if the CRC values is 0xffffffff
Damien Lespiau [Mon, 7 Jul 2014 14:16:51 +0000 (15:16 +0100)]
pipe_crc: Warn if the CRC values is 0xffffffff

This is what we read when the CRC logic in in a powered down well. We
really don't want that to happen.

In theory, it's possible 0xffffffff to be a valid CRC value, so I don't
assert here.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Reset 'position_changed' after a drmModeSetCrtc()
Damien Lespiau [Mon, 7 Jul 2014 14:08:33 +0000 (15:08 +0100)]
lib: Reset 'position_changed' after a drmModeSetCrtc()

So the next commit won't trigger a drmModeSetCrtc() if the primary plane
doesn't have any update needing it.

This shouldn't be a problem at the moment as we don't allow the primary
plane to be of a different size than the CRTC viewport, but it will most
likely change in the future and we don't want to have that bug there.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Add a bit a debugging output
Damien Lespiau [Wed, 28 May 2014 17:59:09 +0000 (18:59 +0100)]
kms_pipe_crc_basic: Add a bit a debugging output

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Make the number of CRCs a parameter
Damien Lespiau [Wed, 28 May 2014 16:55:06 +0000 (17:55 +0100)]
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>
10 years agokms_pipe_crc_basic: Cycle between 2 differently colored buffer
Damien Lespiau [Wed, 28 May 2014 16:40:05 +0000 (17:40 +0100)]
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>
10 years agokms_pipe_crc_basic: Split the main test function a bit more
Damien Lespiau [Wed, 28 May 2014 16:33:32 +0000 (17:33 +0100)]
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>
10 years agolib/kms: Provide universal plane #define's
Matt Roper [Mon, 7 Jul 2014 16:08:29 +0000 (09:08 -0700)]
lib/kms: Provide universal plane #define's

There hasn't been a libdrm release containing the universal plane
definitions yet, so add them to igt_kms to allow compilation to succeed
in the meantime.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_exec_parse: use gem_uses_aliasing_ppgtt
Daniel Vetter [Mon, 7 Jul 2014 15:54:30 +0000 (17:54 +0200)]
tests/gem_exec_parse: use gem_uses_aliasing_ppgtt

Suggested by Brad Volking.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/kms_psr_sink_crc: Fix delayed gtt/cpu write tests
Daniel Vetter [Tue, 17 Jun 2014 21:47:49 +0000 (23:47 +0200)]
tests/kms_psr_sink_crc: Fix delayed gtt/cpu write tests

- Drop the flip from the name - we don't do that. And the blt is
  really just to have a bit of fun with the domain tracking.

- The real test is 1) dirty with gpu 2) grab 1st crc 3) set_domain for
  cpu access 4) wait a long time 5) dirty more with cpu 6) grab 2nd
  crc.

This fixes failures since with the old tests we wouldn't have noticed
the cpu rendering really.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agokms_universal_plane: Don't assert outside of fixtures/subtests
Damien Lespiau [Thu, 3 Jul 2014 14:50:53 +0000 (15:50 +0100)]
kms_universal_plane: Don't assert outside of fixtures/subtests

Doing otherwise breaks listing the subtests. The test was throwing an
error out when universal planes were disabled as well because of that.

Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotests/kms_cursor_crc: Call drmModeMoveCursor() directly
Matt Roper [Mon, 30 Jun 2014 23:44:30 +0000 (16:44 -0700)]
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>
10 years agotests/kms_cursor_crc: Combine data_t and test_data_t
Matt Roper [Mon, 30 Jun 2014 23:44:29 +0000 (16:44 -0700)]
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>
10 years agotests/kms_universal_plane: Universal plane testing (v6)
Matt Roper [Mon, 30 Jun 2014 23:44:28 +0000 (16:44 -0700)]
tests/kms_universal_plane: Universal plane testing (v6)

Add a simple test to exercise universal plane support.

v6:
 - Update to new universal plane interface (commit parameter rather than
   state-changing function).  It should now be a lot more explicit which
   steps are being taken with legacy API's vs universal API's now.
v5:
 - Check that we don't have more than one primary or cursor.  This will
   catch accidental calls to drm_plane_init() in the kernel where
   drm_universal_plane_init() was intended (these don't cause a compile
   warning due to type compatibility between enum and bool).
v4:
 - Test disabling the primary plane explicitly when it has previously
   been implicitly disabled due to clipping.
 - Skip test if igt_pipe_crc_new() fails
v3:
 - For testing while crtc is off, switch between several different
   primary plane fb's before reenabling the crtc.  This will help
   catch pin/unpin mistakes.
v2:
 - Test that pageflips error out gracefully when the primary plane
   is disabled before the ioctl, or between ioctl and pageflip
   execution.
 - Test that nothing blows up if we try to disable the primary plane
   immediately after a pageflip (presumably before the pageflip actually
   completes).
 - Test that we can setup primary + sprite planes with the CRTC off and
   then have them show up properly when we enable the CRTC
   (drmModeSetCrtc with fb = -1).
 - Test that we can modeset properly after having disabled the primary
   plane
 - Test that proper error codes are returned for invalid plane
   programming attempts.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/kms: Drop primary plane windowing test from igt_plane_set_position()
Matt Roper [Mon, 30 Jun 2014 23:44:27 +0000 (16:44 -0700)]
lib/kms: Drop primary plane windowing test from igt_plane_set_position()

None of our hardware can support this today, but we'd like to be able to
write tests that check that the kernel returns the proper error code
when userspace tries it anyway.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/kms: Add universal plane support (v2)
Matt Roper [Mon, 30 Jun 2014 23:44:26 +0000 (16:44 -0700)]
lib/kms: Add universal plane support (v2)

Add support for universal planes.  This involves revamping the existing
plane handling a bit to allow primary & cursor planes to come from the
DRM plane list, rather than always being manually added.

v2: Don't drop fixed ordering of internal plane list.  Primary will
    always be index 0, cursor will always be last in internal plane
    list.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>