25 Commits

Author SHA1 Message Date
Daniel Vetter
8b556f7c8f tests/*: lib/igt.cocci found something!
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-23 17:54:44 +02:00
Rodrigo Vivi
9c8ee51be2 Revert "tests/kms_psr_sink_crc: Wait 2 vblanks before grabing the new crc."
This reverts
     commit d190a1f9668680c7a429110c91f8faa27949b220.
     Author: Rodrigo Vivi <rodrigo.vivi@intel.com>
     Date:   Wed Sep 3 21:26:29 2014 -0400

     	     tests/kms_psr_sink_crc: Wait 2 vblanks before grabing the new crc.

Sink CRC is fixed on kernel to wait as many vblanks as needed. It was fixed by:
     commit ad9dc91b6e21266bfc6f466db4b95e10211f31ee
     Author: Rodrigo Vivi <rodrigo.vivi@gmail.com>
     Date:   Tue Sep 16 19:18:12 2014 -0400

         drm/i915: Fix Sink CRC

This this fix in place we don't need this extra 2 vblanks on test case itself.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-10-10 08:14:32 -07: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
Daniel Vetter
3205a9167f tests/kms_psr_sink_crc: Use options
Env variables are a bit more annoying since much harder to discover.
With options you can just see what they do with --help.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-24 14:36:57 +02:00
Rodrigo Vivi
d190a1f966 tests/kms_psr_sink_crc: Wait 2 vblanks before grabing the new crc.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
1447d83e8e tests/kms_psr_sink_crc: Fix blt submission
Putting back a missing dword.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
25aa69d0a0 tests/kms_psr_sink_crc: Check color ref CRC
Black screen is forbidden on this test. So let's fail if sink crc shows
it is back.

Also there are many cases where we know for shure it should be all green,
so let's check for them.

Instead of checking colors we could print with sw using cairo and check if we
have identical crc like cursor testcases. However with PSR the chance of artifacts
is low and chance of getting blank screen or unchanged screen is high. So even drawing
on sw and comparing both CRCs we can have the same result. However the risk is that
screen never changed. So the safest way is to compare if screen changed and check
the green color when we know it should be green or not green.

v2: Hardcoded green was simply wrong because green CRC can change depending
    on display.Split R, G and B on CRC and bitewise them with mask to verify
    it is green.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
d4e6a51970 tests/kms_psr_sink_crc: Fix all testcases.
In order to get all test cases fixed and the matrix planes-operations working
it was needed to use the common new igt kms functions for all cases.
Previously only sprite testcase was using it.

Fixed the fb colors in a way to make tests more clear and be impossible to see
black screen during the tests.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
99efdc0cdb tests/kms_psr_sink_crc: Start splitting tests in test_planes and operations.
This will allow us to test input/write oprations on any kind of plane.

At this point PLANE_ONOF is just the new name of TEST_SPRITE and
PLANE_MOVE is the one for TEST_CURSOR_MOVE. They will be extended and fixed
on the following patche(s).

v2: fix conflict after changing previous patch

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
52b0e78a94 tests/kms_psr_sink_crc: Cleaning up tests a bit
This is needed to be able to split tests in a matrix that tests different
input/write methods and operations for different type of planes.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
fb004a6b02 tests/kms_psr_sink_crc: Removing context tests.
This tests are unecessary. Mainly now with the software tracking for PSR.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
1ab044518a tests/kms_psr_sink_crc: Adding test debug options
Just to make life easier and be eable to easily test with
PSR disabled to know exactly what to expect when running it
for real

v3: Use igt_debug helpers and add env option for running with psr disabled
on this test without have to recompile like v1 or changing igt infrastructure like v2.
I tried to add --disable-psr or local --dry-run but than it fails to print subtests
so this was the safest way.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Rodrigo Vivi
e90847f57a tests/kms_psr_sink_crc: Fix edp_psr debugfs interface
Tests were broken on platforms that doesn't have psr or on new kernel that contains new interface.
A lot more need to be done to get these tests really useful, but for now lets avoid it breaking
tests framework.

v2: Doesn't duplicate kernel's HAS_PSR. skip based on debugfs output.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:12 -04:00
Chris Wilson
10552b5ca6 batch: Specify number of relocations to accommodate
Since relocations are variable size, depending upon generation, it is
easier to handle the resizing of the batch request inside the
BEGIN_BATCH macro. This still leaves us with having to resize commands
in a few places - which still need adaption for gen8+.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-30 11:44:51 +01:00
Damien Lespiau
3149b8e903 kms_psr_sink_crc: 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
1cad834261 lib/igt_kms: Simplify return value of kmstest_get_connector_config
A plain bool is enough.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02: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
d078035ca4 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>
2014-07-07 08:57:00 +02:00
Daniel Vetter
c9c554594e tests: run igt.cocci
Re-run with correct igt_fail rules. Again manually fixup missing
includes for igt_core.h.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:27:59 +02:00
Daniel Vetter
652e544150 tests/pm_psr_sink_crc: Fix longjmp fun
igt_fixture and igt_subtests use longjmp/setjmp internally, which
means local variables at the same stack frame are at risk. Best
practice is to move them out right in front of the igt_main block.

It would be awesome if someone could come up with a cocci patch to
auto-fix this, but unfortunately my attempts failed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:09:05 +02:00
Daniel Vetter
ac0e606677 Revert "tests: Run igt.cocci over tests"
This reverts commit 6903ab04e5f9048e3932eb3225e94b6a228681ba.

The igt_assert conversion rule is broken and doesn't invert the check
as it should.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:09:05 +02:00
Daniel Vetter
6903ab04e5 tests: Run igt.cocci over tests
Cocci is awesome

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 11:17:23 +02:00
Daniel Vetter
ea0116cdcd tests/kms_psr_sink_crc: Skip properly
Aside: The test has way too many bool return values that are then
always checked with igt_assert. Imo cleaner to switch to a more
declarative approach and shovel the igt_assert/require into those
functions instead.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79962
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 10:18:24 +02:00
Rodrigo Vivi
27d37a1f10 tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.
v2: Wait psr enable with timeout and more subtest added.
v3: Add wait for v_blank leeting test more reliable and preparing to
    add Baytrail per-pipe tests.
v4: Call busy_ioctl on mmap_gtt to match the real usage and remove the need
    of inactivate on set_domain, what was semantically wrong.
v5: Adding more test cases to cover mmap_gtt with and without followed by
    busy ioctl and also without busy and waiting 10 seconds between
    set_domain and actual write.
v6: rebase after kms_plane added and debugfs api changed.
    Plus adding more test cases.
v7: Some rework and sprite test added

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2014-06-11 03:21:43 -07:00