tests/pm_pc8: add missing newline

Otherwise the output will get even more confusing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
tests/pm_pc8: skip tests when no screens are connected

Instead of failing, just skip the tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73642
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
tools/intel_reg_dumper: use haswell_debug_regs on BDW too

Instead of using an older set of registers.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
intel-gpu-overlay: Update debugfs path for min/max frequency

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
gem_tiled_swapping: Purge all page/swap caches first

Reset the system to a vanilla state before we query how much RAM/swap
space is available for our testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
gem_tiled_swapping: Test using all available fences

Use extra threads to cause extra memory pressure and stress upon the
relevant code. Limit the number of threads to available fences to avoid
falling off the fence cliff.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
tests/gem_exec_parse: Test for OACONTROL tracking

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_reset_stats: end hanging batch properly

As we use chained batch into itself to hang the gpu, there
was no need to end the batchbuffer with BATCH_BUFFER_END.

With the introduction of command parser, the batch
need to have proper BATCH_BUFFER_END in it or it
will be rejected.

While at it, shift the upper half of batch gtt_offset
accordingly with gen8+

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
lib: add igt_get_stop_rings and igt_set_stop_rings

Multiple tests are introducing hangs by fidding with i915_ring_stop
debugfs entry.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
tests: use lib igt_[get|set]_stop_rings()

on gem_reset_stats, kms_flip and pm_rps.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75876
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
lib/drmtest: don't dup quiescent fd

If we dup the fd, we are in mercy of the context banning
of the test application. Better to have our own to guarantee
that gem_quiescent_gpu won't find itself banned on exit.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
tests/gem_reset_stats: check gpu state before each subtest

Some tests, namely the close pending variety, tries to
carefully drop all handles to gpu when hang is intruduced,
to expose bugs in reset handling without any clients.

Add guards after and before tests to really know if
the gpu is still alive as the particular test might
report success and then gpu dies few seconds after.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
tests/gem_reset_stats: fix length check in inject_hang

To avoid writing past the batch end.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
lib/kmstest: Fix up tiled buffer creation

When extracting a raw __gem_set_tiling helper I've fumbled this in

commit 590f6101402b51bca54f69c002380bda967484ea
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Oct 9 20:50:50 2013 +0200

    lib/drmtest: extract rawer __gem_set_tiling

Fix things up so that we properly propaget the error again.

Now to make this all properly work we also need to make kms_flip a
notch more robust against such failures ...

This only blows up on gen2/3 with the pan tests which want a too wide
framebuffer for tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
test: Add test for checking if page flip changes tiling

Test that a page flip from a tiled buffer to a linear one works
correctly. First, it sets the crtc with the linear buffer andr
generate a reference crc for the pipe. Then, the crtc is set with
the tiled one and page flip to the linear one issued. A new crc is
generated and compared to the rerence one.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
tests/kms_flip_tiling: Fixes

- Wrap up testcase correctly into the magic code block.
- Put local variables out of the longjmp danger zone.

Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests: Compile all the tests

A bunch of the tests aren't being built due to a missing '\'. Fix it.

The problem was introduced here:
 commit ddf8cc107e3b78e4c8200b083ed298c24eec1f03
 Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
 Date:   Wed Apr 2 15:31:38 2014 +0300

    test: Add test for checking if page flip changes tiling

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
lib: Fix assert failure in ring stop code

The assert in igt_set_stop_rings() is a bit bogus. Suppsoedly it was
meant to assure that the caller always restores the rings to running
state after stopping them. But in its current form it will trigger
any time someone calls the function and the rings were already stopped.
So you can't even restore the rings to running state w/o the assert
triggering.

Fix it up so that it'll ignore the current ring state when we're trying
to restore the rings back to running state.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
lib: Fix potential out of bounds access in ring stop code

The subsequet code expects the read() to not have filled the entire
buffer, and yet we allow it to do so. Reduce the size passed to read()
by 1 to make the code sane.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Add gem_render_copy_redux

This is an "advanced" form of the the simple gem_render_copy test.
Instead of aiming for maximal simplicity to aide debugging of new
rendercopy backends, this test aims to exercise the execbuf interface
using the render ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>