Commit 3123ada8 authored by Chris Wilson's avatar Chris Wilson

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190306142517.22558-28-chris@chris-wilson.co.uk
parent 209d7353
...@@ -88,6 +88,9 @@ static int live_preempt(void *arg) ...@@ -88,6 +88,9 @@ static int live_preempt(void *arg)
if (!HAS_LOGICAL_RING_PREEMPTION(i915)) if (!HAS_LOGICAL_RING_PREEMPTION(i915))
return 0; return 0;
if (!(i915->caps.scheduler & I915_SCHEDULER_CAP_PREEMPTION))
pr_err("Logical preemption supported, but not exposed\n");
mutex_lock(&i915->drm.struct_mutex); mutex_lock(&i915->drm.struct_mutex);
wakeref = intel_runtime_pm_get(i915); wakeref = intel_runtime_pm_get(i915);
...@@ -112,6 +115,9 @@ static int live_preempt(void *arg) ...@@ -112,6 +115,9 @@ static int live_preempt(void *arg)
for_each_engine(engine, i915, id) { for_each_engine(engine, i915, id) {
struct i915_request *rq; struct i915_request *rq;
if (!intel_engine_has_preemption(engine))
continue;
rq = igt_spinner_create_request(&spin_lo, ctx_lo, engine, rq = igt_spinner_create_request(&spin_lo, ctx_lo, engine,
MI_ARB_CHECK); MI_ARB_CHECK);
if (IS_ERR(rq)) { if (IS_ERR(rq)) {
...@@ -203,6 +209,9 @@ static int live_late_preempt(void *arg) ...@@ -203,6 +209,9 @@ static int live_late_preempt(void *arg)
for_each_engine(engine, i915, id) { for_each_engine(engine, i915, id) {
struct i915_request *rq; struct i915_request *rq;
if (!intel_engine_has_preemption(engine))
continue;
rq = igt_spinner_create_request(&spin_lo, ctx_lo, engine, rq = igt_spinner_create_request(&spin_lo, ctx_lo, engine,
MI_ARB_CHECK); MI_ARB_CHECK);
if (IS_ERR(rq)) { if (IS_ERR(rq)) {
...@@ -335,6 +344,9 @@ static int live_suppress_self_preempt(void *arg) ...@@ -335,6 +344,9 @@ static int live_suppress_self_preempt(void *arg)
struct i915_request *rq_a, *rq_b; struct i915_request *rq_a, *rq_b;
int depth; int depth;
if (!intel_engine_has_preemption(engine))
continue;
engine->execlists.preempt_hang.count = 0; engine->execlists.preempt_hang.count = 0;
rq_a = igt_spinner_create_request(&a.spin, rq_a = igt_spinner_create_request(&a.spin,
...@@ -481,6 +493,9 @@ static int live_suppress_wait_preempt(void *arg) ...@@ -481,6 +493,9 @@ static int live_suppress_wait_preempt(void *arg)
for_each_engine(engine, i915, id) { for_each_engine(engine, i915, id) {
int depth; int depth;
if (!intel_engine_has_preemption(engine))
continue;
if (!engine->emit_init_breadcrumb) if (!engine->emit_init_breadcrumb)
continue; continue;
...@@ -602,6 +617,9 @@ static int live_chain_preempt(void *arg) ...@@ -602,6 +617,9 @@ static int live_chain_preempt(void *arg)
}; };
int count, i; int count, i;
if (!intel_engine_has_preemption(engine))
continue;
for_each_prime_number_from(count, 1, 32) { /* must fit ring! */ for_each_prime_number_from(count, 1, 32) { /* must fit ring! */
struct i915_request *rq; struct i915_request *rq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment