Skip to content

Commit 3123ada

Browse files
committed
drm/i915/selftests: Check preemption support on each engine
Check that we have setup on preemption for the engine before testing, instead warn if it is not enabled on supported HW. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 209d735 commit 3123ada

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/gpu/drm/i915/selftests/intel_lrc.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ static int live_preempt(void *arg)
8888
if (!HAS_LOGICAL_RING_PREEMPTION(i915))
8989
return 0;
9090

91+
if (!(i915->caps.scheduler & I915_SCHEDULER_CAP_PREEMPTION))
92+
pr_err("Logical preemption supported, but not exposed\n");
93+
9194
mutex_lock(&i915->drm.struct_mutex);
9295
wakeref = intel_runtime_pm_get(i915);
9396

@@ -112,6 +115,9 @@ static int live_preempt(void *arg)
112115
for_each_engine(engine, i915, id) {
113116
struct i915_request *rq;
114117

118+
if (!intel_engine_has_preemption(engine))
119+
continue;
120+
115121
rq = igt_spinner_create_request(&spin_lo, ctx_lo, engine,
116122
MI_ARB_CHECK);
117123
if (IS_ERR(rq)) {
@@ -203,6 +209,9 @@ static int live_late_preempt(void *arg)
203209
for_each_engine(engine, i915, id) {
204210
struct i915_request *rq;
205211

212+
if (!intel_engine_has_preemption(engine))
213+
continue;
214+
206215
rq = igt_spinner_create_request(&spin_lo, ctx_lo, engine,
207216
MI_ARB_CHECK);
208217
if (IS_ERR(rq)) {
@@ -335,6 +344,9 @@ static int live_suppress_self_preempt(void *arg)
335344
struct i915_request *rq_a, *rq_b;
336345
int depth;
337346

347+
if (!intel_engine_has_preemption(engine))
348+
continue;
349+
338350
engine->execlists.preempt_hang.count = 0;
339351

340352
rq_a = igt_spinner_create_request(&a.spin,
@@ -481,6 +493,9 @@ static int live_suppress_wait_preempt(void *arg)
481493
for_each_engine(engine, i915, id) {
482494
int depth;
483495

496+
if (!intel_engine_has_preemption(engine))
497+
continue;
498+
484499
if (!engine->emit_init_breadcrumb)
485500
continue;
486501

@@ -602,6 +617,9 @@ static int live_chain_preempt(void *arg)
602617
};
603618
int count, i;
604619

620+
if (!intel_engine_has_preemption(engine))
621+
continue;
622+
605623
for_each_prime_number_from(count, 1, 32) { /* must fit ring! */
606624
struct i915_request *rq;
607625

0 commit comments

Comments
 (0)