1959 Commits

Author SHA1 Message Date
Daniel Vetter
6ee3337b28 tests/gem_exec_parse: Go OCD about C-style comments
Cc: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-12 13:43:04 +01:00
Brad Volkin
bf31ed80e0 tests/gem_madvise: set execbuf.batch_len before doing an execbuf
The command parser's batch_len optimization causes the parser to
reject this batch as not having an MI_BATCH_BUFFER_END because
the length was not set correctly.

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-11-12 13:43:04 +01:00
Brad Volkin
c1fdc2f0e9 tests/gem_exec_parse: fix batch_len setting for cmd-crossing-page
The size of the batch buffer passed to the kernel is significantly
larger than the size of the batch buffer passed to the function. A
proposed optimization as part of the batch copy kernel series is to
use batch_len for the copy and parse operations, which leads to a
false "batch without MI_BATCH_BUFFER_END" failure for this test.

To fix this, modify the test to set batch_start_offset and batch_len
such that they define the range of actual commands in the batch,
including a few of the surrounding nops for alignment purposes.

v2: update batch_start_offset as well

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-11-12 13:43:04 +01:00
Thomas Wood
10aacc7334 tests: ensure the script based tests are included in the distribution
TESTS_scripts was accidentally removed from EXTRA_DIST in commit 685e577
(Move library selftests to lib/tests).

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-12 10:39:41 +00:00
Mika Kuoppala
50d539efeb tests/gem_reset_stats: add defer-hangcheck test
to see if one can fool hangcheck by keeping non hanging
ring busy

v2: break from loop instead of return (Daniel Vetter)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-11-11 17:38:46 +02:00
Thomas Wood
c049c39f35 tests: use igt_debugfs where possible
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 13:25:03 +00:00
Thomas Wood
4f689d52e7 tests/drm_lib.sh: add a "--help-description" option
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 13:24:30 +00:00
Thomas Wood
895204fc62 testdisplay: add a test description
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 13:24:30 +00:00
Thomas Wood
3d0dca47c6 docs: add some test descriptions
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 13:24:29 +00:00
Thomas Wood
ce0d34d73d testdiplay: add a "--help" option
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 11:41:34 +00:00
Thomas Wood
db425d69f6 testdisplay: ensure invalid long option exit status is non-zero
The optopt variable is not set if an invalid long option is used, so
check the current option character instead.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 11:41:34 +00:00
Brad Volkin
e34240d4c1 tests/drv_hangman: skip a few asserts when using the cmd parser
This test has a few checks that batch buffer addresses in the error
state match the expected  address for the userspace supplied batch.
But the batch buffer copy piece of the command  parser means that
the logged addresses are actually _supposed_ to be different. So
skip just those checks.

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-11-05 13:35:29 +01:00
Chris Wilson
a973aabed0 tests: Remove spurious binaries from gem_tiled_wb commit
commit c45216b26d223ffd7f68c5794870214445a64b5c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Nov 4 07:30:57 2014 +0000

    igt/gem_tiled_wb: Exercise CPU mmaps with swizzling

brought along a few interlopers.
2014-11-04 16:34:40 +00:00
Daniel Vetter
83757d7b39 tests/prime_nv_test: Skip cpu mmap testcase
It's not implemented yet, so no point in running the test really.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68638
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-04 17:25:33 +01:00
Chris Wilson
fbc6730238 igt/gem_tiled_wb: Remove extraneous mmap(wc) requirement
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-04 12:13:37 +00:00
Chris Wilson
c45216b26d igt/gem_tiled_wb: Exercise CPU mmaps with swizzling
This exercises the the extended get_tiling ioctl in order to determine
proper swizzling for direct access to objects through WB.
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.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-04 12:09:26 +00:00
Chris Wilson
6fff1f8787 ioctl_wrappers: Pass in offset to CPU mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-04 12:08:50 +00:00
Chris Wilson
676ccf862c igt/gem_linear_blits: Add sufficient RAM check
References: https://bugs.freedesktop.org/show_bug.cgi?id=85834
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-04 07:42:14 +00:00
Thomas Wood
b78d142a15 build: fix distcheck
Fix distcheck issues introduced by commit 685e577 (Move library
selftests to lib/tests).

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-29 17:26:34 +00:00
Daniel Vetter
b6715d9aa7 tests: Reenable testdisplay
This seems to have been accidentally disabled in

commit 982f7eb238a0898c456e0574dee7c4507738d75f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Aug 29 15:19:57 2014 +0100

    Prepare for 64bit relocation addresses

Apparently no one noticed.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-29 13:33:30 +01:00
Daniel Vetter
97f3391255 tests/testdisplay: Fix test status check fumble
This is a regression from

4306538d1d3f60877866c39c9ca953cc5e541dae is the first bad commit
commit 4306538d1d3f60877866c39c9ca953cc5e541dae
Author:     Daniel Vetter <daniel.vetter@ffwll.ch>
AuthorDate: Thu Oct 2 11:18:20 2014 +0200
Commit:     Daniel Vetter <daniel.vetter@ffwll.ch>
CommitDate: Thu Oct 2 11:34:55 2014 +0200

    tests: Sprinkle missing igt_exit() where needed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85582
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-29 13:29:32 +01:00
Daniel Vetter
685e57736a Move library selftests to lib/tests
Again they're not really igt testcases so are in the way of
running spatch unconditionally. Move them someplace else.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-29 13:29:32 +01:00
Daniel Vetter
9d6a2cacf6 Move watermark code from tests to tools
They're now igt tests, and so if you blindly run lib/igt.cocci with
spatch on tests/*c they get mangled. Move them away, but still keep
them as noinst targets.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-29 13:29:32 +01:00
Paulo Zanoni
15972aa866 tests/pm_rpm: add system-suspend-{execbuf,modeset} subtests
We were having a problem where the system-suspend test was passing,
but then the next test - gem-execbuf-stress - was failing because of
bugs caused by the suspend subtest. So add a single test that emulates
the same problem, and another test that just sets a mode after resume.
This way, we should be reproducing the problem even if you don't run
the tests in the order they are defined.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-27 18:12:29 -02:00
Damien Lespiau
cba3088619 skl_ddb_allocation: Respect the minimum number of blocks
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-26 16:32:21 +00:00
Ville Syrjälä
7296e09ee7 tests/kms_flip: Make flip-vs-panning-vs-hang change DSPSURF
Make sure DSPSURF will change during the panning operation
in flip-vs-panning-vs-hang.

This will now test agains bugs between the kernel's mmio vs.
CS flip race handling and GPU resets. If the kernel is buggy
if will fail to notice that the panning operation changed the
base address before the GPU reset had a chance to deal with the
pending page flips, and so the flip would never complete due to
DSPSURFLIVE not matching the expected value.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-24 16:25:39 +02:00
Chris Wilson
e497600fb7 igt/gem_userptr_blits/dmabuf: Map the right pointer for !llc
References: https://bugs.freedesktop.org/show_bug.cgi?id=85354#c2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-24 07:40:44 +01:00
Mika Kuoppala
eae9f724f2 tests/gem_workarounds: adapt to constant wa list from driver
Driver now returns the constant values that were set once
on ring initialization time. Extend the simple interface
check to all gens (i915_wa_registers needs to be present).
Due to delay when render context is visible on cpu side,
wait gpu to execute something on default context to get rid
of undeterministic behaviour by sometimes getting all ones.

Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-23 20:41:18 +03:00
Daniel Vetter
8b556f7c8f tests/*: lib/igt.cocci found something!
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-23 17:54:44 +02:00
Sonika Jindal
47246981b2 kms_rotation_crc: Add test for cursor rotation (v2)
v2: Slight rebasing onto latest i-g-t codebase (Matt).

Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-23 17:51:47 +02:00
Chris Wilson
18cb650318 igt/gem_userptr_blits/dmabuf: Provide partial coverage on !llc platforms
Without LLC, we cannot assume coherency between system RAM and the GTT.
If we try to use the GTT with snooped memory, the machine may lock up,
so the kernel prevents us from doing so, causing the test to fail.
However, we still do want to verify that we can access the userptr
through a dmabuf, so just check that we can make a copy from it using
the GPU and ignore the GTT cross-checking.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85354
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-23 08:03:48 +01:00
Paulo Zanoni
ac2079596c lib/igt_aux: move audio RPM code to igt_setup_runtime_pm()
If we don't enable audio runtime PM, the audio driver won't release
its reference, the refcount won't ever become zero, so we will never
actually runtime suspend. So move this code from pm_rpm.c to
igt_aux.c, so kms_flip - and any other IGT test case using RPM - can
benefit from it.

Previously, if you ran pm_rpm before running the other tests - or if
you just didn't have snd_hda_intel loaded - you wouldn't notice this
bug.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78893
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-22 16:23:42 -02:00
Brad Volkin
a06071c0cf tests/gem_exec_parse: test for chained batch buffers
libva makes extensive use of chained batch buffers. The batch
buffer copy portion of the command parser has the potential to
break chained batches, so add a simple test to make sure that
doesn't happen.

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-21 17:27:36 +02:00
Paulo Zanoni
bba1cd0091 tests/kms_cursor_crc: HSW/BDW only have square cursors
When I look at cursor_size_ok() (from the Kernel's intel_display.c), I
see that only 845g and i865g support non-square cursors, so SKIP the
tests on HSW/BDW instead of failing them.

This problem happened because support for non-square cursors was being
developed for HSW/BDW, but it ended up not being merged due to a small
problem and priority changes. Let's make those tests SKIP until we
have proper support on the Kernel: after that, we can revert this
patch.

v2: Improve commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84268
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-17 19:00:50 -03:00
Thomas Wood
06de0e7f29 tests/kms_force_connector: fix assertion when VGA is already connected
Compare the number of modes available when the edid is reset with the
number before the edid was overridden.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82230
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:44 +01:00
Thomas Wood
1a0ae51f51 tests: add a check for command line handling
Check that command line handling works consistently across all tests.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:44 +01:00
Thomas Wood
d02ffe46bb drm_lib.sh: add standard command line options
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:44 +01:00
Thomas Wood
be4710a541 lib: add common min and max macros
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:43 +01:00
Damien Lespiau
303fe742fc skl_ddb_allocation: Make 'end' exclusive in the DDB allocation entry
Ville suggested that we should use the same semantics as C arrays to
reduce the number of those pesky +1/-1 in the allocation code.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-15 22:49:24 +01:00
Damien Lespiau
f951943055 skl_ddb_allocation: Add checks on the DDB entries
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-15 22:49:24 +01:00
Damien Lespiau
69a465d22a skl_ddb_allocation: Add a standalone version of the DDB allocator
This is useful to debug the allocation algorithm.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-15 22:49:24 +01:00
Thomas Wood
e11b7100c9 tests/kms_force_connect: skip if a VGA connector is not available
v2: rename "connector" to "vga_connector" to improve the skip message
    (Chris Wilson)

Suggested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-15 11:01:37 +01:00
Thomas Wood
5209ec142d tests/kms_force_connector: ensure igt_exit is called at exit
Since commit 5782eca (lib/igt_core.c: disable lowmemorykiller during
tests), igt_exit needs to be called before the test exits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84771
Cc: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-15 11:01:37 +01:00
Rodrigo Vivi
5c7d54eae5 tests/pm_rc6_residency: Split RC6p and RC6pp.
sysfs interface for rc6 has been changed to only expose deep RC6 file to the platorms
that really support them, aka SNB and IVB.

So let's split this test and only test RC6p and RC6pp on these platforms.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=84886
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-10-14 10:22:21 -07:00
Paulo Zanoni
e7abb63516 tests/pm_rpm: use igt_assert_eq() on COMPARE()
A few weeks ago we were hitting this assertion, and the _eq macro is
more useful when you're debugging.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-14 15:18:07 -03:00
Paulo Zanoni
97715d5f0f tests/pm_rpm: fix some compilation warnings
warning: ignoring return value of ‘write’, declared with attribute
 warn_unused_result [-Wunused-result]

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-14 15:17:49 -03:00
Paulo Zanoni
7308e3a92b tests/pm_rpm: reduce the number of rounds on the stress tests
With the current Kernel, it takes more than 10 minutes to run
modeset-stress-extra-wait on BYT with eDP, and we don't really want
IGT subtests that take more than 10 minutes to run: QA reports them as
bugs.

Since, as far as I remember, any of these RPM race condition bugs we
had could always be triggered with just 4-5 rounds of testing, let's
tune down the number of rounds we test:

Before:
	rounds = (--quick option used) ? 10 : 50;

After:
	rounds = (--quick option used) ? 10 : 40;
	rounds = (wait_flags & WAIT_EXTRA) ? rounds / 2 : rounds;

This should make all subtests be way above the 10m limit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84897
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-14 15:17:32 -03:00
Chris Wilson
8aa7fdaee8 igt/gem_bad_reloc: Handle real offset being 0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-14 10:13:05 +01:00
Chris Wilson
cd5ed45296 igt/gem_negative_reloc: Execute a BLT operation with a negative reloc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-14 10:07:37 +01:00
Rodrigo Vivi
a0b5c6d2ee Revert "tests/kms_sink_crc_basic: Wait 2 vblanks before grabing the new crc."
This reverts
     commit d92fbc23138b1014e8574daf29dbb06b8c81aa7a.
     Author: Rodrigo Vivi <rodrigo.vivi@intel.com>
     Date:   Tue Sep 9 12:25:47 2014 -0400

         tests/kms_sink_crc_basic: Wait 2 vblanks before grabing the new crc.

Sink CRC is fixed on kernel to wait as many vblanks as needed. It was fixed b
     commit ad9dc91b6e21266bfc6f466db4b95e10211f31ee
     Author: Rodrigo Vivi <rodrigo.vivi@gmail.com>
     Date:   Tue Sep 16 19:18:12 2014 -0400

         drm/i915: Fix Sink CRC

This this fix in place we don't need this extra 2 vblanks on test case itself

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-10-10 08:18:28 -07:00