[PATCH 03/13] drm/i915/selftests: Teach igt_flush_test and igt_live_test to take intel_gt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Both routines operate local to the intel_gt, so pass it along as the
object to work on.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 .../drm/i915/gem/selftests/i915_gem_context.c | 30 +++++++------
 .../drm/i915/gem/selftests/i915_gem_mman.c    |  2 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |  4 +-
 drivers/gpu/drm/i915/gt/selftest_hangcheck.c  | 16 +++----
 drivers/gpu/drm/i915/gt/selftest_lrc.c        | 42 +++++++++----------
 drivers/gpu/drm/i915/gt/selftest_timeline.c   |  6 +--
 .../gpu/drm/i915/gt/selftest_workarounds.c    |  6 +--
 drivers/gpu/drm/i915/selftests/i915_active.c  |  4 +-
 .../gpu/drm/i915/selftests/i915_gem_evict.c   |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |  2 +-
 drivers/gpu/drm/i915/selftests/i915_request.c | 14 ++++---
 .../gpu/drm/i915/selftests/i915_selftest.c    |  4 +-
 .../gpu/drm/i915/selftests/igt_flush_test.c   |  3 +-
 .../gpu/drm/i915/selftests/igt_flush_test.h   |  4 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    | 28 ++++++-------
 .../gpu/drm/i915/selftests/igt_live_test.h    |  8 ++--
 16 files changed, 91 insertions(+), 84 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index e5c235051ae5..d2d7962a049b 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -93,7 +93,8 @@ static int live_nop_switch(void *arg)
 		pr_info("Populated %d contexts on %s in %lluns\n",
 			nctx, engine->name, ktime_to_ns(times[1] - times[0]));
 
-		err = igt_live_test_begin(&t, i915, __func__, engine->name);
+		err = igt_live_test_begin(&t, engine->gt,
+					  __func__, engine->name);
 		if (err)
 			goto out_file;
 
@@ -307,7 +308,8 @@ static int live_parallel_switch(void *arg)
 		struct igt_live_test t;
 		int n;
 
-		err = igt_live_test_begin(&t, i915, __func__, "");
+		err = igt_live_test_begin(&t, data[0].ce[0]->engine->gt,
+					  __func__, "");
 		if (err)
 			break;
 
@@ -614,7 +616,8 @@ static int igt_ctx_exec(void *arg)
 		if (IS_ERR(file))
 			return PTR_ERR(file);
 
-		err = igt_live_test_begin(&t, i915, __func__, engine->name);
+		err = igt_live_test_begin(&t, engine->gt,
+					  __func__, engine->name);
 		if (err)
 			goto out_file;
 
@@ -739,10 +742,6 @@ static int igt_shared_ctx_exec(void *arg)
 		goto out_file;
 	}
 
-	err = igt_live_test_begin(&t, i915, __func__, "");
-	if (err)
-		goto out_file;
-
 	for_each_engine(engine, i915, id) {
 		unsigned long ncontexts, ndwords, dw;
 		struct drm_i915_gem_object *obj = NULL;
@@ -752,6 +751,11 @@ static int igt_shared_ctx_exec(void *arg)
 		if (!intel_engine_can_store_dword(engine))
 			continue;
 
+		err = igt_live_test_begin(&t, engine->gt,
+					  __func__, engine->name);
+		if (err)
+			goto out_file;
+
 		dw = 0;
 		ndwords = 0;
 		ncontexts = 0;
@@ -827,12 +831,14 @@ static int igt_shared_ctx_exec(void *arg)
 			dw += rem;
 		}
 
+		err = igt_live_test_end(&t);
+		if (err)
+			goto out_test;
+
 		i915_gem_drain_freed_objects(i915);
 	}
 out_test:
 	throttle_release(tq, ARRAY_SIZE(tq));
-	if (igt_live_test_end(&t))
-		err = -EIO;
 out_file:
 	mock_file_free(i915, file);
 	return err;
@@ -1249,7 +1255,7 @@ __igt_ctx_sseu(struct drm_i915_private *i915,
 		goto out_fail;
 
 out_fail:
-	if (igt_flush_test(i915))
+	if (igt_flush_test(&i915->gt))
 		ret = -EIO;
 
 	intel_context_unpin(ce);
@@ -1318,7 +1324,7 @@ static int igt_ctx_readonly(void *arg)
 	if (IS_ERR(file))
 		return PTR_ERR(file);
 
-	err = igt_live_test_begin(&t, i915, __func__, "");
+	err = igt_live_test_begin(&t, &i915->gt, __func__, "");
 	if (err)
 		goto out_file;
 
@@ -1667,7 +1673,7 @@ static int igt_vm_isolation(void *arg)
 	if (IS_ERR(file))
 		return PTR_ERR(file);
 
-	err = igt_live_test_begin(&t, i915, __func__, "");
+	err = igt_live_test_begin(&t, &i915->gt, __func__, "");
 	if (err)
 		goto out_file;
 
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
index 65d4dbf91999..cdab880c55d6 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
@@ -578,7 +578,7 @@ static void disable_retire_worker(struct drm_i915_private *i915)
 
 static void restore_retire_worker(struct drm_i915_private *i915)
 {
-	igt_flush_test(i915);
+	igt_flush_test(&i915->gt);
 	intel_gt_pm_put(&i915->gt);
 	i915_gem_driver_register__shrinker(i915);
 }
diff --git a/drivers/gpu/drm/i915/gt/selftest_context.c b/drivers/gpu/drm/i915/gt/selftest_context.c
index f63a26a3e620..be43149373de 100644
--- a/drivers/gpu/drm/i915/gt/selftest_context.c
+++ b/drivers/gpu/drm/i915/gt/selftest_context.c
@@ -310,7 +310,7 @@ static int live_active_context(void *arg)
 		if (err)
 			break;
 
-		err = igt_flush_test(gt->i915);
+		err = igt_flush_test(gt);
 		if (err)
 			break;
 	}
@@ -420,7 +420,7 @@ static int live_remote_context(void *arg)
 		if (err)
 			break;
 
-		err = igt_flush_test(gt->i915);
+		err = igt_flush_test(gt);
 		if (err)
 			break;
 	}
diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
index 8e0016464325..54e4a962c336 100644
--- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
+++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
@@ -295,7 +295,7 @@ static void hang_fini(struct hang *h)
 
 	kernel_context_close(h->ctx);
 
-	igt_flush_test(h->gt->i915);
+	igt_flush_test(h->gt);
 }
 
 static bool wait_until_running(struct hang *h, struct i915_request *rq)
@@ -431,13 +431,13 @@ static int igt_reset_nop(void *arg)
 			break;
 		}
 
-		err = igt_flush_test(gt->i915);
+		err = igt_flush_test(gt);
 		if (err)
 			break;
 	} while (time_before(jiffies, end_time));
 	pr_info("%s: %d resets\n", __func__, count);
 
-	err = igt_flush_test(gt->i915);
+	err = igt_flush_test(gt);
 out:
 	mock_file_free(gt->i915, file);
 	if (intel_gt_is_wedged(gt))
@@ -528,12 +528,12 @@ static int igt_reset_nop_engine(void *arg)
 		if (err)
 			break;
 
-		err = igt_flush_test(gt->i915);
+		err = igt_flush_test(gt);
 		if (err)
 			break;
 	}
 
-	err = igt_flush_test(gt->i915);
+	err = igt_flush_test(gt);
 out:
 	mock_file_free(gt->i915, file);
 	if (intel_gt_is_wedged(gt))
@@ -634,7 +634,7 @@ static int __igt_reset_engine(struct intel_gt *gt, bool active)
 		if (err)
 			break;
 
-		err = igt_flush_test(gt->i915);
+		err = igt_flush_test(gt);
 		if (err)
 			break;
 	}
@@ -951,7 +951,7 @@ static int __igt_reset_engines(struct intel_gt *gt,
 		if (err)
 			break;
 
-		err = igt_flush_test(gt->i915);
+		err = igt_flush_test(gt);
 		if (err)
 			break;
 	}
@@ -1473,7 +1473,7 @@ static int igt_reset_queue(void *arg)
 
 		i915_request_put(prev);
 
-		err = igt_flush_test(gt->i915);
+		err = igt_flush_test(gt);
 		if (err)
 			break;
 	}
diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 5dc679781a08..2cd1a2d43314 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -87,7 +87,7 @@ static int live_sanitycheck(void *arg)
 		}
 
 		igt_spinner_end(&spin);
-		if (igt_flush_test(gt->i915)) {
+		if (igt_flush_test(gt)) {
 			err = -EIO;
 			goto err_ctx;
 		}
@@ -135,7 +135,7 @@ static int live_unlite_restore(struct intel_gt *gt, int prio)
 		if (!intel_engine_can_store_dword(engine))
 			continue;
 
-		if (igt_live_test_begin(&t, gt->i915, __func__, engine->name)) {
+		if (igt_live_test_begin(&t, gt, __func__, engine->name)) {
 			err = -EIO;
 			break;
 		}
@@ -479,7 +479,7 @@ static int live_timeslice_preempt(void *arg)
 			if (err)
 				goto err_pin;
 
-			if (igt_flush_test(gt->i915)) {
+			if (igt_flush_test(gt)) {
 				err = -EIO;
 				goto err_pin;
 			}
@@ -700,7 +700,7 @@ static int live_busywait_preempt(void *arg)
 		if (!intel_engine_can_store_dword(engine))
 			continue;
 
-		if (igt_live_test_begin(&t, gt->i915, __func__, engine->name)) {
+		if (igt_live_test_begin(&t, gt, __func__, engine->name)) {
 			err = -EIO;
 			goto err_vma;
 		}
@@ -872,7 +872,7 @@ static int live_preempt(void *arg)
 		if (!intel_engine_has_preemption(engine))
 			continue;
 
-		if (igt_live_test_begin(&t, gt->i915, __func__, engine->name)) {
+		if (igt_live_test_begin(&t, gt, __func__, engine->name)) {
 			err = -EIO;
 			goto err_ctx_lo;
 		}
@@ -968,7 +968,7 @@ static int live_late_preempt(void *arg)
 		if (!intel_engine_has_preemption(engine))
 			continue;
 
-		if (igt_live_test_begin(&t, gt->i915, __func__, engine->name)) {
+		if (igt_live_test_begin(&t, gt, __func__, engine->name)) {
 			err = -EIO;
 			goto err_ctx_lo;
 		}
@@ -1146,7 +1146,7 @@ static int live_nopreempt(void *arg)
 			goto err_wedged;
 		}
 
-		if (igt_flush_test(gt->i915))
+		if (igt_flush_test(gt))
 			goto err_wedged;
 	}
 
@@ -1204,7 +1204,7 @@ static int live_suppress_self_preempt(void *arg)
 		if (!intel_engine_has_preemption(engine))
 			continue;
 
-		if (igt_flush_test(gt->i915))
+		if (igt_flush_test(gt))
 			goto err_wedged;
 
 		intel_engine_pm_get(engine);
@@ -1265,7 +1265,7 @@ static int live_suppress_self_preempt(void *arg)
 		}
 
 		intel_engine_pm_put(engine);
-		if (igt_flush_test(gt->i915))
+		if (igt_flush_test(gt))
 			goto err_wedged;
 	}
 
@@ -1419,7 +1419,7 @@ static int live_suppress_wait_preempt(void *arg)
 			for (i = 0; i < ARRAY_SIZE(client); i++)
 				igt_spinner_end(&client[i].spin);
 
-			if (igt_flush_test(gt->i915))
+			if (igt_flush_test(gt))
 				goto err_wedged;
 
 			if (engine->execlists.preempt_hang.count) {
@@ -1506,7 +1506,7 @@ static int live_chain_preempt(void *arg)
 			goto err_wedged;
 		}
 
-		if (igt_live_test_begin(&t, gt->i915, __func__, engine->name)) {
+		if (igt_live_test_begin(&t, gt, __func__, engine->name)) {
 			err = -EIO;
 			goto err_wedged;
 		}
@@ -1684,7 +1684,7 @@ static int live_preempt_hang(void *arg)
 
 		igt_spinner_end(&spin_hi);
 		igt_spinner_end(&spin_lo);
-		if (igt_flush_test(gt->i915)) {
+		if (igt_flush_test(gt)) {
 			err = -EIO;
 			goto err_ctx_lo;
 		}
@@ -1919,7 +1919,7 @@ static int live_preempt_smoke(void *arg)
 	i915_gem_object_flush_map(smoke.batch);
 	i915_gem_object_unpin_map(smoke.batch);
 
-	if (igt_live_test_begin(&t, smoke.gt->i915, __func__, "all")) {
+	if (igt_live_test_begin(&t, smoke.gt, __func__, "all")) {
 		err = -EIO;
 		goto err_batch;
 	}
@@ -2002,7 +2002,7 @@ static int nop_virtual_engine(struct intel_gt *gt,
 		}
 	}
 
-	err = igt_live_test_begin(&t, gt->i915, __func__, ve[0]->engine->name);
+	err = igt_live_test_begin(&t, gt, __func__, ve[0]->engine->name);
 	if (err)
 		goto out;
 
@@ -2071,7 +2071,7 @@ static int nop_virtual_engine(struct intel_gt *gt,
 		prime, div64_u64(ktime_to_ns(times[1]), prime));
 
 out:
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	for (nc = 0; nc < nctx; nc++) {
@@ -2161,7 +2161,7 @@ static int mask_virtual_engine(struct intel_gt *gt,
 	if (err)
 		goto out_put;
 
-	err = igt_live_test_begin(&t, gt->i915, __func__, ve->engine->name);
+	err = igt_live_test_begin(&t, gt, __func__, ve->engine->name);
 	if (err)
 		goto out_unpin;
 
@@ -2208,7 +2208,7 @@ static int mask_virtual_engine(struct intel_gt *gt,
 
 	err = igt_live_test_end(&t);
 out:
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	for (n = 0; n < nsibling; n++)
@@ -2287,7 +2287,7 @@ static int preserved_virtual_engine(struct intel_gt *gt,
 	if (err)
 		goto out_put;
 
-	err = igt_live_test_begin(&t, gt->i915, __func__, ve->engine->name);
+	err = igt_live_test_begin(&t, gt, __func__, ve->engine->name);
 	if (err)
 		goto out_unpin;
 
@@ -2532,7 +2532,7 @@ static int bond_virtual_engine(struct intel_gt *gt,
 out:
 	for (n = 0; !IS_ERR(rq[n]); n++)
 		i915_request_put(rq[n]);
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	kernel_context_close(ctx);
@@ -2865,7 +2865,7 @@ static int live_lrc_state(void *arg)
 			break;
 	}
 
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	i915_vma_unpin_and_release(&scratch, 0);
@@ -3008,7 +3008,7 @@ static int live_gpr_clear(void *arg)
 			break;
 	}
 
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	i915_vma_unpin_and_release(&scratch, 0);
diff --git a/drivers/gpu/drm/i915/gt/selftest_timeline.c b/drivers/gpu/drm/i915/gt/selftest_timeline.c
index dac86f699a4c..abdcbb3b8632 100644
--- a/drivers/gpu/drm/i915/gt/selftest_timeline.c
+++ b/drivers/gpu/drm/i915/gt/selftest_timeline.c
@@ -551,7 +551,7 @@ static int live_hwsp_engine(void *arg)
 			break;
 	}
 
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	for (n = 0; n < count; n++) {
@@ -623,7 +623,7 @@ static int live_hwsp_alternate(void *arg)
 	}
 
 out:
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	for (n = 0; n < count; n++) {
@@ -742,7 +742,7 @@ static int live_hwsp_wrap(void *arg)
 	}
 
 out:
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	intel_timeline_unpin(tl);
diff --git a/drivers/gpu/drm/i915/gt/selftest_workarounds.c b/drivers/gpu/drm/i915/gt/selftest_workarounds.c
index ef02920cec29..c4877cc81fce 100644
--- a/drivers/gpu/drm/i915/gt/selftest_workarounds.c
+++ b/drivers/gpu/drm/i915/gt/selftest_workarounds.c
@@ -693,7 +693,7 @@ static int check_dirty_whitelist(struct i915_gem_context *ctx,
 			break;
 	}
 
-	if (igt_flush_test(ctx->i915))
+	if (igt_flush_test(&ctx->i915->gt))
 		err = -EIO;
 out_batch:
 	i915_vma_unpin_and_release(&batch, 0);
@@ -1105,7 +1105,7 @@ static int live_isolated_whitelist(void *arg)
 		kernel_context_close(client[i].ctx);
 	}
 
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	return err;
@@ -1261,7 +1261,7 @@ live_engine_reset_workarounds(void *arg)
 	igt_global_reset_unlock(gt);
 	kernel_context_close(ctx);
 
-	igt_flush_test(gt->i915);
+	igt_flush_test(gt);
 
 	return ret;
 }
diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm/i915/selftests/i915_active.c
index 268192b5613b..ade5e4a0c12a 100644
--- a/drivers/gpu/drm/i915/selftests/i915_active.c
+++ b/drivers/gpu/drm/i915/selftests/i915_active.c
@@ -162,7 +162,7 @@ static int live_active_wait(void *arg)
 
 	__live_put(active);
 
-	if (igt_flush_test(i915))
+	if (igt_flush_test(&i915->gt))
 		err = -EIO;
 
 	return err;
@@ -181,7 +181,7 @@ static int live_active_retire(void *arg)
 		return PTR_ERR(active);
 
 	/* waits for & retires all requests */
-	if (igt_flush_test(i915))
+	if (igt_flush_test(&i915->gt))
 		err = -EIO;
 
 	if (!READ_ONCE(active->retired)) {
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index 0af9a58d011d..300967ea6257 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -520,7 +520,7 @@ static int igt_evict_contexts(void *arg)
 
 	mutex_lock(&i915->ggtt.vm.mutex);
 out_locked:
-	if (igt_flush_test(i915))
+	if (igt_flush_test(&i915->gt))
 		err = -EIO;
 	while (reserved) {
 		struct reserved *next = reserved->next;
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index ebe735df6504..6321bf91f5c7 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -2003,7 +2003,7 @@ static int igt_cs_tlb(void *arg)
 		}
 	}
 end:
-	if (igt_flush_test(i915))
+	if (igt_flush_test(&i915->gt))
 		err = -EIO;
 	i915_gem_context_unlock_engines(ctx);
 	i915_gem_object_unpin_map(out);
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
index 30ae34f62176..c9ac3dd4dbda 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -535,7 +535,8 @@ static int live_nop_request(void *arg)
 		IGT_TIMEOUT(end_time);
 		ktime_t times[2] = {};
 
-		err = igt_live_test_begin(&t, i915, __func__, engine->name);
+		err = igt_live_test_begin(&t, engine->gt,
+					  __func__, engine->name);
 		if (err)
 			return err;
 
@@ -687,7 +688,8 @@ static int live_empty_request(void *arg)
 		unsigned long n, prime;
 		ktime_t times[2] = {};
 
-		err = igt_live_test_begin(&t, i915, __func__, engine->name);
+		err = igt_live_test_begin(&t, engine->gt,
+					  __func__, engine->name);
 		if (err)
 			goto out_batch;
 
@@ -831,7 +833,7 @@ static int live_all_engines(void *arg)
 	if (!request)
 		return -ENOMEM;
 
-	err = igt_live_test_begin(&t, i915, __func__, "");
+	err = igt_live_test_begin(&t, &i915->gt, __func__, "");
 	if (err)
 		goto out_free;
 
@@ -945,7 +947,7 @@ static int live_sequential_engines(void *arg)
 	if (!request)
 		return -ENOMEM;
 
-	err = igt_live_test_begin(&t, i915, __func__, "");
+	err = igt_live_test_begin(&t, &i915->gt, __func__, "");
 	if (err)
 		goto out_free;
 
@@ -1142,7 +1144,7 @@ static int live_parallel_engines(void *arg)
 		struct igt_live_test t;
 		unsigned int idx;
 
-		err = igt_live_test_begin(&t, i915, __func__, "");
+		err = igt_live_test_begin(&t, &i915->gt, __func__, "");
 		if (err)
 			break;
 
@@ -1278,7 +1280,7 @@ static int live_breadcrumbs_smoketest(void *arg)
 		}
 	}
 
-	ret = igt_live_test_begin(&live, i915, __func__, "");
+	ret = igt_live_test_begin(&live, &i915->gt, __func__, "");
 	if (ret)
 		goto out_contexts;
 
diff --git a/drivers/gpu/drm/i915/selftests/i915_selftest.c b/drivers/gpu/drm/i915/selftests/i915_selftest.c
index 825a8286cbe8..d83679d4f1c2 100644
--- a/drivers/gpu/drm/i915/selftests/i915_selftest.c
+++ b/drivers/gpu/drm/i915/selftests/i915_selftest.c
@@ -263,7 +263,7 @@ int __i915_live_teardown(int err, void *data)
 {
 	struct drm_i915_private *i915 = data;
 
-	if (igt_flush_test(i915))
+	if (igt_flush_test(&i915->gt))
 		err = -EIO;
 
 	i915_gem_drain_freed_objects(i915);
@@ -282,7 +282,7 @@ int __intel_gt_live_teardown(int err, void *data)
 {
 	struct intel_gt *gt = data;
 
-	if (igt_flush_test(gt->i915))
+	if (igt_flush_test(gt))
 		err = -EIO;
 
 	i915_gem_drain_freed_objects(gt->i915);
diff --git a/drivers/gpu/drm/i915/selftests/igt_flush_test.c b/drivers/gpu/drm/i915/selftests/igt_flush_test.c
index 7b0939e3f007..25ef435af051 100644
--- a/drivers/gpu/drm/i915/selftests/igt_flush_test.c
+++ b/drivers/gpu/drm/i915/selftests/igt_flush_test.c
@@ -12,9 +12,8 @@
 
 #include "igt_flush_test.h"
 
-int igt_flush_test(struct drm_i915_private *i915)
+int igt_flush_test(struct intel_gt *gt)
 {
-	struct intel_gt *gt = &i915->gt;
 	int ret = intel_gt_is_wedged(gt) ? -EIO : 0;
 
 	cond_resched();
diff --git a/drivers/gpu/drm/i915/selftests/igt_flush_test.h b/drivers/gpu/drm/i915/selftests/igt_flush_test.h
index 7541fa74e641..d522ce11f0e1 100644
--- a/drivers/gpu/drm/i915/selftests/igt_flush_test.h
+++ b/drivers/gpu/drm/i915/selftests/igt_flush_test.h
@@ -7,8 +7,8 @@
 #ifndef IGT_FLUSH_TEST_H
 #define IGT_FLUSH_TEST_H
 
-struct drm_i915_private;
+struct intel_gt;
 
-int igt_flush_test(struct drm_i915_private *i915);
+int igt_flush_test(struct intel_gt *gt);
 
 #endif /* IGT_FLUSH_TEST_H */
diff --git a/drivers/gpu/drm/i915/selftests/igt_live_test.c b/drivers/gpu/drm/i915/selftests/igt_live_test.c
index 810b60100c2c..12893bffd0a1 100644
--- a/drivers/gpu/drm/i915/selftests/igt_live_test.c
+++ b/drivers/gpu/drm/i915/selftests/igt_live_test.c
@@ -12,58 +12,58 @@
 #include "igt_live_test.h"
 
 int igt_live_test_begin(struct igt_live_test *t,
-			struct drm_i915_private *i915,
+			struct intel_gt *gt,
 			const char *func,
 			const char *name)
 {
+	struct i915_gpu_error *error = &gt->i915->gpu_error;
 	struct intel_engine_cs *engine;
 	enum intel_engine_id id;
 	int err;
 
-	t->i915 = i915;
+	t->gt = gt;
 	t->func = func;
 	t->name = name;
 
-	err = intel_gt_wait_for_idle(&i915->gt, MAX_SCHEDULE_TIMEOUT);
+	err = intel_gt_wait_for_idle(gt, MAX_SCHEDULE_TIMEOUT);
 	if (err) {
 		pr_err("%s(%s): failed to idle before, with err=%d!",
 		       func, name, err);
 		return err;
 	}
 
-	t->reset_global = i915_reset_count(&i915->gpu_error);
+	t->reset_global = i915_reset_count(error);
 
-	for_each_engine(engine, i915, id)
-		t->reset_engine[id] =
-			i915_reset_engine_count(&i915->gpu_error, engine);
+	for_each_engine(engine, gt, id)
+		t->reset_engine[id] = i915_reset_engine_count(error, engine);
 
 	return 0;
 }
 
 int igt_live_test_end(struct igt_live_test *t)
 {
-	struct drm_i915_private *i915 = t->i915;
+	struct i915_gpu_error *error = &t->gt->i915->gpu_error;
 	struct intel_engine_cs *engine;
 	enum intel_engine_id id;
 
-	if (igt_flush_test(i915))
+	if (igt_flush_test(t->gt))
 		return -EIO;
 
-	if (t->reset_global != i915_reset_count(&i915->gpu_error)) {
+	if (t->reset_global != i915_reset_count(error)) {
 		pr_err("%s(%s): GPU was reset %d times!\n",
 		       t->func, t->name,
-		       i915_reset_count(&i915->gpu_error) - t->reset_global);
+		       i915_reset_count(error) - t->reset_global);
 		return -EIO;
 	}
 
-	for_each_engine(engine, i915, id) {
+	for_each_engine(engine, t->gt, id) {
 		if (t->reset_engine[id] ==
-		    i915_reset_engine_count(&i915->gpu_error, engine))
+		    i915_reset_engine_count(error, engine))
 			continue;
 
 		pr_err("%s(%s): engine '%s' was reset %d times!\n",
 		       t->func, t->name, engine->name,
-		       i915_reset_engine_count(&i915->gpu_error, engine) -
+		       i915_reset_engine_count(error, engine) -
 		       t->reset_engine[id]);
 		return -EIO;
 	}
diff --git a/drivers/gpu/drm/i915/selftests/igt_live_test.h b/drivers/gpu/drm/i915/selftests/igt_live_test.h
index c0e9f99d50de..234666e93226 100644
--- a/drivers/gpu/drm/i915/selftests/igt_live_test.h
+++ b/drivers/gpu/drm/i915/selftests/igt_live_test.h
@@ -7,12 +7,12 @@
 #ifndef IGT_LIVE_TEST_H
 #define IGT_LIVE_TEST_H
 
-#include "../i915_gem.h"
+#include "gt/intel_engine_types.h" /* I915_NUM_ENGINES */
 
-struct drm_i915_private;
+struct intel_gt;
 
 struct igt_live_test {
-	struct drm_i915_private *i915;
+	struct intel_gt *gt;
 	const char *func;
 	const char *name;
 
@@ -27,7 +27,7 @@ struct igt_live_test {
  * e.g. if the GPU was reset.
  */
 int igt_live_test_begin(struct igt_live_test *t,
-			struct drm_i915_private *i915,
+			struct intel_gt *gt,
 			const char *func,
 			const char *name);
 int igt_live_test_end(struct igt_live_test *t);
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux