3601 Commits

Author SHA1 Message Date
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
Chris Wilson
9b0a32dc80 lib/core: Limit fatal signal CRASH reporting to the fatal signals
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-10 09:12:16 +01:00
Damien Lespiau
cb57cdc632 skl_compute_wrpll: Prefer even dividers
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
b3ef2986ca skl_compute_wrpll: Count how many even/odd dividers we compute
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
8d1739dd84 skl_compute_wrpll: Make sure we respect the DCO frequency constraints
We might as well verify that we have a semblance of all being in order
by making sure the DCO frequency is within the expected bounds.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
acbcdbd8b7 skl_compute_wrpll: Add a way to test the SKL WRPLL algorithm
I had various problems (infinite loops, unable to compute dividers for
certain frequencies) after implementing a BSpec update. Much easier to
debug that in userspace.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
5dbeebc8aa compute_wrpll: Rename ddi_compute_wrpll to hsw_compute_wrpll
We're going to add the SKL version, time to rename the HSW/BDW one.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Chris Wilson
09f4175889 igt/gem_mmap_gtt: Add pagefault-of-doom failure case
This is a test that should be a showcase for partial views...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-08 16:45:34 +01:00
Chris Wilson
578795ff95 lib: Teach igt to handle signal failures gracefully
If we see a fatal signal in a subtest, fail.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-08 14:42:27 +01:00
Chris Wilson
be955173d0 igt/gem_mmap_gtt: Check GTT mmapping of large tiled objects
Move function CPU mmap test of large bo to gem_mmap, and include a
page-by-page copy between two huge objects (as we have had many bugs
triggering pagefault-of-doom for full apertures before).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-08 14:42:27 +01:00
Paulo Zanoni
cf9f48e704 lib: add igt_draw
For all those IGT tests that need an easy way to draw rectangles on
buffers using different methods. Current planned users: FBC and PSR
CRC tests.

There is also a tests/kms_draw_crc program to check if the library is
sane.

v2: - Move the test from lib/tests to tests/ (Daniel).
    - Add igt_require() to filter out the swizzling/tiling methods we
      don't support (Daniel).
    - Simplify reloc handling on the BLT case (Daniel).
    - Document enum igt_draw_method (Daniel).
    - Document igt_draw_get_method_name() (Paulo).
v3: - Add IGT_DRAW_MMAP_WC (Chris).
    - Implement the other trivial swizzling methods (Chris).
    - Remove the gem_sync() calls (Chris).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-07 15:11:49 -03:00
Paulo Zanoni
8d3023c15b tests/kms_fbc_crc: fix debugfs read
Commit 47f6b1305cc3752f318a555b932e194e1500c1d8 completely broke this
test due to the fread() assertion. When we're reading the debugfs file
we really don't care about how many bytes we read because the number
is not constant and we just use strstr() later. Change the assertion
to make it check for at least 1 byte read, just to make sure no one
changes that again.

Regression introduced by:
commit 47f6b1305cc3752f318a555b932e194e1500c1d8
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Wed Mar 25 16:42:57 2015 +0000
    igt.cocci: check the return values of various functions

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-07 14:58:19 -03:00
Daniele Ceraolo Spurio
159562c825 tests/gem_ppgtt: Check for vm leaks with flink and ppgtt
Using imported objects should not leak i915 vmas (and vms).

In practice this simulates Xorg importing fbcon and leaking (or not) one vma
per Xorg startup cycle.

v2: use low-level ioctl wrappers and bo offset to check the leak (Chris)
v3: use the flinked bo as batch (Chris)
v4: add check on offset, remove unneeded  assignments (Chris)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> (v2+)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-07 08:43:32 +02:00
Daniel Vetter
aa720ffaf5 lib/mmio: One more s/OUTRET/OUTREG/
A those typos ...

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-05-06 11:38:06 +02:00
Daniel Vetter
9bb2ca3a83 lib/batchbuffer: Fix COLOR_BLIT_COPY_BATCH_START
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-05 17:29:40 -03:00
Paulo Zanoni
c0ed7d344a tests/kms_fbc_crc: remove redundant information from data_t
While it is nice to have shorter names for the most-accessed
variables, it makes the code more difficult to read since it's not
clear to the code reader whether that "gem_handle" is from some FB or
something else. The reader also has to audit the code to see if, for
example, the value of data->handle[0] stays consistent with
data->fb[0].gem_handle all the tame or if at some point the value is
replaced with something else. So remove the redundant information,
making it explicit that we're using the gem handles and FB IDs of the
framebuffers all the time.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-05 17:29:14 -03:00
Paulo Zanoni
235e87de45 tests/kms_fbc_crc: use igt_pipe_crc_collect_crc()
Instead of its hardcoded implementation.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-05 17:28:50 -03:00
Paulo Zanoni
26ff2c7daa tests/kms_fbc_crc: add wait_for_fbc_enabled()
The code has a common pattern of "wait 300ms, then check if FBC is
enabled". Most of the time FBC is enabled in either 50ms or 0ms, so
introduce wait_for_fbc_enabled(), which can return much earlier if FBC
is actually enabled before the 300ms timeout.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-05 17:28:18 -03:00
Paulo Zanoni
9bb04d3aa6 lib: add igt_wait()
Just a little helper for code that needs to wait for a certain
condition to happen. It has the nice advantage that it can survive the
signal helper.

Despite the callers added in this patch, there is another that will go
in a separate patch, and another in a new IGT test file that I plan to
push later.

v2: Check COND again before returning in case we hit the timeout.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-05 17:27:49 -03:00
Jani Nikula
a734ac2058 rename global mmio variable to igt_global_mmio
Global variable names should reflect the fact that they are indeed
global, and at the very least they should not be as short as just
"mmio". Rename mmio to igt_global_mmio.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:13:43 +03:00
Jani Nikula
db84a8cf14 tests/gen7_forcewake_mt: use local mmio variable
igfx_get_mmio() uses the global mmio variable by accident. Use a local
variable instead.

The intention is to rename the global variable later on, so shadowing it
here does not matter.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
0bbbc6360f intel_vga_{read,write}: use INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
33c2e8b083 intel_display_poller: use INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
fb1515c170 intel_watermark: switch to INREG
Use INREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
12d785bcd4 intel_reg_{read,write}: switch to INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
87eb37c86b intel_reg_checker: switch to INREG
Use INREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
e9f4c5f9b9 intel_backlight: switch to INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
510ac32db1 intel_reg: switch to INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00