3031 Commits

Author SHA1 Message Date
Ville Syrjälä
b23329f086 toos/intel_iosf_sb: Add symbolic unit names
Add a bunc of symbolic sideband unit names so that you don't have to go
trawling through the sideband HAS every time you want to poke at
something with the tool. You can still specify the port manually though
if you know them by heart already.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-09-18 12:56:55 +03:00
Ville Syrjälä
b39eb28c25 tools: Allow iosf-sb utils to work on chv
Unlike the kernel IS_VALLEYVIEW() doesn't cover chv in igt. Add the
appropriate IS_CHERRYVIEW() checks to the various sideband poking tools.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-09-18 12:56:55 +03:00
Rodrigo Vivi
50534460dd tools/intel_reg_dumper: Shows fences and rp debug regs on BDW+.
v2: a more generic fix to cover current and future platforms (Damien).

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-17 14:23:10 -04:00
Chris Wilson
1244fc6b9b igt/pm_rps: Fix STORE_DWORD for pre-gen8
gen8 actually changed the command layout, not just extended the
relocation value. Oh well.

References: https://bugs.freedesktop.org/show_bug.cgi?id=83915
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-16 08:19:08 +01:00
Daniel Vetter
137877f16b NEWS: New heading for 1.9
Should be done post-release.

Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-12 15:29:34 +02:00
Chris Wilson
4779655c6f lib: Try harder to drop-caches
If at first we don't succeed, try again. (For as long as the errno says
to at least!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 11:12:21 +01:00
Chris Wilson
f81d8eba4f igt/kms_render: Iterate only through the formats
When testing each format, iterate through the formats and not randomly
through the modes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83788
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 09:12:42 +01:00
Chris Wilson
855dc6284d igt/gem_userptr_blits: GTT mmaping a userptr requires llc
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83790
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 09:10:01 +01:00
Chris Wilson
3a1751ef34 igt/pm_rps: Fix the batch count for emitting the flush
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81858#c2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 06:47:20 +01:00
Rodrigo Vivi
62f4d56676 tests: Kill pm_psr
kms_psr_sink_crc check psr activity, residency and exit for screen updates.
So this test is useless.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:42:13 -04: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
Rodrigo Vivi
d92fbc2313 tests/kms_sink_crc_basic: Wait 2 vblanks before grabing the new crc.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:41:52 -04:00
Rodrigo Vivi
1d7b062621 tests/kms_sink_crc_basic: Simplify test by using igt_kms functions
v2: sink CRC R, G and B might change depending on display. So let's split the
colors and bitwise them.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11 11:37:21 -04:00
Chris Wilson
107151ce9f igt/gem_ppgtt: Create secondary contexts and mm
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-09 16:28:36 +01:00
Chris Wilson
961578f471 test: Exercise full ppgtt switching between multiple fd
Load up both rings with lots of fighting between multiple contexts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-09 14:52:35 +01:00
Rodrigo Vivi
d9d3f4b0d2 bump version to 1.8 and add the release date
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-08 22:44:42 -04:00
Chris Wilson
cdf0ea825e igt/gem_cpu_reloc: Terminate the bad batch
gen2 will read the batch up until it reaches the end as defined by the
MI_BATCH_BUFFER_END command. Play nice and make sure that it does end on a
MI_BB_END.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-08 12:56:06 +01:00
Chris Wilson
be6bb4ce4a igt/kms_flip_tiling: Use the associated pipe for the output
This stops us from using an illegal pipe, such as pipe 0 for LVDS on
PNV.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82280
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-08 12:56:06 +01:00
Chris Wilson
b76f1d8b03 igt/gem_mmap_gtt: Check coherency between GTT and CPU mmappings with LLC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-08 10:29:16 +01:00
Chris Wilson
ac3d06094a igt/kms_universal_plane: Only test existing planes
Only attempt to test the number of planes that exist on the device so as
not to trigger spurious failures.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82233
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 18:15:52 +01:00
Chris Wilson
5eeb1f34d4 igt/drv_missed_irq_hang: Increase busy load
The test relies on having to wait upon the GPU at some point and so
simulating a missed interrupt. If there is insufficient load on the GPU,
we can complete the task before we even wait.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71334
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 17:26:21 +01:00
Chris Wilson
d35cc3ea8c aux: Squelch warning when emitting progress indicator
commit 1649ef0d1f5c0e4f995a437bd24f1574a8b5100f
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Aug 26 15:26:21 2014 +0200

    lib/igt_* Use igt macros in igt libaries

went a little too far here as the replacement macro was too clever.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 12:45:44 +01:00
Chris Wilson
fb9c9e3adc core: Prettify igt_require_f output
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 12:45:44 +01:00
Chris Wilson
9df77d5664 lib/igt_fb: Ignore RGB888
None of our display hardware supports the packed 24-bit format, so stop
trying to use it and causing test failures.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78873&list_id=465068
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 12:11:08 +01:00
Chris Wilson
db4cc747fa lib/igt_fb: Add debug output for creating fb
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 12:11:08 +01:00
Chris Wilson
91a432721c core: Display subtest walltime
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 12:11:08 +01:00
Thomas Wood
f675f6771b lib: keep a list of modified connectors to reset
Avoid calling functions in igt_reset_connectors that are not safe to use
in signal handlers by keeping a list of connectors that have been
modified, instead of enumerating all connectors.

v2: add space for a sentinel NULL value on forced_connectors and print a
    warning when the connector limit is reached (Chris Wilson)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83498
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Thomas Wood
48da0e69ad tests/kms_3d: skip if connectors cannot be forced
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Thomas Wood
d3c83b2033 lib: don't force HDMI or DP connectors on HSW and BDW
Forcing HDMI or DP connectors on these platforms doesn't currently work,
so fail early to allow the test to skip if required.

v2: restrict to HSW and BDW (Daniel Vetter)

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Thomas Wood
3aac97107e lib/igt_fb: ensure igt_create_fb parameters are consistent
Make sure the parameters in the prototype and implementation of
igt_create_fb match and are complete so that the documentation is
correct.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Thomas Wood
5303ce8076 tests: add kms_3d test
Add a test to verify creation and use of 3D stereo modes.

v2: update for API changes

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Thomas Wood
4cb1946697 lib: move create_stereo_fb from testdisplay to igt_fb
Move create_stereo_fb from testdisplay to igt_create_stereo_fb in igt_fb
so that it can be used in other tests.

v2: update for new igt_create_fb API
    add parameters for format and tiling
    remove some old debug code

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Thomas Wood
a124b1a430 lib: add kmstest_edid_add_3d
kmstest_edid_add_3d adds an EDID extension block with 3D support to a
copy of the specified EDID.

v2: Avoid using an invalid CEC SPA (Clint Taylor)

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Mika Kuoppala
4a604dee60 tools/null_state_gen: build cmd and state space separately
Instead of building batch directly to memory, build into cmd and
state arrays. This representation allows us more flexibility in batch
state expression and batch generation/relocation.

As a bonus, we can also attach the line information that produced the
batch data to help debugging.

There is no change in the output states produced. This can be considered
as a preparatory patch to help introduce gen8 golden state.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-09-05 18:04:14 +03:00
Mika Kuoppala
b77145dd48 lib: Add MI_LOAD_REGISTER_IMM
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-09-05 18:04:14 +03:00
Mika Kuoppala
c5ad1c3295 lib/gen6_render: fix GEN6_3DSTATE_VF_STATISTICS define
We dont use this pre CTG and we will need it for gen8 golden state.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-09-05 17:58:23 +03:00
Mika Kuoppala
f0023fa8f5 lib/rendercopy: fix a typo in define
No functional changes

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-09-05 17:58:23 +03:00
Mika Kuoppala
ba614bea44 tools/null_state_gen: terminate relocs with -1
as this was already changed in kernel.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-09-05 17:58:23 +03:00
Daniel Vetter
c49542af07 lib/igt_aux: Improve wait_for_keypress helper a bit
- Use keys in just one env variable to enable/disable it.
- Add an informational message so that the users knows when to press
  the key (more useful over ssh than when run on the terminal ofc).
- Improve the documentation so that it's clearer how to use this
  when running tests.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-05 09:30:53 +02:00
Paulo Zanoni
a16ebccaee igt_core: zero exit_handler_count before forking
If we don't reset exit_handler_count before forking, we may have a
case where the forked process is killed before it even does
"exit_handler_count = 0": in that case, it is still finishing forking.
When that happens, we may end up calling our exit handlers. On the
specific bug I'm investigating, we call igt_reset_connnectors(), which
ends up in a deadlock inside malloc_atfork. If we attach gdb to the
forked process and get a backtrace, we have:

(gdb) bt
0  __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
1  0x00007f15634d36bf in _L_lock_10524 () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007f15634d12ef in malloc_atfork (sz=139729840351352, caller=<optimized out>) at arena.c:181
3  0x00007f15640466a1 in drmMalloc () from /usr/lib/x86_64-linux-gnu/libdrm.so.2
4  0x00007f1564049ad7 in drmModeGetResources () from /usr/lib/x86_64-linux-gnu/libdrm.so.2
5  0x0000000000408f84 in igt_reset_connectors () at igt_kms.c:1656
6  0x00000000004092dc in call_exit_handlers (sig=15) at igt_core.c:1130
7  fatal_sig_handler (sig=15) at igt_core.c:1154
8  <signal handler called>
9  0x00007f15634cce60 in ptmalloc_unlock_all2 () at arena.c:298
10 0x00007f156350ca3f in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c:188
11 0x000000000040a029 in __igt_fork_helper (proc=proc@entry=0x610fc4 <signal_helper>) at igt_core.c:910
12 0x000000000040459d in igt_fork_signal_helper () at igt_aux.c:110
13 0x0000000000402ab7 in __real_main63 () at bug.c:76
14 0x000000000040296e in main (argc=<optimized out>, argv=<optimized out>) at bug.c:63

After doing some searches for "stuck at malloc_atfork", it seems to me
we probably shouldn't be doing any malloc calls at this point of the
code, so the best way to do that is to make sure we can't really run
the exit handlers.

So on this patch, instead of resetting the exit handlers after
forking, we reset them before forking, and then restore the original
value on the parent process.

I can reproduce this problem by running "./kms_flip --run-subtest
2x-flip-vs-modeset" under an infinite loop. Usually after a few
hundred calls, we end up stuck on the deadlock mentioned above. QA
says this problem happens every time, but I'm not sure what is the
difference between our environments that makes the race condition so
much easier for them.

The kms_flip.c problem can be considered a regression introduced by:
commit eef768f283466b6d7cb3f08381f72ccf3951dc99
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Wed Jun 18 14:28:43 2014 +0100
    tests: enable extra connectors in kms_flip and kms_pipe_crc_basic

even though this commit is not the one that introduced the real
problem.

It is also possible to reproduce this problem with a few modifications
to template.c:
  - Add a call to igt_enable_connectors() inside the first fixture.
  - Add igt_fork_signal_helper() and igt_stop_signal_helper() calls
    around subtest B.

Note that the crucial piece is that the parent actively kills helper
children, and if we skip tests this can happen _really_ fast. See e.g.

commit a031a1bf93b828585e7147f06145fc5030814547
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Sep 13 16:43:22 2013 +0200

    lib/drmtest: ducttape over fork race

for past hilarity in this area.

Cc: Thomas Wood <thomas.wood@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81367
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-04 10:35:21 +02:00
Chris Wilson
081887504a igt/gem_concurrent_blit: Move igt_require() out of children
Otherwise the test infrastructure throws a fit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83420
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-03 13:38:30 +01:00
Chris Wilson
3309f54e8f igt/gem_gtt_hog: Convert opencoded fork()/wait() over to igt_fork()
No reason not to use the common infrastructure here.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-03 12:03:56 +01:00