3903 Commits

Author SHA1 Message Date
Chris Wilson
e10ba6b51c igt/drm_read: Clear O_NONBLOCK between tests
Ensure that O_NONBLOCK isn't accidentally set when we want a nonblocking
file descroptor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-25 14:33:49 +00:00
Mika Kuoppala
32329b2e7d tests/drm_import_export: Always loop with mutex held
We assume that lock is held on start of the loop scope.
Some paths continuing inside loop didn't adhere to this
assumption, causing segfault on unlocking an already
unlocked mutex. Fix this by re-aquiring lock always.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93013
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2015-11-25 15:52:18 +02:00
Chris Wilson
3b1a55874d igt/drm_read: Check handling of pagefault on destination buffer
In theory, this should force i915_gem_fault() when we first use the
buffer (and not at mmap time) and so prevent a __copy_to_user_inatomic()
from writting to the buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-25 11:13:25 +00:00
Joonas Lahtinen
d84e62478b lib/igt_core: Prefer CLOCK_MONOTONIC_RAW
CLOCK_MONOTONIC_RAW is not affected by NTP, so it should be THE clock
used for timing execution of tests.

When fetching either the starting or ending time of a test, show the
time as -1.000s.

v6:
- Whitespace corrections (Chris)

v5:
- Do not use C99 style comments (Chris)

v4:
- Introduce time_valid macro (Chris)
- Reduce amount of boilerplate code for calculating elapsed time

v3:
- Do not exit directly from handler (Chris)
- Show elapsed time as -1 if it is not calculable

v2:
- Cache the used clock (Chris)
- Do not change the clock during execution
- Spit out and error if monotonic time can not be read

Cc: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-24 16:36:54 +00:00
Wayne Boyer
4bc68b1baa lib/kbl: Add Kabylake GT4 PCI IDs
Add the Kabylake GT4 PCI IDs as defined in this kernel patch.

    commit 8b10c0cf21ec84618d4bf02c73c0543500ece68d
    Author: Deepak S <deepak.s@intel.com>
    Date:   Wed Oct 28 12:21:12 2015 -0700
        drm/i915/kbl: Add Kabylake GT4 PCI ID

Signed-off-by: Wayne Boyer <wayne.boyer@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-24 16:36:54 +00:00
Wayne Boyer
526a63ec6b lib/kbl: move KBL check from IS_SKYLAKE() to IS_GEN9()
Remove the KBL check from IS_SKYLAKE() following the kernel definition.
Then, add the KBL check to IS_GEN9().

The idea is to avoid confusion.  On the kernel side, the mix of SKY
and KBL was nacked so the platforms are split.

Signed-off-by: Wayne Boyer <wayne.boyer@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-24 16:36:54 +00:00
Matt Turner
b088e30575 tools/aubdump: Link with -ldl.
aubdump.c uses dlsym(), so it needs to link with -ldl. Otherwise:

/bin/sh: symbol lookup error: /usr/lib64/intel_aubdump.so: undefined symbol: dlsym

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-24 16:36:54 +00:00
Tvrtko Ursulin
dcdf21beb8 igt/gem_request_retire: Provoke context destruction with active VMAs
Test designed to trigger the
WARN_ON(!list_empty(&ppgtt->base.active_list))
in i915_gem_context_clean.

v2:
Simplify execbuf building and the test itself. Cleanup code. (Chris Wilson)

v3:
Removed asserts done by the helpers already. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-24 12:58:17 +00:00
Chris Wilson
b68a6428db benchmarks: Add a set-domain benchmark
Benchmark the overhead of changing from GTT to CPU domains and vice
versa. Effectively this measures the cost of a clflush, and how well the
driver can avoid them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-22 20:54:04 +00:00
Chris Wilson
59f076a089 drmtest: Use standard gem_execbuf() calls in gem_quiescent_gpu()
Now that we have better ioctl wrappers, let's make us of them. The
advantage should be in improved error reporting in case
gem_quiescent_gpu() ever fails.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-20 11:25:00 +00:00
Mika Kuoppala
b718f50f92 lib: Add Skylake Intel Graphics GT4 PCI IDs
Add Skylake Intel Graphics GT4 PCI IDs.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
2015-11-19 11:31:51 +02:00
Chris Wilson
8a8717eee3 overlay: Show power consumption without i915-pmu
The power metter was not showing up due to an erroneous check for a
failure to open the i915 perf interface.

Reported-by: Marius Vlad <marius.c.vlad@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-18 12:53:04 +00:00
Vivek Kasireddy
938b9306be igt/kms_rotation_crc: Add a new subtest to exhaustively test for fence leaks (v3)
In this subtest, as a first step, MAX_FENCES+1 number of framebuffers are
created backed up by objects that have multiple GGTT views (normal and
rotated). Next, we have the i915 driver instantiate a normal view followed
by a rotated view. We continue doing the above MAX_FENCES + 1 times.

v2:
- Add a igt_require() to check if there is enough GTT space left for
  MAX_FENCES+1 framebuffers. (Tvrtko)
- Make data2 local to test_plane_rotation_exhaust_fences(). (Tvrtko)
- If there is a failure, deallocate all the previously allocated
  framebuffers before asserting.

v3: Close the gem handle if set_tiling or addfb fails. (Tvrtko)

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2015-11-17 14:34:51 +00:00
Ville Syrjälä
92a803ffb0 tests/kms_3d: Use XRGB8888 instead of ARGB8888
We don't allow ARGB8888 anymore on primary planes on most platforms,
so use XRGB8888 instead as the format.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:42:26 +02:00
Ville Syrjälä
cba86e980f tests/kms_3d: Use igt_assert_eq()
Would be nice to see how many stereo modes we managed to extract from
the EDID if it doesn't match the expected 13. So use igt_assert_eq()
which prints the real count on failure.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:42:22 +02:00
Ville Syrjälä
e42936d86b tests/kms_addfb_basic: Add clobbered-modifier subtest
Make sure the kernel doesn't clobber the modifiers when the user didn't
pass any.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
4d8983bcdf lib/kms: Pass fb_id=0 to setcrtc in kmstest_unset_all_crtcs()
The setcrtc ioctl ignores the fb_id when there's no mode specified.
So passing -1 doens't make much sense. When there is a more, -1 means
to preserve the current fb.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
29cd8a092e tests/kms_flip: Add a note that the test was skipped when modeset fails
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
a09880d1c3 tests/kms_flip: Modeset pipes in reverse order
To make more multi-pipe tests run on IVB, do the modesets in the reverse
order (ie. pipe C first, pipe A last). This way pipe B can't reserve the
2 shared FDI lanes before pipe C is set up.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
5bb87dc0e5 tests/kms_flip: Disable all pipes before each test
Currently kms_flip leaks the state of the pipes from one subtest to the
next. Meaning a single pipe test can actually have two or more pipes
actually up and running, and similarly a two pipe test can have three
pipes running.

This is particularly nasty on IVB since one of the pipes still running
but not actually part of the test maybe have reserved the shared FDI
lanes, thus preventing one of the pipes taking part in the test from
being enabled.

To avoid such problems explicitly disable all pipes before each
subtests.

v2: Use kmstest_unset_all_crtcs() (Paulo)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Ville Syrjälä
2f894820ac tests/kms_flip: Use human readable pipe and connector names
Print the pipes and connectors in a human readable form instead of using
the integer IDs.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16 15:35:28 +02:00
Derek Morton
c8beadb811 tests/gem_exec_nop: Improved test run time
Reduced the Sleep period to 200mS and reduced the repetition count to 7
to decrease the test run time significantly.

v2: Changed uS to us
v3: removed the output formatting change as the issue will be addressed
in a seperate patch from Thomas Wood.
v4: mS -> ms

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-13 14:08:54 +00:00
Maarten Lankhorst
464424dcee tests/kms_setmode: Handle MST correctly.
There is a MST encoder for each crtc, and each MST connector
will be connected to the encoder bound to that crtc.

This breaks the kms_setmode assertion that is only 1 encoder per
connector, so make an exception to that rule for displayport.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2015-11-12 13:33:42 +01:00
Chris Wilson
4c14aa18c1 benchmarks/gem_blt: Fixup a couple of non-llc foibles
When extending the batch for multiple copies, we need to remember to
flag it as being in the CPU write domain so that the new values get
flushed out to main memory before execution. We also have to be careful
not to specify NO_RELOC for the extended batch as the execobjects will
have been updated but we write the wrong presumed offsets. Subsequent
iterations will be correct and we can tell the kernel then to skip the
relocations entirely.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-12 10:54:11 +00:00
Chris Wilson
143a216058 igt/gem_mmap_gtt: Require SET_TILING to work before doing large tiled tests
Older generations are more limited in how much they can fence, and the
limits is enforced in the SET_TILING ioctl. So if it reports an EINVAL,
we cannot perform the tiled test and may just skip it instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-12 09:30:39 +00:00
Chris Wilson
0c26652911 igt/gem_concurrent_all: Add testcases that split the copying across rings
More inter-ring concurrency tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-11 17:27:22 +00:00
Thomas Wood
790f1f804b lib: add a environment variable to control output
Disable output of terminal control characters and progress meters when
IGT_PLAIN_OUTPUT is set in the environment.

Cc: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:52:47 +00:00
Thomas Wood
fca7b1b5fd lib: highlight subtest results on terminals
Make subtest results easier to identify by making them bold when the output
is a terminal.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:52:47 +00:00
Thomas Wood
3dce57a699 tests/kms_force_connector: reset connectors and edid on exit
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:52:44 +00:00
Thomas Wood
a8f6357430 tests/kms_force_connector: clear forced edid in reset
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:50:53 +00:00
Thomas Wood
5652985a54 tests/kms_force_connector: use comparison macros
Use the comparison macros to make debug output clearer.

v2: fix incorrect comparison

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:50:53 +00:00
Thomas Wood
d014339009 tests/kms_force_connector: add an option to reset connector force states
v2: add missing igt_exit call and fix reset_connectors definition

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:49:46 +00:00
Thomas Wood
01e1fca582 tests/kms_force_connector: skip if the required connector is connected
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:21:12 +00:00
Thomas Wood
2e5a43d296 lib: add documentation for igt_display_init/fini
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:21:12 +00:00
Thomas Wood
5570060d33 tests/kms_force_connector: free the display struct when no longer needed
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:21:12 +00:00
Thomas Wood
e9ed1a37fc tests/kms_fbc_crc: ensure context is initialized correctly
Initialization was included in commit a976d7e (tests/kms_fbc_crc:
refactor context handling code), but won't be executed since it is
declared before the first label within a switch statement.

kms_fbc_crc.c:178:2: warning: ‘context’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  rendercopy(batch, context,
  ^
kms_fbc_crc.c:271:22: note: ‘context’ was declared here
   drm_intel_context *context = NULL;

                      ^
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-11 14:20:56 +00:00
Thomas Wood
0986b432f8 lib: add PIPE_ANY to the pipe enum
This avoids compiler warnings about invalid enum values.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Thomas Wood
2643793255 Fix comparison of unsigned integers
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Thomas Wood
52a393a311 tests: remove duplicate struct member initializers
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Thomas Wood
24b7bbc726 tests: remove unnecessary igt_exit calls
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Thomas Wood
36b8143c22 Add missing noreturn attribute to various functions
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Chris Wilson
3bc3ab27ea benchmarks: Add README
Add a README to introduce the ezbench.sh benchmark runner.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-10 14:04:58 +00:00
Chris Wilson
5cabb8c543 benchmarks/gem_blt: Report peak throughput
Report the highest throughput measured from a large set of runs to
improve sensitivity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-10 14:04:58 +00:00
Chris Wilson
3b0e336081 lib: Add missing #include <stdbool.h>
A forgotten fixup to allow instdone.h to compile.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-09 20:37:52 +00:00
Chris Wilson
70ee508421 lib: Make instdone initialisation fail gracefully
Just report that we don't recognise the chipset rather than explode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-09 16:57:22 +00:00
Ben Widawsky
134e32378a igt/intel_aubdump: Use the right ring
This prevents the simulator from barfing when it sees commands from another
ring. I've been using this locally for a very long time.

Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2015-11-06 11:16:23 -08:00
Daniel Stone
bc37e0297c kms_atomic: Add basic atomic modesetting tests
Add tests for KMS atomic modesetting, to exercise the basic interface
and test failure/corner cases. Should ensure coherency between the
legacy and atomic interfaces.

v2: New patch.
v3: Disable connector checking for now, as it was causing GPU hangs on
    newer kernels.
v4: Rebase.
v5: Use do_ioctl or do_ioctl_err consistently. Use igt_assert_*()
    helper macros rather than igt_assert() directly.
    Move assertions into helper/check functions. Define atomic commit
    helper.
v6: Use do_ioctl_err, and define macros to move errors to
    actual callsite, rather than helper functions.

Co-authored-by: Micah Fedke <micah.fedke@collabora.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:12 +00:00
Daniel Stone
b7a555e997 tests/core_prop_blob: Add multiple blobs per connection
This should hit the bug fixed in:
    commit 8731b269f01e16193390c7276e70530366b8d626
    Author: Maneet Singh <mmaneetsingh@nvidia.com>
    Date:   Thu Oct 8 10:10:24 2015 -0400

        drm: Correct arguments to list_tail_add in create blob ioctl

        Arguments passed to list_add_tail were reversed resulting in deletion
        of old blob property everytime the new one is added.

        Fixes

        commit e2f5d2ea479b9b2619965d43db70939589afe43a
        Author: Daniel Stone <daniels@collabora.com>
        Date:   Fri May 22 13:34:51 2015 +0100

            drm/mode: Add user blob-creation ioctl

        Signed-off-by: Maneet Singh <mmaneetsingh@nvidia.com>
        [seanpaul tweaked commit subject a little]
        Signed-off-by: Sean Paul <seanpaul@chromium.org>
        Cc: stable@kernel.org # v4.2
        Reviewed-by: Daniel Stone <daniels@collabora.com>
        Reviewed-by: Jani Nikula <jani.nikula@intel.com>
        Signed-off-by: Dave Airlie <airlied@gmail.com>

which was introduced with the initial blob support in:
    commit e2f5d2ea479b9b2619965d43db70939589afe43a
    Author: Daniel Stone <daniels@collabora.com>
    Date:   Fri May 22 13:34:51 2015 +0100

        drm/mode: Add user blob-creation ioctl

        Add an ioctl which allows users to create blob properties from supplied
        data. Currently this only supports modes, creating a drm_display_mode from
        the userspace drm_mode_modeinfo.

        v2: Removed size/type checks.
            Rebased on new patches to allow error propagation from create_blob,
            as well as avoiding double-allocation.

        Signed-off-by: Daniel Stone <daniels@collabora.com>
        Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
        Tested-by: Sean Paul <seanpaul@chromium.org>
        Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:12 +00:00
Daniel Stone
de7ccdd083 tests: Run igt.cocci
Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:11 +00:00
Daniel Stone
f735015ed3 lib/tests: Add igt_assert_*() self-tests
Make sure our igt_assert variants are doing something that looks vaguely
like the right thing.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:11 +00:00