.. | .. |
---|
4 | 4 | * Copyright © 2018 Intel Corporation |
---|
5 | 5 | */ |
---|
6 | 6 | |
---|
7 | | -#include "../i915_drv.h" |
---|
| 7 | +#include "gt/intel_gt.h" |
---|
| 8 | +#include "gt/intel_gt_requests.h" |
---|
8 | 9 | |
---|
9 | | -#include "../i915_selftest.h" |
---|
| 10 | +#include "i915_drv.h" |
---|
| 11 | +#include "i915_selftest.h" |
---|
| 12 | + |
---|
10 | 13 | #include "igt_flush_test.h" |
---|
11 | 14 | |
---|
12 | | -int igt_flush_test(struct drm_i915_private *i915, unsigned int flags) |
---|
| 15 | +int igt_flush_test(struct drm_i915_private *i915) |
---|
13 | 16 | { |
---|
| 17 | + struct intel_gt *gt = &i915->gt; |
---|
| 18 | + int ret = intel_gt_is_wedged(gt) ? -EIO : 0; |
---|
| 19 | + |
---|
14 | 20 | cond_resched(); |
---|
15 | 21 | |
---|
16 | | - if (flags & I915_WAIT_LOCKED && |
---|
17 | | - i915_gem_switch_to_kernel_context(i915)) { |
---|
18 | | - pr_err("Failed to switch back to kernel context; declaring wedged\n"); |
---|
19 | | - i915_gem_set_wedged(i915); |
---|
20 | | - } |
---|
21 | | - |
---|
22 | | - if (i915_gem_wait_for_idle(i915, flags, HZ / 5) == -ETIME) { |
---|
| 22 | + if (intel_gt_wait_for_idle(gt, HZ / 5) == -ETIME) { |
---|
23 | 23 | pr_err("%pS timed out, cancelling all further testing.\n", |
---|
24 | 24 | __builtin_return_address(0)); |
---|
25 | 25 | |
---|
26 | | - GEM_TRACE("%pS timed out.\n", __builtin_return_address(0)); |
---|
| 26 | + GEM_TRACE("%pS timed out.\n", |
---|
| 27 | + __builtin_return_address(0)); |
---|
27 | 28 | GEM_TRACE_DUMP(); |
---|
28 | 29 | |
---|
29 | | - i915_gem_set_wedged(i915); |
---|
| 30 | + intel_gt_set_wedged(gt); |
---|
| 31 | + ret = -EIO; |
---|
30 | 32 | } |
---|
31 | 33 | |
---|
32 | | - return i915_terminally_wedged(&i915->gpu_error) ? -EIO : 0; |
---|
| 34 | + return ret; |
---|
33 | 35 | } |
---|