3528 Commits

Author SHA1 Message Date
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
Jani Nikula
23b7f08920 lib: add 16 and 8 bit versions of INREG and OUTREG
Add INREG8, INREG16, OUTREG8, and OUTREG16. While at it, cleanup doc
comments of INREG and OUTREG.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:08:34 +03:00
David Herrmann
30e84df0c1 tests: add drm_auth tests for generic DRM-auth-magic testing
This adds tests/drm_auth.c which tests for drmGetMagic() and
drmAuthMagic() deficiencies.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-05 09:44:49 +02:00
Michel Thierry
3be592001b igt/gem_ctx_exec: Add lrc lite restore subtest
Exercise lite-restore (re-submit a context that is currently running),
by queueing several small batchbuffers.

This test helps to validate WaIdleLiteRestore.

Signed-off-by: Michel Thierry <michel.thierry@intel.com>
2015-05-04 09:35:49 +02:00
Chris Wilson
c4ec47b46d igt/gem_exec_lut_handle: Force slow relocation path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-03 09:17:36 +01:00
Tvrtko Ursulin
c317b788c0 igt_fb: Close the image file when we are done with it
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-01 17:26:14 +01:00
Tim Gore
48a27bcaf6 lib/igt_core.c : only disable low mem killer once
The call to low_mem_killer_disable(true) was being done
from within function oom_adjust_for_doom. However,
oom_adjust_for_doom gets called from 3 places. We only
want the call to low_mem_killer_disable(true) to happen
during common_init, so call it from here instead of from
oom_adjust_for_doom.

v2:Thomas Wood pointed out that the initial call to disable
the low_mem_killer does not get made when we are just
listing subtests; so I have qualified the call from the
exit handler, which re-enables the low_mem_killer, with
if (!igt_only_list_subtests()).
For belt and braces I have also made low_mem_killer_disable
idempotent, so multiple calls to disable or re-enable are
safe.

Signed-off-by: Tim Gore <tim.gore@intel.com>
[Thomas: small coding style fix]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-01 17:13:56 +01:00
Tvrtko Ursulin
637f0455da kms_rotation_crc: Do not leak framebuffers during test duration
Test used to call prepare_crtc twice in the plane loop and leaked two
framebuffers per [subtest]x[pipe]x[plane].

What the loops really wants to do, instead of second invocation of
prepare_crtc, is to just turn on the display with the unrotated fb to
verify that the plane property has been restored by the VT transition
from previous to graphics mode.

To enable that factor out code which does that from prepare_crtc into
commit_crtc and call it instead.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-01 16:24:28 +01:00
Jani Nikula
4650d3406c man: add man page for intel_reg in reStructured text format
Produce the intel_reg man page from rst using rst2man. Also facilitate
writing any man page in reStructured text, as long as rst2man is
available.

v2: configure check for rst2man, credits to Thomas Wood for that.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-04-30 14:22:05 +03:00
Tvrtko Ursulin
30a1360f6a igt_fb: Transfer existing content to Cairo surface for Y/Yf frame buffers
Rendering into Y and Yf tiled frame buffers with Cairo was losing the
previous content ie. was starting from black. This is different than the
behaviour with linear and X tiled so make it the same by blitting the
initial content when creating the rendering context.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-04-29 15:02:19 +01:00
Chris Wilson
fc69bb0de5 igt/gem_exec_big: Check 64bit relocation values
On gen8, we should check that the full 64bit relocation value is
correct, and we should be sure to poison the relocation offset between
runs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-27 21:12:20 +01:00
Thomas Wood
40b45bace3 tools: add missing header to distributed sources
Make sure all the sources for intel_reg are included in the
distribution.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 17:34:41 +01:00
Thomas Wood
bad8834ee7 tools: update .gitignore
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:32:41 +01:00
Joonas Lahtinen
a3e336e461 tests/gem_mmap_gtt: Use PAGE_SIZE instead of hard coded value
Now that there is PAGE_SIZE define, use it.

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Tvrtko Ursulin
dbf6468f90 kms_rotation_crc: Use main test for negative cases
Saves a good amount of code duplication by supporting expected
failures from the main loop.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Tvrtko Ursulin
6f5d400ae9 kms_rotation_crc: No need to square the buffer in paint
Now that size is calculated in a single place and correct geometry passed in,
paint squares does not need to concern itself with it.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Tvrtko Ursulin
b769a7c96b kms_rotation_crc: Consolidate plane and cursor code paths
There can only be one, either a plane or a cursor, in each subtest so there
is no need for two framebuffer varilables and also some codepaths can be
unified.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Tvrtko Ursulin
e23a818c18 kms_rotation_crc: Negative test does not need to render anything
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Tvrtko Ursulin
148c0d2281 kms_rotation_crc: Remove unused variable in negative test
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Tvrtko Ursulin
d901106240 kms_rotation_crc: Framebuffer used for initial modeset does not need to be painted
It is just there to light up the display using the full modeset. Also renamed it
from fb_full to fb_modeset to be more descriptive.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Tvrtko Ursulin
4dd79d13c9 kms_rotation_crc: Local framebuffers do not need to be global
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:26:00 +01:00
Chris Wilson
019ae907ff lib: Fix types for gem_mmap*
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-26 12:18:15 +01:00
Chris Wilson
fb950bc17f lib: Cache static queries
We frequently check for device capabilities, for which we can safely
assume that there is but one on a system and so cache the first query
value and return it for all future queries. The benefit is to reduce
dmesg debug spam which helps when either bringing up a test or trying to
track down why a test fails.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-26 12:18:15 +01:00
Chris Wilson
10f903aa23 igt/gem_pwrite: Check that mmap(wc) succeeds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-26 11:21:54 +01:00