3528 Commits

Author SHA1 Message Date
Yunlian Jiang
95019c2a3c debugger: remove unnecessary struct per_thread_data
This removes unnecessary 'struct per_thread_data' and avoids the
compilation error 'variable length array in structure extension
will never be supported' by clang. The bug entry is
https://code.google.com/p/chromium/issues/detail?id=476001

Cc: Benjamin Widawsky <benjamin.widawsky@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Yunlian Jiang <yunlian@google.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-27 16:28:34 +01:00
Derek Morton
88c9a82318 lib: Enable building unit tests on android
Add a make file for android so the unit tests can be built.
Enabled asserts for the library code so the unit test behaviour
is correct.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-27 16:17:05 +01:00
Tvrtko Ursulin
f2a5896bdd kms_rotation_crc: Update rotation direction for kernel changes
commit 1e8df16778b0d8fd8102b3ee799b028f8f961089
Author: Sonika Jindal <sonika.jindal@intel.com>
Date:   Wed May 20 13:40:48 2015 +0530

    drm/i915/skl: Swapping 90 and 270 to be compliant with Xrand

Changed the rotation direction so IGT needs to be told.

Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-27 14:24:49 +01:00
Chris Wilson
308b0e856b igt/gem_linear_blits: tidy
Be clean and use memset(0) on ioctl args before use and downgrade some
of the lesser informatic messages to just debug.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-20 14:57:16 +01:00
Chris Wilson
e93fbc2873 igt/gem_streaming_write: Add a variant to exercise CS
Another issue in streaming writes is into the batch buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-20 14:57:16 +01:00
Chris Wilson
3d1f9a2236 igt/gem_streaming_writes: Remember to markup the write target!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 15:35:48 +01:00
Chris Wilson
65fec5e583 igt/gem_streaming_writes: Add more validation steps
Inalcude a pre-pass to check that the non-streaming, partial writes
work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 15:35:48 +01:00
Damien Lespiau
c0a0725fad list-workarounds: Print the line where the parsing error occured
Useful to understand the warnings the scripts prints.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-19 15:15:05 +01:00
Imre Deak
554aac5f3e tests/pm_rc6_residency: fix check if RC6P or RC6PP is enabled
The test checks the residency in a given RC6 state or any deeper states
that are also enabled. For example the RC6 subtest checks the combined
residency in RC6/RC6P/RC6PP. Since the kernel reported value for the RC6
residency doesn't include the RC6P or RC6PP residency we need to adjust
the RC6 value accordingly. A similar adjustment is needed for the RC6P
subtest.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90369
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
2b47e219be tests/pm_rc6_residency: fix counter readout in case of wrap-around
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
05e9edb2b9 tests/pm_rc6_residency: remove redundant idle loops
Currently the test runs a separate idle loop when reading out each RC6
counter. But there is no need for this, we can have a signle idle loop
and read out all the counters at once.

This prepares for an upcoming patch where we need to consider the RC6P
and RC6PP counters as well when checking RC6.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
a2ce95eb9e tests/pm_rc6_residency: sanitize the RC6 enabled mask check
The way the test checks for the RC6 enabled mask atm doesn't work:
calling igt_success outside of any subtests doesn't have any effect.
This means the test will run a 11 second idle loop for each RC6 state
regardless if the platform supports these or have them enabled. Fix this
by checking explicitly if a given RC6 state is enabled before reading
out/checking the corresponding counter.

With this fix we can also get rid of the GEN6/IVB checks, since the RC6
mask check makes them redundant. We still need the VLV/CHV checks, since
media RC6 doesn't have a separate bit in the mask.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
a76591a4be tests/pm_rc6_residency: factor out the code to measure residencies
The upcoming patches will add some additional logic around reading out
the counter values, so factor out the readout code to prepare for those
patches.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
7883bc8c1c tetst/pm_rc6_residency: sanitize counter check function arguments
The counter check function (residency_accuracy) cares only about the
counter delta, so no need to pass it the start/stop values separately.
Simplify things to prepare for the upcoming patches.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Imre Deak
a572fb15f3 tests/pm_rc6_residency: simplify the residency counter check
The temporary vars only obfuscated things, so get rid of them. Also
remove some redundant asserts and info messages.

The only functional change is that the counter delta will be checked
only against a percentage based accuracy range (90%-100%) and not
against a hard-coded limit (RC6_FUDGE). The two checks serve the same
purpose and the former one is clearer.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-19 11:35:55 +03:00
Damien Lespiau
5253af92ad lib/bxt: Update the Broxton PCI IDs
Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-18 16:25:25 +01:00
Derek Morton
d819b7ee35 tests/Android.mk: Treat all KMS tests as Cairo dependent
If ANDROID_HAS_CAIRO is not set, automatically add all
kms tests to the skip_tests_list.

Building for android currently fails due to the addition of
new kms tests. Rather than just adding the new tests to the
exclusion list, autogenerating a list of all kms tests and
excluding them will reduce future maintainance.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-15 14:02:32 +01:00
Damien Lespiau
fa4396d091 gem_bad_blit: Make the BAD_GTT_TEST address more than 32 bits
gem_bad_blit.c: In function ‘bad_blit’:
gem_bad_blit.c:89:3: warning: right shift count >= width of type [enabled by default]
   OUT_BATCH(BAD_GTT_DEST >> 32); /* Upper 16 bits */

v2: remove extraneous ()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-15 12:23:43 +01:00
Damien Lespiau
15f60217cc intel_display_crc: A new tool to play with display CRCs
The CRC debug interface is a bit more than a simple textual file in
debugfs as there are a small command language to control what we want
from them.

This tool starts, slowly, by allowing us to dump the pipe CRCs whenever
we want. It can be handy to check what is the current CRC when we reach
a certain state on the screen (when using --interactive-debug for
instance) against a known CRC.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-15 12:22:21 +01:00
Damien Lespiau
fd6846c99f lib: Add a user data pointer to the argument parsing functions
It can be useful to have one of those to carry state between the handler
parsing the options and the rest of the test. Right now the only thing
we can do is to use global variables for that.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-15 12:22:14 +01:00
Thomas Wood
7a5e1c6f0a tests: match gem_create prototype in igt_eviction_test_ops create function
This avoids a warning when using gem_create as the create function.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14 17:01:57 +01:00
Thomas Wood
aa6c63463f igt.cocci: don't use igt_assert_neq to compare pointers
igt_assert_neq can only compare integers, not pointers.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14 17:01:57 +01:00
Thomas Wood
6141aa2dad docs: various documentation fixes
Fix various typos, add missing parameter documentation, include the
igt_draw section and update the list of ignored headers.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14 17:00:40 +01:00
Derek Morton
1f6f6c07bd tests/gem_cpu_reloc: Fix gem_cpu_reloc OOM failure
On android with small memory footprints gem_cpu_reloc can fail
due to OOM.

Refactor gem_cpu_reloc into 2 tests, a basic test which performs
10 relocations and a full test which skips if there is insufficient
memory.

Changed the memory required test to better estimate the actual
RAM used.

v2: Addresed comments from Thomas Wood

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14 16:41:37 +01:00
Paulo Zanoni
1a80f90b7d tests/kms_fb_crc: fix the reference CRC checking
Now we get the reference CRCs on separate untiled FBs just to make
sure FBC is not there to mess the CRC computation. We also get the
reference CRCs for buffers that were drawn in the same way that we
draw them during the tests, so we can finally get rid of that FIXME
comment we have!

With this, kms_fbc_crc now actually tests something instead of just
wasting CPU cycles...

Fixes regression introduced by:

commit 562bbe12f6fb75811a746c742a28d32a17b26aa9
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Feb 27 22:04:18 2015 +0100
    tests: Remove usage of igt_crc_equal and _non_null

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
31906084de tests/kms_fbc_crc: extract fill_mmap_{cpu,gtt}()
Just like we have fill_render() and fill_blt(). I'm also going to use
fill_mmap_gtt() for the code that generates the reference CRCs.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
b3faeb16fe tests/kms_fbc_crc: make the blt test draw the same pattern
... as the other drawing tests: single white pixel at top/left of the
screen, instead of painting the whole screen blue.

This will make it much easier to fix the CRC checking code.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
5d3c2a6353 tests/kms_fbc_crc: extract check_crc()
To remove some duplicated code. When we finally fix that FIXME, the
code will get a little bigger too.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
a976d7e44a tests/kms_fbc_crc: refactor context handling code
Just a small modification to make the code a little easier to
understand, IMHO.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
fceed3a585 tests/kms_fbc_crc: unify flip handling
Just a small simplification to make the code a little easier to
understand, and to help us when we further split drawing vs flipping
later.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
036401d42c tests/kms_fbc_crc: increase the FBC wait timeout
Now that we moved to the frontbuffer tracking scheme, it may take a
long time for FBC to be updated after it is invalidated: 300ms is not
enough anymore.

The problem starts when i915_gem_execbuffer2() indirectly calls
intel_fb_obj_invalidate(), which disables FBC. After this, FBC only
gets reenabled when i915_gem_retire_work_handler() happens and
indirectly calls intel_frontbuffer_flush(). Notice that while FBC is
not yet enabled, the screen contents are correct, so this shouldn't
really be a bug.

Previous versions of this patch were replacing the gem_bo_busy() calls
with gem_sync(), but after some discussion we concluded this was not
the correct way to handle the problem, so let's just increase the
timeout so we can kill those subtest failures.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
8c3ac50b00 tests/kms_fbc_crc: exec_nop() can also invalidate FBC
So make sure that, at prepare_test(), we wait for FBC to be enabled
again after we run the exec_nop() call. Since after this happens, we
just assert fbc_enabled() at test_crc() instead of waiting for it to
be enabled.

This is now needed because we moved to software frontbuffer tracking,
so it can take some considerable time for FBC to be reenabled after it
is disabled.

A previous version of this patch was just calling gem_sync() after
exec_nop().

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Paulo Zanoni
641d535a03 lib/debugfs: wait_for_keypress("crc") when collecting CRC
Let's just steal the "crc" namespace and add this by default to
igt_pipe_crc_collect_crc() instead of adding more calls to other
tests. If tests want special waits on just some of their collect_crc()
calls, they can use another name instead of "crc".

This is very useful when developing, especially when the CRC we get is
wrong: we want to look at the screen to see what's going on before we
can think about how to fix the problem. So let's add this to the lib
instead of adding this to every single test I need to debug.

v2: Add some documentation (Daniel).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14 10:02:07 -03:00
Mike Mason
3db5762384 scripts/run-tests.sh: use single combined test list
i-g-t now creates a single combined test list for tests with
and without subtests. This patch adapts run-tests.sh to that
change.

Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-12 17:03:43 +01:00
Damien Lespiau
e949c42b49 quick_dump: Expand the WM cursor registers
The tool I used to generate that list doesn't support expanding the list
of registers when dealing with something like CUR_WM_A_*. Expand it by
hand for now (tm).

Remove CUR_PAL_${pipe}_* for the same reason (and because it's not very
useful to have).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-12 16:41:09 +01:00
Chris Wilson
2ce298cf13 igt/gem_stream_writes: Use execbuf LUT to shave a few cycles off dispatch
Since our goal is to have concurrent read/writes of GPU buffers, we want
to spend as little time in between as possible.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-12 15:35:32 +01:00
Daniele Ceraolo Spurio
27cf5847dc tests/gem_cs_tlb: fix hardcoded ring id
The test has 4 subparts, one for each ring, but internally they all
submit to ring 0. Fix it to use the provided ring_id

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12 15:30:37 +02:00
Tvrtko Ursulin
980ccf124a igt_kms: Do not reset plane position on assigning a fb
commit a26f9f9ad0e679c7ce413a25d34f6914e1174151
    Author: chandra konduru <chandra.konduru@intel.com>
    Date:   Mon Mar 30 13:52:04 2015 -0700

        i-g-t: Adding plane scaling test case

Started doing this and broke kms_rotation_crc.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: chandra konduru <chandra.konduru@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12 13:45:36 +02:00
Tvrtko Ursulin
c3bd608fc5 igt_kms: Merge condition in igt_plane_set_fb
There were two paths for fb and !fb.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: chandra konduru <chandra.konduru@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12 13:45:36 +02:00
Tvrtko Ursulin
759bb7ac98 igt_kms: Avoid NULL ptr deref when commiting disabled planes
I think;

   commit a26f9f9ad0e679c7ce413a25d34f6914e1174151
   Author: chandra konduru <chandra.konduru@intel.com>
   Date:   Mon Mar 30 13:52:04 2015 -0700

       i-g-t: Adding plane scaling test case

introduced a condition where it attempts to update a disabled plane because
of the newly introduced size_changed flag which is set for disabled frame
buffers. Result is a NULL ptr deref in igt_drm_plane_commit (plane->fb->src_x).

Start recognising this case as disabled plane and act accordingly.

v2: Split out igt_plane_set_fb cleanup. (Thomas Wood)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: chandra konduru <chandra.konduru@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12 13:45:36 +02:00
Tvrtko Ursulin
8a5736b496 kms_flip_tiling: New tiling tests, including Y/Yf
New subtests to excercise flips from tiled to tiled and from
linear to tiled frame buffers.

These will catch display programming issues like not preserving the
tiling mode in page flips or not re-programming the watermarks.

v2: Cleanup crc object after failing subtests.

v3:
   * Wait for page flip completion instead of vblank. (Chris Wilson)
   * Added linear->tiled flip tests to catch watermark programming issues.

v4:
   * Refactored for less code.
   * Check crc after page flip to ensure it happened. (Chris Wilson)
   * Skip rather than fail when flip fails. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12 13:45:36 +02:00
chandra konduru
b6d26c2a48 i-g-t: Update kms_panel_fitting to work on other platforms
kms_panel_fitting currently enabled for SKL only, but as
panel_fitters are available on prior platforms, enable this
kms test for them too.

Signed-off-by: chandra konduru <chandra.konduru@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12 13:45:36 +02:00
Chris Wilson
f5dd258cc7 igt/gem_streaming_writes: Build in a self-test
Use the first pass to write all values prior to the initial execbuf to
verify that the copy itself is true. Subsequent passes then focus on
verifying that writing values whilst the GPU is reading from
neighbouring values is then correct.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-12 10:04:46 +01:00
Chris Wilson
a5a010c82d igt/gem_mmap/huge-bo: Fix cut'n'paste error
One paste too many before pushing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90411
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-12 09:30:04 +01:00
Chris Wilson
357073c257 igt/gem_streaming_writes: Trim number of batch buffers allocated
Reduce memory usage for batches by a factor of 64 - which we immediately
spend some of in increasing the stress.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-11 21:21:36 +01:00
Damien Lespiau
5f932c4dad quick_dump/skl: Add more pipe/plane registers
With the recent developments, add scaler and NV12 registers to the dump.
Also add the cursor registers that were missing in the first batch.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-11 19:31:26 +01:00
Damien Lespiau
f6155ac30c build: Add missing line continuation
When -lrt was added, it was missing a '\' at the end of line. Add it.

Cc: Tim Gore <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-11 17:55:36 +01:00
Damien Lespiau
09ea86eac1 kms_cursor_crc: Move comment to the appropriate place
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-11 17:06:56 +01:00
Chris Wilson
672238dbf7 igt: Add gem_streaming_writes
This tries to replicate the missing barrier observed when using
asynchronous mmap(wc) on byt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-11 16:19:12 +01:00
Damien Lespiau
d9dd33c0d9 lib: Add missing '\n' to error message
Those messages where missing a new line at the end. Take the opportunity
to re-format the messages to fit in the 80 chars limit.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-11 15:10:19 +01:00