4377 Commits

Author SHA1 Message Date
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
Chris Wilson
4233b59608 igt/gem_busy: Slow down the writer
Add a few more (128) loops to the page full of MI_STORE_DWORD in an
attempt to try and slow down the execution to the point where a
full-debug kernel can beat the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-15 10:58:14 +01:00
Chris Wilson
082fb26ce9 igt/gem_exec_nop: Correct %3.f typo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-15 10:58:14 +01:00
Chris Wilson
7bd4f918c4 igt/gem_exec_nop: Explain the parallel execution assertion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-14 17:03:59 +01:00
Daniel Vetter
286992102e lib: Fix doc warnings for real!
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-04-14 16:03:36 +02:00
Tomeu Vizoso
f4718c2b6c tests: Open any driver
For those tests that now pass on drivers other than i915, call
drm_open_driver_master with DRIVER_ANY.

Also do so from igt_enable_connectors.

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-14 13:54:24 +01:00
Tomeu Vizoso
17a5d7168d kms_addfb_basic: Get intel gen from within subtest
Because determining the Intel GFX generation requires a call to
DRM_IOCTL_I915_GETPARAM, move the code that requires it to a subtest
that can be skipped on drivers other than i915.

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-14 13:54:24 +01:00
Tomeu Vizoso
6694b6a669 kms_addfb_basic: Move calls to gem_set_tiling to the subtests
So they don't cause unrelated subtests to be skipped when testing
drivers other than i915.

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-14 13:54:24 +01:00
Tomeu Vizoso
b2671e8e70 kms_addfb_basic: Split tiling_tests off
Move tests requiring tiled BOs to the end so they don't cause unrelated
subtests to be skipped when testing drivers with only dumb buffer
support.

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-14 13:54:24 +01:00
Tomeu Vizoso
c94a828f15 kms_addfb_basic: move tiling functionality into each subtest
Because calls to gem_set_tiling will cause the subtest to be skipped on
drivers other than i915, move them to each subtest that needs them so
the other subtests aren't skipped as well.

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-14 13:54:24 +01:00
Tomeu Vizoso
decbf5a3b1 kms_addfb_basic: call igt_create_bo_with_dimensions
Many tests can do their work on drivers other than i915 and even with
just dumb buffers, so call igt_create_bo_with_dimensions instead of
gem_create which will paper out the differences and call the proper
ioctls or cause the subtest to be skipped if that's not possible.

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-14 13:54:24 +01:00
Tomeu Vizoso
8a1a38661f lib: Add igt_create_bo_with_dimensions
igt_create_bo_with_dimensions() is intended to abstract differences
between drivers in buffer object creation.

The driver-specific ioctls will be called if the driver that is being
tested can satisfy the needs of the calling subtest, or it will be
skipped otherwise.

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-14 13:54:24 +01:00
Tomeu Vizoso
89b3ffe02c lib: Map dumb buffers
If a buffer object is dumb, call DRM_IOCTL_MODE_MAP_DUMB when mapping
it. Also, don't call DRM_IOCTL_I915_GEM_SET_DOMAIN on dumb buffers.

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-14 13:54:24 +01:00
Tomeu Vizoso
a2d5b348ee lib: Add igt_dirty_fb
Just wraps drmModeDirtyFB and for now invalidates the whole FB.

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-14 13:54:24 +01:00
Tomeu Vizoso
fb66a5df93 lib: Add helper kmstest_dumb_map_buffer
Which basically just calls DRM_IOCTL_MODE_MAP_DUMB and is similar to
gem_mmap__gtt().

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-14 13:54:24 +01:00
Tomeu Vizoso
dc84e7d6ad lib: Add wrapper for DRM_IOCTL_MODE_CREATE_DUMB
In order to test drivers that don't have support for proper buffer
objects, add a wrapper for creating dumb buffer objects that will be
called from the lib code for those subtests that don't need to care.

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-14 13:54:24 +01:00
Tomeu Vizoso
85a1d45c4a lib: Call intel_get_drm_devid only from intel code
It only makes sense when testing the i915 driver, so don't call it
otherwise.

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-14 13:54:24 +01:00
Tomeu Vizoso
644f364da2 lib: Assert we are on i915 from intel_get_drm_devid
I915_PARAM_CHIPSET_ID is a i915-only thing, so if a subtest ends up
calling it when testing another driver, the subtest (or the library)
needs to be fixed.

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-14 13:54:24 +01:00
Tomeu Vizoso
e0e3a063ae lib: Expose is_i915_device
Lib and test code can use this function to avoid i915-specific behavior
when running on other drivers.

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-14 13:54:24 +01:00
Tomeu Vizoso
6755757e9f lib: Have gem_set_tiling require intel
Before calling a i915-specific IOCTL, require i915.

This allows us to skip subtests that are specific to that driver, though
what should eventually happen is that tests don't generally call
gem_set_tiling directly but go through an abstraction layer that
constructs the buffer object in a driver-specific way.

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-14 13:54:24 +01:00
Tomeu Vizoso
3fee80efcf lib: add igt_require_intel
Add function that requires that the driver we are talking to is i915.

This allows us to skip subtests that are specific to that driver.

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-14 13:54:24 +01:00
Tomeu Vizoso
0eadf638e4 lib: Rename is_intel to has_known_intel_chipset
As it reflects more clearly what the function actually does.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
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-14 13:54:24 +01:00
Chris Wilson
e609955067 igt/gem_ctx_create: Broaden per-engine testing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-14 10:25:59 +01:00
Chris Wilson
3076951698 igt/gem_exec_create: Add a "leak" test
Don't close the objects, but just mark them as unneded.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-12 16:53:09 +01:00
Chris Wilson
539abffc3e igt: Add a basic test to stress allocation of batches
Run for 20s and don't expect to crash from memory exhaustion or sillies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-12 13:15:50 +01:00
Peter Antoine
8af67d1980 test/gem_mocs_settings: Testing MOCS register settings
The MOCS registers were added in Gen9 and define the caching policy.
The registers are split into two sets. The first set controls the
EDRAM policy and have a set for each engine, the second set controls
the L3 policy. The two sets use the same index.

The RCS registers and the L3CC registers are stored in the RCS context.

The test checks that the registers are correct by checking the values by
directly reading them via MMIO, then again it tests them by reading them
from within a batch buffer. RCS engine is tested last as it programs the
registers via a batch buffer and this will invalidate the test for
workloads that don't use the render ring or don't run a render batch
first.

v2: Reorganised the structure.
    Added more tests. (Chris Wilson)
v3: Fixed a few bugs. (Chris Wilson)
v4: More Tidy-ups.    (Chris Wilson)
    SKL does does not have a snoop bit. (Peter Antoine)

Signed-off-by: Peter Antoine <peter.antoine@intel.com>
2016-04-12 10:45:49 +01:00
Chris Wilson
d6a85f042c igt/gem_busy: fix compaction of multiple store commands
Missed increment of the batch offset between commands.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-11 12:53:30 +01:00
Chris Wilson
9e7e7c38a0 igt/gem_concurrent_blit: Tweak num_buffers to just exceed target
Remember that we allocate and use twice as many buffers as specified (we
have a num_buffers array of src and dst) and so adjust the computation
such that the combined allocation matches the target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-11 09:17:33 +01:00
Chris Wilson
4a3fa3532a lib: Tidy presentations of pread/pwrite failures
Make the assertion failure message readable if gem_read or gem_write
fail.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-11 07:40:11 +01:00
Chris Wilson
c46f3c341c igt/gem_concurrent_blit: Purge the libdrm caches before cloning
When forking, the entire VM is cloned including the VMA backed by GEM
objects from the libdrm buffer cache. This is not only slow, but can also
cause the system to exceed the maximum number of VMA and premature test
failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-10 20:49:26 +01:00
Chris Wilson
e8bcd678a6 igt/gem_shrink: Fix execution object offset
An off-by-one caused us to execute the blank object rather than the
batch.

References: https://bugs.freedesktop.org/show_bug.cgi?id=94801
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-10 18:42:42 +01:00
Chris Wilson
645c95400c lib: Remove defunct stop_rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-09 13:38:12 +01:00
Chris Wilson
1ba9717e6e igt/kms_flip: Convert over to real hang injection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-09 13:38:12 +01:00
Chris Wilson
7f05d31c39 igt/kms_pipe_crc_basic: Replace stop_rings with igt_hang_ring
We can inject a real GPU hang for greater effect!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-09 13:38:12 +01:00
Ville Syrjälä
eaf7f46cdc tests/pm_rps: Increase timeouts to 15 seconds
My BSW takes ~12 seconds to go back to idle after high load, so the
current 10s timeouts are too short. Bump them up to 15s.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-04-08 15:06:46 +03:00
Ville Syrjälä
fd7fef6601 tools/intel_reg: Add extra pipe B registers for CHV
CHV pipe B has some extra features (programmable sprite CSC,
primary plane windowing, primary plane scaler, fancier blending).
Add all the relevant registers to the "quickdump" register list.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-04-05 19:15:44 +03:00
Matt Roper
78a97fe157 kms_atomic: Skip rather than fail on non-atomic drivers
i915 does not yet support the atomic modesetting interface by default;
at the moment it must be turned on explicitly via an
'i915.nuclear_pageflip' kernel command line option.  We should skip
(rather than fail) this IGT test when running on kernels that don't
advertise support for atomic modesetting.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93014
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-04-05 07:40:11 -07:00