4453 Commits

Author SHA1 Message Date
Tiago Vignatti
f1d37d3a84 prime_mmap_kms: show case dma-buf new API and processes restrictions
dma-buf new API consists of:

- mmap(dma_buf_fd, ...): the ability to map a dma-buf file-descriptor of a
graphics buffer to the userspace, and more importantly, to actually write on
the mapped pointer (which was not possible before). It’s worth noting that the
Direct Rendering Manager (DRM) and the hardware driver implementation are
fundamentally important to safely export the graphics handle to be mapped.

- ioctl(dma_buf_fd, DMA_BUF_IOCTL_SYNC, &args): cache coherency management in
cases where the CPU and GPU devices are being accessed through dma-buf at the
same time. Coherency markers, which forward directly to existing dma-buf
device drivers vfunc hooks, are exposed to the userspace through the
DMA_BUF_IOCTL_SYNC ioctl and have to be used before and after the mapped area
is accessed. This is fundamentally important in hardware architectures where
the graphics engine and the CPU cores don't share caches but also important in
other type of hardware where the memory hierarchy is (most of the time)
coherent. More details can be found in this patch set:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c11e391da2a8fe973c3c2398452000bed505851e

v2: use uint32_t for color type, increment the variable and add
--interactive-debug=paint
v3: use igt_display_commit() to mode set the crtc so the rectangle is shown
painted; also added Testcase description on the beginning of the file.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2016-05-05 19:19:46 -03:00
Chris Wilson
b4b2ac346c igt/gem_exec_flush: Halve the number of BAT tests, but double their runtime
On the CI machines, the coherency tests are flip-flopping on byt/bsw.
Undesirable as they should always fail (until we have a good w/a).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-04 16:45:07 +01:00
Chris Wilson
a263a043ec igt/gem_exec_flush: Also check flushing before the cmdparser
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-04 14:27:18 +01:00
Feceoru, Gabriel
8adb5a07f2 tests/kms_plane: Skip the test when configuration couldn't be applied
This could happen when the selected pipe cannot be used with the connected
port due do HW constrains.

v2: Apply review comment (Marius)

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86763
Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-04 13:23:55 +03:00
Feceoru, Gabriel
26bec97c21 lib/igt_kms: Add fail exit branch in do_display_commit()
On Cherryview PIPE_C can only be connected to PORT_D (bspec).
The driver properly reports the crtc_mask for the encoder, however the
mismatch between pipe and port is not reported back to the test.

Add support for detecting this case so the test can be skipped.

v2: Apply review comments (Marius)

Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-04 13:23:55 +03:00
Feceoru, Gabriel
11a2b0dc8a tests/kms_plane: Skip on no connected outputs
When no display is connected all kms_plane subtests pass although
no testing is done.

Change it by reporting the subtests as skipped.

Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-04 13:23:55 +03:00
Jani Nikula
786d584624 man: add .gitignore with defs.rst
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-04 11:26:17 +03:00
Chris Wilson
6102e2eca9 igt/gem_exec_flush: Give even batch write a unique value
One property lost in the expansion for various coherency checks was
ensuring that every time we overwrote the batch it had a unique value
(to ensure that the GPU was seeing the latest value).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-03 21:13:41 +01:00
Chris Wilson
7b7503fb6c igt/gem_exec_flush: Stress a few more synchronisation paths for execbuf
Look at handling of multiple batches within the buffer and avoiding as
much synchronisation as possible.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-03 17:05:09 +01:00
Robert Foss
ec83ef9167 kms_panel_fitting: Enable connectors with "scaling mode" property set.
Enable testing on all connectors that have the "scaling mode"
property set.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93012
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-03 18:27:34 +03:00
Robert Foss
2254aff17e kms_panel_fitting: Enabled test on non-Intel hardware.
Switched from DRIVER_INTEL to DRIVER_ANY to enable test
on all hardware.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-03 18:27:34 +03:00
Robert Foss
0fee72d810 kms_panel_fitting: Switched DRM format to a hardware agnostic alternative.
Changed the DRM format to LOCAL_DRM_FORMAT_MOD_NONE since it
is hardware agnostic.

Also fixed formatting/tabs.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-03 18:27:34 +03:00
Robert Foss
a9c0943fa2 kms_panel_fitting: Remove un-used variable.
ref_crc is never assigned or read, and can be safely
removed.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-03 18:27:34 +03:00
Robert Foss
e2e56a9039 kms_panel_fitting: Remove un-read variable pipe_crc.
pipe_crc in data_t is assigned an allocated memory space and
then later free'd. But it is never used for any comparisons.
It should therefore be safe to remove pipe_crc and the crc
requirement.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-03 18:27:34 +03:00
Robert Foss
761ac544e7 kms_panel_fitting: Remove un-read variable.
Remove devid from data_t since it is never read.
Also remove one assignment to devid.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-03 18:27:34 +03:00
Robert Foss
26afcfc002 kms_panel_fitting: skips if there's a non-eDP display connected. Fix it.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93012
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-03 18:27:34 +03:00
Jani Nikula
a1e38c52c6 tests/kms_sink_crc_basic: clean up assert_color and provide more details
We can simply sscanf the crc in one go. Also split up the igt asserts to
get better details about what went wrong.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-03 17:24:01 +03:00
Jani Nikula
18170d211c tests: limit pm_backlight actual brightness tolerance between 0 and max
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-03 17:20:06 +03:00
Jani Nikula
7afd94ed62 tests: add context param to pm_backlight tests
We'll be adding more context for the subtests than just the max
brightness.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-03 17:20:06 +03:00
Jani Nikula
77a76ba09a tests: use igt_assert_lte to verify pm_backlight test results
Gives out better diagnostics than just igt_asssert.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-03 17:20:06 +03:00
Chris Wilson
f201495575 lib: compute exitcode first
Before we print the exitcode to the debug/kmsg logs, we should inspect
what its final value will be. For example, in the case of running
multiple subtests which all happen to be skipped, igt_exitcode is 0, but
the final exit code will be 77.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2016-05-03 12:12:37 +01:00
Chris Wilson
9f2621e1b5 igt/gem_exec_flush: Test continuously rewriting the batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-03 09:27:22 +01:00
Chris Wilson
d654aa0d09 igt/gem_ringfill: Avoid CPU -> GTT -> CPU transition
Avoid the second pair of full clflushes when setting up the batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-03 09:27:22 +01:00
Jani Nikula
3edaa1d347 tools/intel_reg_decode: drop confusing use of IS_965()
Unlike in the kernel driver coding style, IS_965() matches the platform
and all subsequent ones. Replace IS_965() with suitable but less
confusing alternatives.

Most occurences are on code paths that only get called for gens 2, 3 and
4, so replace those with IS_GEN4(). In the one other call site just flip
the condition to check for gens 2 and 3 instead.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-03 11:19:32 +03:00
Jani Nikula
c038518438 lib/intel_chipset: drop unused IS_9XX()
It's also confusing as the style differs from the kernel (exact platform
in the kernel vs. the platform and any later ones in igt).

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-03 11:19:32 +03:00
Rodrigo Vivi
e279954f1e tools: Add missing Kabylake codename strings.
No functional change and no change in the current format.
Just introducing the missing Kabylake name strings.

v2: Duh! forgot the ")"...

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2016-05-02 16:48:10 -07:00
Chris Wilson
d9025d3298 igt/gem_exec_flush: Match gem_set_domain to pointer access
When using the kernel set-domain cache management, we need to set the
domain as appropriate for our pointer access. In this case we access the
buffer through a CPU mmap, and so we must request access via the CPU
domain.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 18:57:03 +01:00
Chris Wilson
22e6157d38 igt/gem_exec_flush: Immediately repeat the same cacheline
When looking at a pair of GPU writes, where we want to make sure that
the clean cacheline is invalidated automatically, we want to reuse that
cacheline whilst we know it remains valid (i.e. repeat the test using a
new value to the same location).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 16:10:18 +01:00
Chris Wilson
cf07aa2fc6 lib: Fixup u64 multiply for computing nanoseconds
32bit builds ran into a silly multiplication issue when computing
elapsed nanoseconds of more than 2s...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 15:37:32 +01:00
Chris Wilson
6862b33d50 igt/gem_exec_flush: Move assertions out of interruptible loops
Since the value in the bo may be altered by the test, we only want to
repeat phases of the test to avoid breaking the test itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 14:58:00 +01:00
Chris Wilson
4782591873 lib: Tweak calibration of initial settimer delay
If we assume that the first settimer and clock_gettime() itself have
appreciable overhead, try to exclude those from the calibration delay.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 14:58:00 +01:00
Ville Syrjälä
92a9588841 tools/intel_watermark: Dump linetime watermarks on hsw/bdw
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-05-02 16:34:51 +03:00
Chris Wilson
7c70d2fca2 igt/gem_exec_flush: Mark mmap-wc dependency
Add a requirement for mmap-wc so that failure on older kernels is explained.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 13:23:33 +01:00
Chris Wilson
5715089c51 benchmarks/gem_latency: Report throughput
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 09:21:50 +01:00
Chris Wilson
691b76a84b igt/gem_exec_flush: Use a cacheline stride
Look at different cachelines on each pass, otherwise each group of 16
flush the same cachline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 09:21:50 +01:00
Chris Wilson
805a05caae igt/gem_exec_flush: Add interruptible testing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 09:21:50 +01:00
Chris Wilson
16c9edb464 igt/gem_exec_flush: Add basic set-domain checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02 09:21:50 +01:00
Chris Wilson
f3532cab97 igt/gem_exec_flush: For good measure, check pread/pwrite
As a point of comparison, test the pread/pwrite interface as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-01 21:46:28 +01:00
Chris Wilson
7d08913aeb lib: Enable clflush for 32bit x86 builds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-01 16:40:16 +01:00
Chris Wilson
89f354e0a5 igt/gem_exec_flush: Use subtest groups to tidy requirement checking
We can make the requirement testing and reporting tidier by using
igt_subtest_group.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-01 15:58:24 +01:00
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