diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-08 14:53:12 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-08 16:58:02 +0300 |
commit | 4cdf65ce8cc28e72089605250b887ab70e10f750 (patch) | |
tree | 25dd3ee0843a49bdfb897414371b549b237d8d48 /drivers | |
parent | aaefa06a0ea845a7088585ca42259515769ea496 (diff) | |
download | linux-4cdf65ce8cc28e72089605250b887ab70e10f750.tar.xz |
drm/i915/selftests: Return to kernel context after each test
As we flush each test and wait for idle before the next, also switch
back to the kernel context. This helps limit the amount of collateral
damage a test may cause by resetting to the default state each time (and
also helps clean up temporaries used by the test).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180508115312.12628-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/selftests/igt_flush_test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/selftests/igt_flush_test.c b/drivers/gpu/drm/i915/selftests/igt_flush_test.c index abff2f04ea84..7f35bddc2e95 100644 --- a/drivers/gpu/drm/i915/selftests/igt_flush_test.c +++ b/drivers/gpu/drm/i915/selftests/igt_flush_test.c @@ -57,6 +57,11 @@ int igt_flush_test(struct drm_i915_private *i915, unsigned int flags) cond_resched(); + if (i915_gem_switch_to_kernel_context(i915)) { + pr_err("Failed to switch back to kernel context; declaring wedged\n"); + i915_gem_set_wedged(i915); + } + wedge_on_timeout(&w, i915, HZ) i915_gem_wait_for_idle(i915, flags); |