1584 Commits

Author SHA1 Message Date
Daniel Vetter
6011508afe tests/gem_concurrent_blit: Fix indent
Thrown up my brain's parser for a moment ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-22 10:01:28 +01:00
Daniel Vetter
fbcc7ba20f tests/gem_concurrent_blt: Adjust subtest naming
Our tooling doesn't cope with () in the testnames (piglit becomes all
confused apparently) and the naming convention says to use "blt" and
"render".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88220
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88349
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-22 09:49:17 +01:00
Zhipeng Gong
9f952940c0 test/gem_dummy_reloc_loop: add tests for dual bsd ring
Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-22 09:27:52 +01:00
Zhipeng Gong
f8d47cb70d tests/gem_exec_params: check the invalid flags for dual bsd ring
v2: add more tests to address Daniel's comments(Zhipeng)

Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-22 09:27:52 +01:00
Chris Wilson
5e9fac5491 igt/gem_tiled_wc: Fix! Finish!
It helps when testing whether tiled data read back through a linear
mmaping to first tile the data. And not repeatedly unmapping the linear
map stops it from segfaulting.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88686
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-22 08:00:56 +00:00
Ander Conselvan de Oliveira
eeff390598 kms_plane: Add test that suspends/resumes before getting crc
This adds a test that does a suspend/resume cycle between configuring
a plane and getting the crc value for the pipe. The intention is to
test if the user requested stated is restored properly, instead of
being clobbered by the state read out from the hardware.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-20 11:36:10 +01:00
Chris Wilson
a29f28eba9 igt/drv_module_reload: Check more carefully for a live driver
As drm_open_any() now quietly fails if there is no driver, this
nullifies the effectiviness of using gem_exec_nop as the test for a good
reload. Combine with gem_alive (and guarantee that gem_alive can detect
a dead driver, putting lie to

commit 032f30cb38bb03562ee7fde19cd278b1d8ac31a9
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Tue Jan 13 13:33:57 2015 +0000

    lib: remove unnecessary checks on the drm_open_any return value

) first.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-19 09:47:03 +00:00
Thomas Wood
032f30cb38 lib: remove unnecessary checks on the drm_open_any return value
drm_open_any always returns a valid file descriptor, so there is no need
to check the return value.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-15 12:23:04 +00:00
Chris Wilson
a263cc8795 igt/gem_tiled_swapping: Cycle through the bo a couple of times
In order to exercise coherency across swapin/swapout of the same bo,
explicitly loop over all bo a couple of times.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15 09:41:03 +00:00
Chris Wilson
d3bf83af03 igt/gem_mmap_wc/set-cache-level: Exercise set-cache-level WARNing
With the introduction of mmap(wc) and its unbound GTT write domain, we
can now hit the warning inside set-cache-level, complaining about the
failure to do correct cpu cache tracking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15 08:52:00 +00:00
Chris Wilson
3ea7a28072 igt/gem_exec_big: Don't try to repeatedly munmap(NULL)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-14 14:34:16 +00:00
Chris Wilson
3214a27b5b igt/gem_mmap_wc: Reorder gem_close()
Unlike a GTT mmap, a WC mmap does not have a direct reference to the
object, only to the backing storage. If we want to control the domain
correctly for mmap(wc), we have to keep the bo reference around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88356
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13 09:18:52 +00:00
Chris Wilson
cdbc514b41 igt/gem_exec_big: Use mmap(wc) to speed up verification
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-12 12:59:20 +00:00
Chris Wilson
b65903b7db igt/gem_exec_big: Also test a large batch with a large number of relocs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-12 12:59:20 +00:00
Chris Wilson
1dddf32df9 igt/gem_exec_big: Increase stress
We should be able to execute batches up to the full GTT size (give or
take fragmentation), so let's try!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 12:24:40 +00:00
Chris Wilson
a315476a6b igt/gem_evict_(alignment|everything): contend with GPU hangs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Chris Wilson
ce79b7aa80 igt/gem_reloc_vs_hang: Inject hangs!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Chris Wilson
5ae9ecaf55 igt/gem_pread_after_blit: Inject hangs!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Chris Wilson
16bafdf5bf igt/gem_concurrent_blit: Inject hangs before verifying contents
After setting up the copy operations, add a hanging batch. This should
mean that we complete the copy and the compare then races against the
GEM reset. Hopefully, this will catch driver bugs where the target
object is no longer accessible after the hang.

Note: hang injection is disabled until the required kernel interface is
completed. But there are useful additional tests here...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Chris Wilson
25cf0551c7 igt/gem_ctx_thrash: Tweak resource limits
On some systems (ok, most systems!) we may need to enlarge the allowed
number of open files in order to create enough fd to fill the aperture.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87572
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 10:07:31 +00:00
Alan Coopersmith
33d52a8543 Skip MADV_DOFORK & MADV_DONTFORK calls on OS'es that don't support them
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Alan Coopersmith
99e6defbe7 Use pthread calls instead of raw syscalls on non-Linux systems
Raw system calls aren't portable to other kernels.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Alan Coopersmith
cf93bc8df9 Solaris needs to #include <sys/kd.h> instead of <linux/kd.h>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Akash Goel
f3e1a3d9f8 igt/gem_mmap_wc: Add the invalid flags subtest
A new subtest added to validate the new version of gem_mmap ioctl,
for creating the wc mappings, on yet to be supported flags.

v2: Removed the flags checking for older kernels (Daniel)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Chris Wilson
f2a045f851 igt/gem_concurrent_blit: Exercise wc mappings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Chris Wilson
d95736906d igt/gem_fence_upload: Add comparison against wc mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Chris Wilson
58865891ba igt/gem_gtt_speed: compare against WC mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Chris Wilson
e70c789909 igt/gem_tiled_wc: Exercise wc mmaps with swizzling
This exercises both the wc mmappings and the extended get_tiling ioctl.
Userspace cannot handle bit17 swizzling through wc mmaps (because bit17
requires swizzling based on the actual physical address of the page -
which is unknown to userspace) and so we need an extended get_tiling
ioctl to report the actual as well as the logical swizzling on an
object. We then check that the contents of the object are tiled and
swizzled correctly when viewed through a wc mmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Chris Wilson
a464fb758e igt/gem_mmap_wc: Exercise mmap(wc) interface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Chris Wilson
c537cdb08e igt/gem_ctx_thrash/threads: Allow bo resuse
We already allocate enough objects to thrash the ppGTT VMs, so allow us
to reuse the batch buffers for some efficiency gains and through the
contention more towards the ctx->vm.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-18 16:22:59 +00:00
Chris Wilson
4bde754349 igt/gem_ctx_thread/processes: Serialise after forking children
Play nice, especially with the subtest, and wait for the children to
exit before finishing the test. If we don't we end up with a fork bomb
for some unknown reason...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-18 16:22:59 +00:00
Chris Wilson
9f389d00cf igt/gem_ctx_thrash: Boost workloads
Now that we are no longer busy-spinning inside random(), we can spend
more time exercising i915.ko

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-18 11:49:11 +00:00
Chris Wilson
959a7db668 igt: Add gem_ctx_thrash to fill the GGTT with contexts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-17 11:32:15 +00:00
Daniel Vetter
739790d7ed tests/gem_exec_blt: Add subtest that uses dumb buffers
Just to make sure this keeps working since a patch to WARN_ON using
dumb buffers in execbuf was accidentally merged.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-12-17 09:05:10 +01:00
Tim Gore
a11117e42f Android.mk: replace std=c99 with std=gnu99
The android makefiles were passing the -std=c99 flag to the
compiler which disables the typeof keyword. This causes a
build fail for a recent addition to igt_aux.h.
Change this to -std=gnu99, which is the flag used in the
linux build

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-12 12:18:22 +00:00
Thomas Wood
42b02c284e lib: add a function to lock memory into RAM
Add a function to lock memory into RAM and use it in the
gem_tiled_swapping test to reduce the amount of allocated memory
required to force swapping. This also reduces the amount of time
required for the test to complete, since the data set is smaller.

The following durations were recorded with gem_tiled_swapping on a
haswell system before the change:

  Subtest non-threaded: SUCCESS (55.889s)
  Subtest threaded: SUCCESS (810.532s)

and after:

  Subtest non-threaded: SUCCESS (11.804s)
  Subtest threaded: SUCCESS (268.336s)

v2: add various assertions and requirements and make sure
    gem_tiled_swapping works on systems with less RAM (Daniel Vetter)

v3: fix allocation size calculation

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-11 17:57:03 +00:00
Thomas Wood
85b74d5c14 tests/gem_tiled_swapping: use igt_info logging wrapper
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-11 11:50:22 +00:00
Thomas Wood
16f1506ff6 tests: replace 3D test images
Use images with a smaller file size, created by saving the left and
right stereo output of glxgears.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-10 17:11:35 +00:00
Ville Syrjälä
5d46f68eab tests/kms_cursor_crc: Restore the valid pipe/connector combo check
The valid pipe/connector combo check was lost in
 commit 57259d714d3fe1170cf931af72648219856a9918
 Author: Daniel Vetter <daniel.vetter@ffwll.ch>
 Date:   Mon Nov 24 16:08:32 2014 +0100

    lib/igt_debugfs: Don't setup crc in _new

Restore it to make the test again useful on CHV.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-09 22:35:36 +02:00
Ville Syrjälä
b6f68c10b4 tests/kms_mmio_vs_cs_flip: Count valid tests for all crtcs
Report SKIP only if none of the pipe/connector combos worked, instead of
trying to report for each pipe separately.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-09 20:41:18 +02:00
Damien Lespiau
01153e7d5f drv_hangman: Remove unused function
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-12-09 17:10:42 +00:00
Damien Lespiau
d49ef76e98 kms_cursor_crc: Remove value to 'return' in a void function
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-12-09 17:07:22 +00:00
Ville Syrjälä
f333981e1a tests/kms_flip: Target the back buffer with the dummy load
Aim the dummy load to the current back buffer instead if the front
buffer. Assuming the idea is to get the next flip to be stuck behind
the dummy load?

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08 19:26:39 +02:00
Ville Syrjälä
092682a3e5 tests/kms_flip: Calibrate the dummy load delay in kms_flip
Try to tune the dummy load to ~1 second. The calibration happens the
first time dummy load is generated.

v2: Actually do the number of ops intended and
    calibrate to 1 second and not 2

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08 19:26:39 +02:00
Ville Syrjälä
b0cb1e1f9d tests/kms_flip: Use fixed size (2kx2k) buffers for dummy load
Make the dummy load independent of the display resolution by using a
two fixed size dummy bos to generate the load. As a final step do
another copy from one of the dummy bos to the fb to make sure there's
a dependency between the dummy load and any subsequent operation on
the fb.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08 19:26:39 +02:00
Ville Syrjälä
21db302c9b tests/kms_flip: Refactor blit code
Pull the code to emit a single blit to a separate function.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08 19:26:39 +02:00
Ville Syrjälä
8032f526ef tests: Run lib/igt.cocci
Found some open coded min()/max()/swap() macros.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08 19:26:39 +02:00
Imre Deak
b32b5327a2 tests/pm_rps: vlv: round middle point to freq supported by HW
When setting the calculated middle frequency value the test assumes that
the HW/kernel rounds this value according to a 50MHz step value. This is
not so at least on VLV/CHV, on my B0 BYT-M for example this step value
is 22MHz, so there the test will fail.

To fix this get the nearest supported value by setting the target
frequency as a min or max frequency and read it back. The kernel will
round the returned value to the nearest supported.

v2:
- remove the 50MHz rounding that was done for non-VLV platforms, the new
  way of rounding should provide the correct value for all platforms
  (Ville)

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-12-08 12:36:59 +02:00
Imre Deak
f70afed4c7 tests/pm_rps: vlv: load gpu for idle min/max tests
When changing the sysfs GT min/max frequencies, the kernel won't
explicitly change the current frequency, unless it becomes out of bound
based on the new min/max values. The test happens to work on non-VLV
platforms because on those the kernel resets the current frequency
unconditionally (to adjust the RPS interrupt mask as a side-effect) and
that will lead to an RPS interrupt setting the minimum frequency.

To fix this load the GPU after decreasing the min frequency and before
checking the current frequency. This should set the current frequency to
the minimum.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-12-08 12:36:54 +02:00
Imre Deak
aabf2d0952 tests/pm_rps: vlv: wait for freq to settle
At least on VLV when forcing a new GT frequency by writing to the
min/max freq sysfs entries the kernel doesn't wait until the new
frequency settles, so the subsequent readback check might fail. To fix
this wait until the current frequency is between the min/max values
using a 10ms timeout.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-12-08 12:36:28 +02:00