4355 Commits

Author SHA1 Message Date
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
Lionel Landwerlin
cd8da3f65d lib: kms: move framebuffer scanout offset/size to plane
This fixes potential crashes when the framebuffer is unset from a
given plane.

v2: s/with/within/ typo in header

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Marius Vlad <marius.c.vlad@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-05 17:09:29 +03:00
Ville Syrjälä
54b8a1f2d3 tools/intel_reg: Fix builtin register spec for gen4
Actually use the builtin register spec on gen4. Makes intel_reg dump
actually do something on gen4.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-04-05 16:24:44 +03:00
Chris Wilson
9cff3be127 igt/gem_shrink: Reduce oom spam
Since we are deliberately going to fail the mmap() allocation, don't
assert.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-04 16:25:24 +01:00
Chris Wilson
7a977554cb igt/gem_shrink: Fix leak in userptr, add another
Hitting oom from userptr because we had N threads all consuming all of
memory, wasn't the intention but the bugs it found were useful!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-04 15:25:57 +01:00
Chris Wilson
1a50172302 benchmarks: Include my ezbench test runners
Just a set of scripts to integrate these benchmarks with ezbench. They
need to be revised to plugin into latest version of ezbench.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-03 18:32:07 +01:00
Chris Wilson
eac26718e6 benchmarks/gem_latency: Add a -C switch to measure impact of cmdparser
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-03 18:32:07 +01:00
Chris Wilson
bd292436ed lib: Avoid assertion if sig_ioctl is unsed from a child accidentally
The timer is tied to the creator thread, i.e. it is not inheritable
across fork() or clone()/pthread_create(). Using it thus causes an
assertion failure in the test after the one that aborts (and so on until
we perform an interruptible test correctly) - one mistake snowballs. We
can stop the snowball by doing an initial check and diverting back to
drmIoctl().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-03 13:40:48 +01:00
Chris Wilson
cb12d05e79 lib: Don't report the last errno inside the async GPU hang detector
Since the last errno doesn't correspond with the signal, reporting it
when we detect the GPU hang is confusing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-03 13:40:48 +01:00
Chris Wilson
8833648b5c igt/gem_shrink: Exercise with userptr stress
Add additional mempressure in the form of userptr.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-02 17:41:11 +01:00
Chris Wilson
88bfe6ac41 igt/gem_shrink: Add pread/pwrite stress
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-02 17:41:11 +01:00
Chris Wilson
d081953e67 igt/pm_rps: Trigger a real GPU reset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 20:09:34 +01:00
Chris Wilson
3dd5fe8ab2 igt/gem_exec_reloc: Exercise read-only relocation arrays
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 20:07:55 +01:00
Chris Wilson
aec81019e1 igt/gem_busy: Try to slow down execution
With lockdep enabled, the driver overhead is enormous and we need to
slow down the GPU to compenstate (otherwise the GPU is already idle when
we expect busyness). So do more work per batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 17:05:20 +01:00
Chris Wilson
92ee3cc1f6 igt/gem_busy: Cap number of tries to create busy rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 14:59:43 +01:00
Chris Wilson
0f5b03fa38 igt/gem_busy: Use a boatload of store-dwords to force ring busyness
A little more inelegant as we can't control the delay very well, but it
should prove more vesatile and broaden the test coverge (and still be
quick enough for basic).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-01 13:21:56 +01:00
Chris Wilson
c89e8dbfd8 lib: Ignore udev failure to report an event
Fixes gem_exec_suspend complaining that the hang detector spontaneously
combusts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 17:22:41 +01:00
Chris Wilson
2b804c33e7 lib: Tidy error message for a helper process who unexpectedly dies
Transform

gem_exec_suspend: igt_core.c:1429: igt_stop_helper: Assertion `(((signed char) ((((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) + 1) >> 1) > 0) && (((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) == (proc->use_SIGKILL ? 9 : 15)' failed.

into

(gem_exec_suspend:16589) igt-core-DEBUG: Helper died too early with status=0
gem_exec_suspend: igt_core.c:1437: igt_stop_helper: Assertion `helper_was_alive(proc, status)' failed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 17:22:41 +01:00
Chris Wilson
0bd117fa66 igt/gem_exec_suspend: Add basic selftest
The selftest is already before the suspend/hibernate tests, but to be
clear also run it first (it only takes a millisecond) by itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 13:53:22 +01:00
Chris Wilson
e56de3c900 igt/gem_exec_store: Exercise write ordering
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-29 11:20:22 +01:00
Chris Wilson
41a26b5152 igt/gem_exec_nop: Relax parallel assertion for short rings
On bdw, the render ring becomes full and limits dispatch across all rings.
Adjust the expected latency to take this into account.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-28 16:27:24 +01:00
Chris Wilson
870c774b86 igt/gem_exec_nop: Add expectancy of independent execution between engines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-28 15:41:08 +01:00
Chris Wilson
633854e8f4 igt/gem_ctx_switch: Add basic test for context switching
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-26 11:22:04 +00:00