drm/i915/selftests: Skip live eviction tests when wedged
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / selftests / i915_gem_evict.c
index 2dc72a9..128ad1c 100644 (file)
@@ -490,7 +490,7 @@ int i915_gem_evict_mock_selftests(void)
        err = i915_subtests(tests, i915);
        mutex_unlock(&i915->drm.struct_mutex);
 
-       drm_dev_unref(&i915->drm);
+       drm_dev_put(&i915->drm);
        return err;
 }
 
@@ -500,5 +500,8 @@ int i915_gem_evict_live_selftests(struct drm_i915_private *i915)
                SUBTEST(igt_evict_contexts),
        };
 
+       if (i915_terminally_wedged(&i915->gpu_error))
+               return 0;
+
        return i915_subtests(tests, i915);
 }