lib/drmtest: document interface groups with one-liners

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_suspend: exercise fence restore code

This exercise the bug fixed in

commit 94a335dba34ff47cad3d6d0c29b452d43a1be3c8
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Jul 17 14:51:28 2013 +0200

    drm/i915: correctly restore fences with objects attached

For fun I've also added a subtest for the inverse transition.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests: sort tests in Makefile.am and .gitignore

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
lib/drmtest: add gem_flink and gem_open

Requires us to rename a few things in the gem_flink test to avoid
variable shadowing.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests: add gem_flink_race

This exercises a race in the flink name descruction of the current drm
gem core. When racing a gem close with a gem open the open can sneak
in and cause the kernel to leak the flink name and its reference.

This results in leaked gem objects that won't get reaped even at drm
file close time. On my 2 core/4 threads snb machine this leaks on the
order of 1k objects per second.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_flink_race: kill debug printf

Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_flink_race: count leaked objects

And fail the test if the leak count is bigger than 0.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_flink_race: check for expected flink failure code

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Revert "tests/gem_flink_race: count leaked objects"

This reverts commit bd927662fcfb1443c5982fb04cc694f78e1c8d53.

It's bogus.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_flink_race: actually make it somewhat useful

- Enable subtest support.

- Add a check for the same flink name in the racing threads, which is
  an issue one of my recent patches actually fixes.

- Add the test I've actually wanted to write which races an flink
  against gem close (with no open in between). That one does indeed
  leak.

- Readd the leak check, but note that this needs a fixed kernel.
  Otherwise the leak counter will be utter garbage.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_flink_race: fix up scanf format

Oops, failed to git add.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_flink_race: correct thread count

They all race against each another, no worker-slave relationship
like in the other subtest.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/sysfs_edid_timing: use real bash

The lib/drm_lib.sh load path trick doesn't work otherwise. Tsk.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
lib/intel_mmio: Fix the fixed fix (register access)

When I moved code around here:
commit 57bc7631e161a7bdcf7f68e1a46049dcb49c2256
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu May 23 11:09:55 2013 -0700

    lib/intel_mmio: Fix the fix

I accidently dropped the intel_gen() for the PCI id.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67289
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
intel_batchbuffer: add support for non-32bit blt copies

Needed by an upcoming patch fixing kms_render's blits for fbs that have
other than 32bpp formats.

Based on the corresponding SNA function.

v2:
- fix random ordering of src, dst parameters (Chris)
- pass pitch in bytes rather than pixels (Chris)

Signed-off-by: Imre Deak <imre.deak@intel.com>
lib: export drm_format_to_bpp

Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak@intel.com>
kms_render: fix gpu-blit for non-32bit bpps

intel_copy_bo assumes a 32bpp bo, whereas we passed it bos with
arbitrary bpp values. This resulted in thrashing GPU memory following the
destination bo.

Fix this by using a blit helper that can handle other bpps too.

Signed-off-by: Imre Deak <imre.deak@intel.com>
lib: export kmstest_get_connector_default_mode

Signed-off-by: Imre Deak <imre.deak@intel.com>
lib: shorten DP/eDP connector names

Signed-off-by: Imre Deak <imre.deak@intel.com>
lib: handle SIGSEGV too

Signed-off-by: Imre Deak <imre.deak@intel.com>