8 Commits

Author SHA1 Message Date
Daniele Ceraolo Spurio
03c7f84eb1 lib: move i915_wedged_set to ig_gt.c
Upcoming tests will call it to recover from bad states caused by
hangcheck bugs.the function was renamed to igt_force_gpu_reset to have a
naming closer to other hang-related functions in the same file.

The value written to the debugfs has also been changed to -1; this makes
no differences with the current implementation but copes with upcoming
TDR changes (still under discussion) that should allow the resetting of
a mask of rings.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-03-01 16:57:00 +02:00
Chris Wilson
e3b68bb666 lib: Share common __gem_execbuf()
An oft-repeated function to check EXECBUFFER2 for a particular fail
condition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 14:45:18 +00:00
Chris Wilson
92caf138f2 tests: Drop the superfluous igt_require_hang_ring()
As the hang injection now itself checks for validity before use, the
tests don't need to do so themselves. Except in certain situations! If
the test forks, it should do requirement checks before the fork (so that
we don't anger the igt gods) and if the test plays around i915.reset
then it needs to do an early igt_require_hang_ring() that is not
affected by the changes to i915.reset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-20 13:13:57 +00:00
Daniel Vetter
40798efd85 tests/gem_eio: New ABI - no EIO even from wait_ioctl
So there's 3 competing proposals for what wait_ioctl should do wrt
-EIO:

- return -EIO when the gpu is wedged. Not terribly useful for
  userspace since it might race with a hang and then there's no
  guarantee that a subsequent execbuf won't end up in an -EIO.
  Terminally wedge really can only be reliably signalled at execbuf
  time, and userspace needs to cope with that (or decide not to
  bother).

- EIO for any obj that suffered from a reset. This means big internal
  reorginazation in the kernel since currently we track reset stats
  per-ctx and not on the obj. That's also what arb robustness wants.
  We could do this, but this feels like new ABI territory with the
  usual userspace requirements and high hurdles.

- No -EIO at all. Consistent with set_domain_ioctl and simplest to
  implement. Which is what this patch does.

We can always opt to change this later on if there's a real need.

To make the test really exercise this do a full wedged gpu hang, to
make sure -EIO doesn't leak out at all.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-16 13:46:47 +00:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
Apply the new API to all call sites within the test suite using the following
semantic patch:

// Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls
@@
identifier i =~ "\bdrm_open_any\b";
@@
- i()
+ drm_open_driver(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_master\b";
@@
- i()
+ drm_open_driver_master(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_render\b";
@@
- i()
+ drm_open_driver_render(DRIVER_INTEL)

@@
identifier i =~ "\b__drm_open_any\b";
@@
- i()
+ __drm_open_driver(DRIVER_INTEL)

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Thomas Wood
804e11f40d lib: add a single include header
Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21 09:37:10 +01:00
Chris Wilson
32c898849b igt/gem_eio: Waiting on a hung batch should report -EIO
If we are waiting on a handle, and its request is cancelled due to a
hang, we should report that explicitly through the ABI.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-15 22:09:54 +01:00
Chris Wilson
eb7d60e430 igt: Add gem_eio for inducing expected EIO
A few entry points in the GEM API are expected to raise EIO if we
encounter a wedged GPU. This testcase aims to do so by first injecting a
GPU hang with GPU resets disabled (thus causing the GPU to become wedged)
and then exercises the various API to check for the expected errors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-19 11:44:26 +01:00