4413 Commits

Author SHA1 Message Date
Chris Wilson
a0d6645d45 igt/gem_exec_flush: Add a read-only variation
Alternate between two values written by the GPU so that we can look for
stale cachelines without having to overwrite the value with the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-01 15:16:18 +01:00
Chris Wilson
b481705208 lib: Apply magic clflush serialisation
On Baytrail, Braswell and Atoms beyond we see an issue where the mfence
is insufficient to force the cacheline to be coherent (i.e. such that
writes from the GPU are visible by the CPU after the call to clflush). A
second clflush is ordered with an earlier clflush to the same address
and this appears sufficient to give the coherency required for GPU/CPU
interop.

Testcase: igt/gem_exec_flush
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Akash Goel <akash.goel@intel.com>
2016-05-01 09:14:16 +01:00
Chris Wilson
ef3f61a6d3 tests: Add gem_exec_flush
A basic check that the execbuf flushes writes from the batch and that
they are coherent afterwards.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-29 21:05:58 +01:00
Tvrtko Ursulin
1aebeeb440 igt_kms: Fix use after free in kmstest_get_pipe_from_crtc_id
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2016-04-28 10:12:56 +01:00
Chris Wilson
79f804e8d8 benchmark/gem_latency: sync startup correctly
When waiting for the producers to start, use the cond/mutex of the
Nth producer and not always the first.

Spotted-by: "Goel, Akash" <akash.goel@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-27 18:37:35 +01:00
Chris Wilson
4a62f0b43f igt: Add gem_exec_parallel
Attempt to fill buffers using many clients working in parallel.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-27 18:37:35 +01:00
marius vlad
abc8aa40de tests/gem_close_race: Add igt_fixture block for igt_stop_hang_detector.
igt_fork_hang_detector() was called from a igt_fixture block, while its
counterpart (igt_stop_hang_detector) was called normally, causing
SIGTERM to be sent when running under check target.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-26 21:31:37 +03:00
Chris Wilson
102943d1ba igt/gem_busy: Avoid BSD emission on gen6
Remember to skip using BSD on gen6, unless you want to kill the machine.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95134
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-25 18:52:05 +01:00
Robert Foss
81864b55b0 core_getversion: Only verify major version for i915.
This change mirrors the change in drm made by krh@redhat.com
on "Mon Apr 6 17:18:17 2009" on the drm branch intel_on_all_hw.

The assert(major < 1) is only needed for the legacy intel driver.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-25 15:27:30 +02:00
Robert Foss
4aeed6e829 core_getversion: Switched from igt_assert to assert helpers.
Switched to assert helpers to enable better error output.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
[tomeu: fix test of major version to be lte]
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-25 15:27:30 +02:00
marius vlad
8753f77692 tests/gem_busy: Fix passing invalid fd for basic-parallel-* tests.
Caught by check target.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-25 15:56:37 +03:00
Tomeu Vizoso
b7135575e7 tests/kms_flip_event_leak: Open DRM device with DRIVER_ANY
So that this test can be run in drivers other than i915.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Series-version: 1
Series-to: intel-gfx
Series-cc: padovan, daniels, marcheu, seanpaul, xexaxo, fedkem, mvlad, danvet
Series-prefix: i-g-t
Cover-letter:
Make more tests generic
Hi,

these patches allow a few more tests to run on drivers other than i915,
mainly by removing the last usage of
DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID and removing superfluous dependencies
on bufmgr and tiled BOs.

Thanks,

Tomeu
END
2016-04-25 14:21:35 +02:00
Tomeu Vizoso
0b741cec0e tests/kms_flip_event_leak: Use non-tiled formats
As the test doesn't actually need tiled BOs, drop the tiled formats so
the test can run on drivers other than i915.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25 14:21:35 +02:00
Tomeu Vizoso
857b8b47d1 tests/kms_flip: Open DRM device with DRIVER_ANY
So that this test can be run in drivers other than i915.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25 14:21:35 +02:00
Tomeu Vizoso
52a5518c3e tests/kms_flip: Move bufmgr requirement into subtests
Because bufmgr is currently a i915-only thing and it's only needed in a
subset of the subtests, require it only in the subtests that actually
need it so that the other subtests aren't skipped without a reason.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25 14:21:35 +02:00
Tomeu Vizoso
39eb7043e6 tests/kms_flip: Create tiled BOs only when needed
Because attempts to create a tiled BO will cause a igt_require call to
fail on drivers that don't support tiling, do so in the subtest that
actually needs it so that other subtests aren't skipped without reason.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25 14:21:35 +02:00
Tomeu Vizoso
331585573c tests/kms_render: Move dependency on i915 into subtest
Batchbuffers are only needed in the subtest that does the blit on the
GPU, so move that dependency into it so the other subtest can be ran on
!i915.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25 14:21:35 +02:00
Tomeu Vizoso
a8be527172 tests/drm_read: Drop DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID
So the test runs on other drivers, drop the usage of the i915-specific
DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID ioctl.

Wait for a vblank event on pipe0 and if we get it, then the test can
proceed (code copied from kms_vblank).

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25 14:21:35 +02:00
marius vlad
90a7e3bae5 lib/igt_aux: Half the timeout for suspend to RAM and a third for suspend to disk.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-25 13:23:53 +03:00
Tvrtko Ursulin
660147488e kms_flip: Shorten basic tests a bit
Seems like an overkill for a basic test to keep flipping for
a full minute. Dial it down a bit.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-25 13:20:14 +03:00
Chris Wilson
14f7959038 igt/gem_close_race: Restore threads test to BAT status
Let's try it again because it would have caught a bug in a patch I sent
to the ml...

References: https://bugs.freedesktop.org/show_bug.cgi?id=95048
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-25 10:58:26 +01:00
Chris Wilson
13cfccd665 igt/gem_busy: Test parallel execution
Parallel but not concurrent!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-25 09:35:20 +01:00
Chris Wilson
1e9a3acfd4 igt/gem_busy: Discard the indirect batchbuffers
The stack of batchbuffers is myth. In general there are only 2 levels of
stack for HEAD (ringbuffer, batchbuffer) and chaining up the batch
buffer just updates the lowest level of the stack. A BATCH_BUFFER_END at
any depth then returns to the ring.

So be creative and modify the batch buffer on the fly...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-22 19:31:06 +01:00
Chris Wilson
71f4153287 igt/gem_exec_nop: Apply missed interrupt detection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-22 16:56:03 +01:00
Chris Wilson
2f859537b5 igt/gem_close_race: Import the scratch
Rather than create a new scratch buffer every pass, import the original
as this provides stress upon less commonly trod paths (i.e. handling
objects with many vma) as well as many objects in general.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-22 16:46:15 +01:00
Chris Wilson
757b9be460 igt/gem_close_race: Avoid using threads, use signals instead
Emulate the behaviour of the second thread killing fd at random by
having a signal fire at a random time instead. Only one thread and so we
do not have the issue of accessing another valid handle on another fd
and so executing a blank buffer - triggering GPU hangs.

References: https://bugs.freedesktop.org/show_bug.cgi?id=95048
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-22 16:05:33 +01:00
Daniel Vetter
d9dca5f12a lib/igt_kms: Move IGT_MAX_PLANES into the igt_plane enum
Makes sure we automatically extend that when adding more planes.
Inspired by a patch from Robert Foss who extended the max, but forgot
all about the enum.

While at it, also fix up the whitespace damage.

Cc: robert.foss@collabora.com
Acked-by: robert.foss@collabora.com
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-04-22 14:57:20 +02:00
Chris Wilson
ea7dac11b7 scripts: Add a simple trybot driver
Basic script that may prove useful to others to send a pile of patches
to intel-gfx-trybot@

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-22 08:28:16 +01:00
Marius Vlad
de4f3ab418 tests/gem_close_race: Remove basic-threads from BAT.
Currently this test causes some machines to hang and segfaults on others.
Rename it for now until we figure out the root cause.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95048
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-21 20:57:06 +03:00
Ville Syrjälä
27372851c8 lib: Pass format instead of bpp to create_bo_for_fb()
create_bo_for_fb() expects the drm format as a parameter since
commit 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions")
but not all callers were updated. Fix that up.

Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93328
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-21 13:08:23 +03:00
Chris Wilson
f650aa2dd6 igt/gem_close_race: Batify
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-20 18:48:23 +01:00
Marius Vlad
ed6fb66a50 NEWS: COMMIT_ATOMIC landed a while ago and a test that makes use of it.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-20 20:03:53 +03:00
pvishwak
8b8d7aaffd tests/kms_rotation_crc: Adding rotation tests using COMMIT_ATOMIC path
Modified kms_rotation_crc to follow COMMIT_ATOMIC path if ATOMIC support is
available from driver. If ATOMIC support is not present, tests
will follow COMMIT_UNIVERSAL path.

v2: (Marius)
	Updated commit message
	https://patchwork.freedesktop.org/patch/76040/

v3: (Marius)
	Added description in commit message
	https://patchwork.freedesktop.org/patch/79492/

Signed-off-by: Pratik Vishwakarma <pratik.vishwakarma@intel.com>
[mcvlad: Re-worked a little comment description]
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-20 19:49:49 +03:00
Robert Foss
a256df9dc6 kms_atomic: Fix crtc_id comparison failing.
Fixed ctrc_id comparison failing due to bad initialization of
crtc variable.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-20 18:53:56 +03:00
Marius Vlad
213b073aad NEWS: Updated info about tests/tests-list.txt.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-20 18:41:24 +03:00
Feceoru, Gabriel
a633ad03c6 tests: Separate tests with lots of subtests
Currently, when trying to run i-g-t tests with piglit, it takes up
to 20s until the first test is executed.
The main reason is that gem_concurrent_all has ~500k subtests,
overkilling piglit.

This patch separates gem_concurrent_* tests from the rest of the tests,
creating two files test-list.txt and test-list-full.txt.
The piglit can now enumerate the i-g-t tests within a decent few seconds.
The second list could be used when trying to execute specific these tests.

v2: Rebased

Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-20 18:16:43 +03:00
Tomeu Vizoso
3450cba30e lib: Declare loop variable as volatile before setjmp
The variable used as loop counter in the igt_fixture macro had
unspecified value from the setjmp(3) man page quoted below. Because of
that, in certain circumstances and with -O2 and -Os, the initialization
of that variable would be eliminated and the compiler would complain of
uninitialized usage. Below can be found a snippet that reproduces the
problem with GCC 5.3.1 and 4.9.3 and the errors as printed by 5.3.1.

"The compiler may optimize variables into registers, and longjmp() may
restore the values of other registers in addition to the stack pointer
and program  counter. Consequently, the values of automatic variables
are unspecified after a call to longjmp() if they meet all the following
criteria:

·  they are local to the function that made the corresponding setjmp(3)
call;

·  their values are changed between the calls to setjmp(3) and
longjmp(); and

·  they are not declared as volatile."

static void test(void)
{
	igt_subtest_group {
		igt_fixture {
		}

		igt_subtest("foo") {
		}

		igt_fixture {
		}
	}
}

In file included from lib/intel_batchbuffer.h:8:0,
                 from lib/drmtest.h:39,
                 from lib/igt.h:27,
                 from tests/kms_addfb_basic.c:28:
tests/kms_addfb_basic.c: In function 'tiling_tests.isra.0':
lib/igt_core.h:110:43: warning: '__tmpint245' is used uninitialized in
this function [-Wuninitialized]
 #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \
                                           ^
lib/igt_core.h:110:43: note: '__tmpint245' was declared here
 #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \
                                           ^
lib/igt_core.h:148:31: note: in definition of macro '__igt_tokencat2'
 #define __igt_tokencat2(x, y) x ## y
                               ^
lib/igt_core.h:110:30: note: in expansion of macro 'igt_tokencat'
 #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \
                              ^
tests/kms_addfb_basic.c:245:3: note: in expansion of macro 'igt_fixture'
   igt_fixture {

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-20 14:54:46 +02:00
Micah Fedke
be354f444e lib: update kmstest_get_pipe_from_crtc_id
This function uses an intel-specific ioctl to fetch a mapping between pipes and
crtc ids, but this technique is outdated as the crtc id is now always
equivalent to its index in the array of crtcs returned by the kernel.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-20 14:35:23 +02:00
marius vlad
f8af3565bd tests/kms_pipe_crc_basic: Don't suspend the machine if the pipe is not present.
suspend-read-crc-pipe will perform a suspend and then skip the test in case the
pipe is not present or is fused w/ another pipe.  Skip the test before doing
the suspend.

v2: Somehow the subject was trimmed.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-20 13:48:04 +03:00
Bob Paauwe
e3e00bae23 ksm_pipe_color: Set legacy gamma values inside loop.
When testing multple outputs, make sure to set the gamma values before
testing the output.  Otherwise we're testing using the gamma values
that were reset after last output was tested.  Without this, the first
output passes, but each output after that will fail.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-20 13:39:50 +03:00
Chris Wilson
459ff6b7e2 igt/gem_concurrent_blit: Ensure we only shrink the child buffers
As we reuse the parent arrays under the assumption that the child uses
fewer buffers, make sure that is true.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-20 07:50:18 +01:00
Marius Vlad
87acd98a2c NEWS: a newer version of piglit is required.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-19 19:49:43 +03:00
Feceoru, Gabriel
203591ba87 scripts: Adapt run-tests.sh to the piglit changes
Piglit changed its behaviour to prevent overwriting the results
directory unless explicitly specified with -o

Added -o flag in run-tests.sh to keep user experience.

Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-19 19:45:13 +03:00
Chris Wilson
77b8a5bfd3 igt/gem_exec_nop: Fix time units for assertion printf
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-18 10:27:17 +01:00
Chris Wilson
ca4f42ba17 igt/gem_ctx_param: Relabel
Checking parameters is not interesting for BAT, it is a simple ABI test
that only provides coverage of the CONTEXT_GETPARAM and CONTEXT_SETPARAM
ioctls, and no deeper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-18 10:27:17 +01:00
Chris Wilson
7bd2ac6642 gem_exec_lut_handle: Fix presumed_offset to force relocation on full-ppgtt
If the object is at offset 0, quite likely using full-ppgtt, then the
presumed_offset set also to 0 causes the relocation to be skipped.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-16 17:17:19 +01:00
Chris Wilson
c84853ba32 igt/gem_mocs_settings: Check for pollution of default contexts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-15 12:25:43 +01:00
Tvrtko Ursulin
cfb9e8ec29 igt/drv_module_reload_basic: Do not require snd-hda-intel
Recent refactoring has made absence of snd-hda-intel a test
failure do the respective modprobe being at the end of a
reload function now.

Only fail in this case if module was previously unloaded.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-15 11:26:45 +01:00
Tomeu Vizoso
da3ae5c861 tests/kms_addfb_basic: Set tiling in addfb25 subtest
When moving the call to gem_set_tiling into the subtests, the one needed
by addfb25-framebuffer-vs-set-tiling was left out.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2016-04-15 11:26:14 +01:00
Chris Wilson
e0145eabba igt/gem_pwrite: Add backwards/random access patterns
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-15 11:09:23 +01:00