3528 Commits

Author SHA1 Message Date
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
Mika Kuoppala
4f6a6cbdff lib: fix #define max
Regression from:

commit be4710a541b517b5f8663448bffed5656d59b47b
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Fri Oct 10 11:20:35 2014 +0100

    lib: add common min and max macros

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85218
Tested-by: Guo Jinxian <jinxianx.guo@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-23 12:48:05 +03: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
Paulo Zanoni
fc6d464a59 lib/igt_aux: make igt_wait_for_pm_status() resist the signal helper
If the signal helper is active, the usleep() calls return earlier, and
we may end up returning false way before the 10s timeout, failing the
subtests. This currently happens on the kms_flip RPM interruptible
subtests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78893
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-17 16:20:26 -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
48394471c5 configure: include the skylake quick_dump files in EXTRA_DIST
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:44 +01:00
Thomas Wood
d2595d7650 quick_dump: fix distcheck
Commit 711a17a (quick_dump: Move base_display.txt to indivual platforms)
renamed base_display.txt to common_display.txt, but didn't update
Makefile.am accordingly. Since common_display.txt is now included in the
platform files, it is automatically included in $(QUICK_DUMP_EXTRA_DIST)
and therefore just the reference to base_display.txt needs removing.

Cc: Damien Lespiau <damien.lespiau@intel.com>
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
Thomas Wood
d4e3b6a0f5 lib: various documentation fixes
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
Rodrigo Vivi
9c8ee51be2 Revert "tests/kms_psr_sink_crc: Wait 2 vblanks before grabing the new crc."
This reverts
     commit d190a1f9668680c7a429110c91f8faa27949b220.
     Author: Rodrigo Vivi <rodrigo.vivi@intel.com>
     Date:   Wed Sep 3 21:26:29 2014 -0400

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

Sink CRC is fixed on kernel to wait as many vblanks as needed. It was fixed by:
     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:14:32 -07:00
Mika Kuoppala
ca6b63f588 tools/null_state_gen: Add copyright notice to state output
along with info about what generated it.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-10 17:26:52 +03:00
Armin Reese
f246f1ed0c tools/null_state_gen: Add GEN9 golden context batch buffer creation
Modifications to 'null_state_gen' so it can generate GEN9
golden context batch buffer source for SKL.

v2: - rebased on top of gen8 changes (Mika)
    - fixed state base address command size (Mika)
    - base address size macro as pages (Mika)

v3: - rebased on top of current master (Mika)
    - removed obsolete #includes (Mika)
    - added copyright (Mika)
    - render and component packing added (Mika)

Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Armin Reese <armin.c.reese@intel.com>
Cc: Volkin, Bradley D <bradley.d.volkin@intel.com>
Reviewed-by: Volkin, Bradley D <bradley.d.volkin@intel.com> (v2)
Signed-off-by: Armin Reese <armin.c.reese@intel.com> (v1)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-10 17:26:27 +03:00
Mika Kuoppala
0e8ac72d5d tools/null_state_gen: Add Gen8 golden state
Previously we didn't have a clear understanding what is necessary
for a pipeline state to be properly initialized. So we had to improvise
and use a stripped out render copy.

Now we have a more clear understanding so switch out render copy based
frankenstate to state we can call golden state.

v2: - export intel_batch_state_offset
    - add 3DSTATE_RASTER (Bradley Volkin)

Cc: Volkin, Bradley D <bradley.d.volkin@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-09 19:47:51 +03:00
Mika Kuoppala
b69659c3f5 tools/null_state_gen: Add macro to emit commands with null state
In null/golden context there are multiple state commands where
the actual state is always zero. For more compact batch representation
add a macro which just emits command and the rest of the state as zero.

v2: - Be more verbose about length bias (Bradley Volkin)
    - strip out unrelated state_offset declaration (Bradley Volkin)

Cc: Volkin, Bradley D <bradley.d.volkin@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-09 19:47:47 +03:00
Mika Kuoppala
a1f847cba9 tools/null_state_gen: Limit the total state len to 4096 bytes
Currently our kernel side buffer object is only one page.
Limit the amount of dwords to 1024 to enforce this.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-09 19:15:11 +03:00
Mika Kuoppala
b498d81f15 tools/null_state_gen: Add more debug output
Be more verbose about the state size we generate.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-09 19:15:11 +03:00
Mika Kuoppala
c283ead78c tools/null_state_gen: Add copyrights
to files where they were missing.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-09 19:15:11 +03:00
Adam Sampson
b7d80d1047 Don't use += to append to a shell variable.
POSIX only requires "=" to be supported; "+=" works in bash but not in
dash.

Signed-off-by: Adam Sampson <ats@offog.org>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-09 11:01:13 +01:00
Adam Sampson
432a4b4881 Use = rather than == in test.
The POSIX standard only requires test to support "="; "==" works in bash
but not in dash. Other comparisons in configure.ac use "=" already.

Signed-off-by: Adam Sampson <ats@offog.org>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-09 11:01:13 +01:00
Chris Wilson
c7551bf7cc igt/kms_flip/nonblocking_read: Demonstrate that O_NONBLOCK is a myth
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-08 10:44:57 +01:00
Damien Lespiau
7041edfd14 quick_dump: Drop common_display.txt from VLV/CHV
Those registers are big core registers and weren't really relevant for
VLV/CHV. Drop them from the dump then.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-08 10:25:48 +01:00
Damien Lespiau
7f8228955f quick_dump/skl: Make quick_dump SKL aware
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-06 18:58:33 +01:00
Damien Lespiau
d0a412597b quick_dump/skl: Add some display registers
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-06 18:58:33 +01:00
Damien Lespiau
711a17ac75 quick_dump: Move base_display.txt to indivual platforms
SKL will have a whole separate display regs file, so merge
base_display.txt into each platform file.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-06 18:58:33 +01:00
Damien Lespiau
2faf5a8665 quick-dump: Make quick dump link against libintel_tools
Because quick-dump was only selecting a few files in lib/ and we move
stuff around and/or add new dependencies we were failing to provide the
necessary symbols to the shim library providing python bindings. And so
we had a run-time error:

Traceback (most recent call last):
  File "./tools/quick_dump/quick_dump.py", line 17, in <module>
    import chipset
  File "/home/damien/gfx/sources/intel-gpu-tools/tools/quick_dump/chipset.py", line 28, in <module>
    _chipset = swig_import_helper()
  File "/home/damien/gfx/sources/intel-gpu-tools/tools/quick_dump/chipset.py", line 24, in swig_import_helper
    _mod = imp.load_module('_chipset', fp, pathname, description)
  File "/usr/lib64/python3.3/imp.py", line 183, in load_module
    return load_dynamic(name, filename, file)
ImportError: /home/damien/gfx/sources/intel-gpu-tools/tools/quick_dump/_chipset.so: undefined symbol: kmstest_pipe_name

So, let's simplify maintainance and just link against the library we're
building and using elsewhere.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-06 18:58:11 +01:00
Damien Lespiau
d4c1bb7aab gem_wait: Use PRIu64 in format string
../../tests/gem_wait.c: In function ‘render_timeout’:
../../tests/gem_wait.c:182:3: warning: format ‘%llu’ expects argument of type
‘long long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=]

   igt_info("Finished with %llu time remaining\n", timeout);

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-06 18:58:03 +01:00
Damien Lespiau
af79fce66d overlay: Fix compilation warning when not having xrandr
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-06 18:52:06 +01:00
Damien Lespiau
6b964c93f7 gem_seqno_wrap: Remove unused variable
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-10-06 18:51:37 +01:00
Daniel Vetter
5c0139c304 tests/gem_wait: Don't close drmfd in subtest
I didn't notice this on the machine I developed it since the original
wait testcase fails there. Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-06 08:32:49 +02:00
Tim Gore
764772c3c8 lib/Android.mk: add define of IGT_DATADIR for igt_fb.c
Since the igt_create_stereo_fb function moved into igt_fb.c
we need to add the definition of IGT_DATADIR in the Android
makefile in order to build the cairo dependent tests.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-02 16:39:36 +01:00
Daniel Vetter
4306538d1d tests: Sprinkle missing igt_exit() where needed.
Yay for breaking piles of tests.

This regression has been introduced with

commit 5782eca1e19e85a04ad402fa4094aa1b5f9c53ce
Author: Tim Gore <tim.gore@intel.com>
Date:   Wed Oct 1 13:25:20 2014 +0100

    lib/igt_core.c: disable lowmemorykiller during tests

Cc: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-02 11:34:55 +02:00
Tim Gore
5782eca1e1 lib/igt_core.c: disable lowmemorykiller during tests
Several IGT tests cycle through a lot of GEM memory and
when running these tests on Android they tend to get
killed by the lowmemorykiller. The lowmemorykiller really
is not usefull in this context and is just preventing the
test from doing its job. This commit adds a function to
disable the lowmemorykiller by writing "9999" to its
oom adj parameter, which means it will never "select"
any process to kill. The normal linux oom killer is still
there to protect the kernel.
The low memory killer is disabled during the common
init function and then re-enabled by the exit handler.
To make this work for single tests the exit handler is now
installed in the common init function also so that it is
invoked for all tests.
This is just a hack to get round the fact that the i915
driver uses the concept of purgeable memory which is not
understood by the lowmemorykiller. If this ever gets
fixed then this patch can be removed.

Signed-off-by: Tim Gore <tim.gore@intel.com>
[danvet: A bit of polish (coding style, static and rename
check_igt_exit to common_exit_handler, drop the is_disabled check
since we only call this once now).]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-01 14:44:30 +02:00
Daniel Vetter
20c8eba84c NEWS: Updates
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-01 12:12:43 +02:00