4292 Commits

Author SHA1 Message Date
Lionel Landwerlin
c7e9be2302 lib: add crc comparison function without an assert
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:47:22 -07:00
Lionel Landwerlin
a511310244 lib: fb: add igt_paint_color_gradient_range
This is a helper to draw a gradient between 2 colors.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:47:04 -07:00
Lionel Landwerlin
1716625e1e lib: kms: add helpers for color management properties on pipes
v2: Rename CTM_MATRIX property to CTM

v3: Add support for atomic commits

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:46:18 -07:00
Lionel Landwerlin
59b5487625 lib: kms: add crtc_id to igt_pipe_t
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21 11:45:45 -07:00
Chris Wilson
8520037e54 lib: Measure the cost of calling timer_settimer() for sigiter
We wish to delay the first signal from the igt_sigiter_ioctl
sufficiently to skip over the timer_settime() and into the drmIoctl
kernel context before firing. If we fire too early, we will think that
the ioctl doesn't respond to signals and ignore it in future. If we fire
too late, we won't probe the ioctl for signal handling at all. Let's try
measuring the timer_settime() call time as a first approximation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 16:26:04 +00:00
Chris Wilson
f1a3d0d96f igt/gem_ringfill: Fix basic- reversal
Rushed flipping around the logic to add basic- and forgot to apply the
corrected patch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 14:40:51 +00:00
Chris Wilson
87a4d8ab64 igt/gem_ringfill: Fine-tune list of BAT tests
Drop -bomb as with forking * interruptible repeating, it takes too long
to include in the BAT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 14:36:57 +00:00
Chris Wilson
a43f40741b igt/gem_exec_suspend: Add BAT runs
Add a couple of all-engine busy tests in order to exercise coherency and
general bugs across suspend. (In particular, I expect this to trigger a
fresh case of lockdeps on Braswell, as well as the usual battery of
missing rpm references. This is an exerciser for my lockless-suspend
patches.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:44:44 +00:00
Chris Wilson
a03ee8f6c8 igt/gem_exec_suspend: Allow suspend testing on gen6
Filter out the request to execute on gen6/bsd to prevent skips.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:05:48 +00:00
Chris Wilson
d5e550f5c6 igt/gem_exec_whisper: Tweak migration logging
reloc.presumed_offset == -1 => implies we hit the fallback path and not
that we strictly needed to patch the relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:05:48 +00:00
Chris Wilson
fcb4cfa520 igt/gem_concurrent_all: Inject a hang onto all rings
Also test a hang across all rings, rather than just one engine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 12:05:48 +00:00
Chris Wilson
3b22b89dd8 igt/gem_exec_whisper: Prevent MI_STORE_DWORD on gen6/bsd again
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21 11:14:27 +00:00
Chris Wilson
c19b049d9c igt/gem_concurent_blit: Prevent a memleak if we assert whilst creating buffers
Assume that we may halt partway through buffers_create() and so be
careful to clear up the partial state in buffers_destroy().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-20 11:17:21 +00:00
Chris Wilson
3d8af56ed2 igt/gem_concurrent_blit: Reset process limits to allow dmabuf tests
Since dmabuf requires an actual fd for every object, we need to increase
the number of files our process is allowed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-20 10:51:09 +00:00
Chris Wilson
82e9113bfb lib/igt_aux: Refine decision to stop signal injection
The goal of injecting signals into the ioctl() is to trigger an EINTR.
If we did not succeed on the last pass, we are not going to on the next
or subsequent passes either.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 16:00:02 +00:00
Chris Wilson
f338e9834c igt/gem_concurrent_blit: Enable quicker interruptible testing
v2: Because I managed to push the wrong version.

Make --list-subtests happer by creating the name before the igt_fixture,
not inside it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:59:27 +00:00
Chris Wilson
1abbd69740 igt/gem_softpin: Convert to igt_interruptible
Convert the fixed time interruptible tests to igt_interruptible() for a
speed improvement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
22674ae88b igt/prime_mmap_coherency: Speed up interruptible testing
Use the new fangled igt_interruptible() to limit the number of passes we
require when performing signal injection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
83cfed8c39 igt/gem_exec_whisper: Add interruptibles tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
87cad37c78 igt/gem_ringfill: Use igt_sigiter to focus the interruptible testing
Use the igt_sigiter interface to repeat the ringfill testing for as much
as is required to exercise all potential injection sites.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
e85613b47c igt/gem_concurrent_blit: dmabuf requires twice the number of files
In order to keep the dmabuf mmap around whilst we keep the object alive,
we need a file descriptor for each. Check that the VFS supports that
many fd.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
c2248efbca igt/gem_concurrent_blit: Enable quicker interruptible testing
Use the igt_sigiter interface to only repeat the -interruptible tests
when we can make further progress with another change at injecting a
signal.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:21:28 +00:00
Chris Wilson
d545610861 lib/igt_aux: Divert ioctls for signal injection
To simplify and speed up running interruptible tests, use a custom
ioctl() function that control the signaling and detect when we need no
more iterations to trigger an interruption.

We use a realtime timer to inject the signal after a certain delay,
increasing the delay on every loop to try and exercise different code
paths within the function. The first delay is very short such that we
hopefully enter the kernel with a pending signal.

Clients should use

struct igt_sigiter iter = {};
while (igt_sigiter_repeat(&iter, enable_interrupts=true))
	do_test()

to automatically repeat the test until we can inject no more signals
into the ioctls. This is condensed into a macro

igt_interruptible(enable_interrupts=true)
	do_test();

for convenience.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 15:20:43 +00:00
Chris Wilson
c1fed522ae lib: Replace drmIoctl() with a layer of indirection
Insted of calling drmIoctl() directly, call igt_ioctl() instead. In the
normal scenario this is function pointer that calls drmIoctl() (so no
penalty), but allows us to divert ioctls into our own routines for
nefarious purposes. One such purpose will be to control interrupt
generation into the ioctl, to be able to detect when we successfully
interrupt the ioctl and when we no longer need more interrupts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19 13:15:08 +00:00
Daniel Vetter
4e4f5b4fdc lib/tests: More igt_subtest_group checks
... for some cases discussed with Chris on irc. We seem to get them all
right.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-19 12:15:47 +01:00
Daniel Vetter
483d1c0a23 lib: Fix some doc warnings
Cc: Marius Vlad <marius.c.vlad@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-19 12:12:47 +01:00
Daniel Vetter
9665073c33 tests/gem_concurrent_blt|all: Use igt_subtest_group
Looks tidy again, and doesn't break igt assumptions.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-19 10:37:40 +01:00
Daniel Vetter
72d04b8453 lib: Add igt_subtest_group
Useful for creating common setup code in igt_fixture which is only
needed by a subset of tests. And since I'm a good citizen it comes
with a library testcase/example included.

v2: Make testcase nastier to ensure a subtest group SKIPS when it's
parent is skipping already. I accidentally got this right, but let's
make sure.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-19 10:37:40 +01:00
Tiago Vignatti
f129ee8a39 prime_mmap_coherency: Add return error tests for prime sync ioctl
This patch adds ioctl-errors subtest to be used for exercising prime sync ioctl
errors.

The subtest constantly interrupts via signals a function doing concurrent blit
to stress out the right usage of prime_sync_*, making sure these ioctl errors
are handled accordingly. Important to note that in case of failure (e.g. in a
case where the ioctl wouldn't try again in a return error) this test does not
reliably catch the problem with 100% of accuracy.

v2: fix prime sync direction when reading mmap'ed file.
v3: change the upper bound using time rather than loops

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
[ickle: fix memleak, run for longer]
2016-03-18 20:42:49 +00:00
Rodrigo Vivi
dbc74dd990 intel: Adding missing Broxton PCI IDs.
These IDs were already part of the kernel since:

kernel commit 985dd4360fdf2533fe48a33a4a2094f2e4718dc0
Author: Imre Deak <imre.deak@intel.com>
Date:   Thu Jan 28 16:04:12 2016 +0200

     drm/i915/bxt: update list of PCIIDs

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com>
2016-03-18 09:30:08 -07:00
Chris Wilson
5d669bf1dd igt/gem_concurent_blit: Exercise different object sizes
Searching for coherency problems that may arise with
smaller-then-cache/large-then-cache objects.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18 14:46:23 +00:00
Chris Wilson
95090bb50b lib/ioctl_wrappers: Explain a couple of igt_require(ret == 0)
Use more verbose igt_require(), here assocaited with SET_CACHING, such
that the requirements are explained in the debug/failure log.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18 14:46:23 +00:00
Chris Wilson
a8a685f877 lib/intel_os: Squelch dmesg spam when purging VM caches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18 11:44:06 +00:00
Chris Wilson
4eba8e22fa igt/gem_concurrent_all: struct buffers for all
Now that we started packaging all parameters in one handy struct, pass
them everywhere. This allows us to pass along requirements so that we
can perform the checks inside each indvidual subtest and so not anger
the igt gods.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18 10:47:34 +00:00
Chris Wilson
dcb39b5270 igt/gem_softpin: Repeat tests with signal interruptions
For the long running tests probing error conditions, throwing in the
signal interruptions is a good idea.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18 09:20:06 +00:00
Chris Wilson
34098b71fa lib/igt_gt: Handle SIGINT whilst writing to i915_error_state
Becareful in case we try and eat the error state whilst interrupts are
being sent and repeat the write() until we finish uninterrupted.

References: https://bugs.freedesktop.org/show_bug.cgi?id=94573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-17 09:55:00 +00:00
Chris Wilson
5df2de7e14 igt/gem_exec_whisper: Move testing of "default" engine to standalone
Exclude the symbolic "default" engine from the interengine sync testing,
and move it onto the standalone testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-17 09:51:02 +00:00
Ville Syrjälä
c8d5c353bf tests/pm_rps: Fix assert for sysfs writes
fprintf() returns a negative value on error. Fix the assert
to catch that.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-03-16 19:58:09 +02:00
Imre Deak
f651493a6b igt/drv_module_reload_basic: Pass correct inject_load_failure module option
The latest version of the inject_load_failure module option expects the
number of the checkpoint where the failure should be injected, so adjust
the test accordingly.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2016-03-15 23:21:23 +02:00
Mika Kuoppala
431f6c4918 tests/gem_evict_alignment: use uint64_t in eviction memory parameters
With large apertures we need to use uint64_t for
counts and sizes. commit 0e2071411a4d4e1488a821daf522dffde2809e03
paved way for this but forgot to change the subtest parameters.

v2: Pass correctly to the copy() also (Chris)

References: https://bugs.freedesktop.org/show_bug.cgi?id=93849
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-03-15 14:58:32 +02:00
Mayuresh Gharpure
0e2e880e04 lib/igt_kms: Add COMMIT_ATOMIC to igt_display_commit2()
Co-Author : Marius Vlad <marius.c.vlad@intel.com>
Co-Author : Pratik Vishwakarma <pratik.vishwakarma@intel.com>

So far we have had only two commit styles, COMMIT_LEGACY
and COMMIT_UNIVERSAL. This patch adds another commit style
COMMIT_ATOMIC which makes use of drmModeAtomicCommit()

v2: (Marius)
	i)Set CRTC_ID to zero while disabling plane
	ii)Modified the log message in igt_atomic_prepare_plane_commit
	https://patchwork.freedesktop.org/patch/71945/

v3: (Marius)Set FB_ID to zero while disabling plane
	https://patchwork.freedesktop.org/patch/72179/

v4: (Maarten) Corrected the typo in commit message
	https://patchwork.freedesktop.org/patch/72598/

v5: Added check for DRM_CLIENT_CAP_ATOMIC in igt_display_init
    (Marius)
	i)Removed unused props from igt_display_init
	ii)Removed unused ret. Changed function to void
	iii)Declare the variable before checking if we have
	DRM_CLIENT_CAP_ATOMIC.
	https://patchwork.freedesktop.org/patch/73505/

v6: (Jani) Corrected typo in commit message

v7: Added is_atomic check for DRM_CLIENT_CAP_ATOMIC in
	igt_display_init and igt_atomic_commit

v8: (Matthew Auld) Replaced for loops by for_each_connected_output and
	for_each_plane_on_pipe
    (Lionel) Populate properties only if the value has changed
    	Remove the resetting of values in disable case
	Note : I've used Maarten's diff patch

v9: (Lionel) Added resetting of rotation property

v10: (Marius) Modified the macro declaration to avoid shadow declaration
	warning, also removed one unused variable

Signed-off-by: Mayuresh Gharpure <mayuresh.s.gharpure@intel.com>
Signed-off-by: Pratik Vishwakarma <pratik.vishwakarma@intel.com>
Signed-off-by: Mayuresh Gharpure <mayuresh.s.gharpure@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-03-15 12:32:05 +01:00
Chris Wilson
314fa179c8 igt/gem_bad_reloc: Rename conflicting negative-reloc-blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-15 09:45:18 +00:00
Chris Wilson
488dc3b1ac igt/gem_exec_whisper: Beware PIN_HIGH
Certain kernels/gen like to move execbuf around for relocations,
disrupting our prewritten batches. Be more careful and try and keep the
relocation/execobjects accurate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-15 09:18:31 +00:00
Chris Wilson
1430eb065f igt/gem_bad_reloc: Fix handling of 64bit relocations
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94537
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 20:48:59 +00:00
Imre Deak
f0d5874bd8 drv_module_reload_basic: skip alive check after load failure injection
After loading the module with load failure injection enabled don't try
check the alive state. Also limit the number of failure points to
existing ones, to reduce the run time of the test.

v2:
- make VT binding/snd module loading part of reload and VT bind fail
  silently (Chris)

Signed-off-by: Imre Deak <imre.deak@intel.com>
2016-03-14 17:44:55 +02:00
Chris Wilson
772393e806 igt/gem_exec_nop: Decrease BAT timing
For basic, since CI doesn't hit the same hard lockup on Braswell that is
possible without hpet, stop running for so long!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:33:36 +00:00
Chris Wilson
2fdf5ac917 igt/gem_exec_whisper: Exercise rings individually
Not as stressful as testing inter-ring synchronisation, but it does
allow inspecting the simpler testcases if need be.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:13 +00:00
Chris Wilson
5459374120 lib: Remove dead gem_get_num_rings()
No users so time to die.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
5acda10e7f igt/gem_exec_reloc: Exercise updating relocations of an active object
Supersedes gem_dummy_reloc_loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
e5abd779cf tests/gem_ring_sync_loop: Exercise all rings
Fix the engine selection to exercise all possible rings and in doing so
completely obsoletes gem_multi_bsd_sync_loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00