[Intel-gfx] [PATCH 5/5] drm/i915: Split ctx timestamp selftest into two

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Apr 21 14:29:32 UTC 2020


We use different workarounds for render engine than
for other engines. Split the selftest according to these
types so that we get error rates per workaround.

Signed-off-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_lrc.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 32c4096b627b..dd260496876c 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -4749,10 +4749,9 @@ static int __lrc_timestamp(const struct lrc_timestamp *arg, bool preempt)
 	return err;
 }
 
-static int live_lrc_timestamp(void *arg)
+static int __live_lrc_timestamp(struct intel_gt *gt, unsigned long class_filter)
 {
 	struct lrc_timestamp data = {};
-	struct intel_gt *gt = arg;
 	enum intel_engine_id id;
 	const u32 poison[] = {
 		0,
@@ -4774,6 +4773,9 @@ static int live_lrc_timestamp(void *arg)
 		unsigned long heartbeat;
 		int i, err = 0;
 
+		if (!(class_filter & BIT(data.engine->class)))
+			continue;
+
 		engine_heartbeat_disable(data.engine, &heartbeat);
 
 		for (i = 0; i < ARRAY_SIZE(data.ce); i++) {
@@ -4825,6 +4827,20 @@ static int live_lrc_timestamp(void *arg)
 	return 0;
 }
 
+static int live_lrc_timestamp_rcs(void *arg)
+{
+	struct intel_gt *gt = arg;
+
+	return __live_lrc_timestamp(gt, BIT(RENDER_CLASS));
+}
+
+static int live_lrc_timestamp_xcs(void *arg)
+{
+	struct intel_gt *gt = arg;
+
+	return __live_lrc_timestamp(gt, ~BIT(RENDER_CLASS));
+}
+
 static struct i915_vma *
 create_user_vma(struct i915_address_space *vm, unsigned long size)
 {
@@ -5748,7 +5764,8 @@ int intel_lrc_live_selftests(struct drm_i915_private *i915)
 		SUBTEST(live_lrc_state),
 		SUBTEST(live_lrc_gpr),
 		SUBTEST(live_lrc_indirect_ctx_bb),
-		SUBTEST(live_lrc_timestamp),
+		SUBTEST(live_lrc_timestamp_rcs),
+		SUBTEST(live_lrc_timestamp_xcs),
 		SUBTEST(live_lrc_garbage),
 		SUBTEST(live_pphwsp_runtime),
 		SUBTEST(live_lrc_isolation),
-- 
2.17.1



More information about the Intel-gfx mailing list