Skip to contentSkip to conversation

drm/i915: Add engine idle check for CI

PATCH In review Mika Kuoppala 3 participants 4 messages Feb 10, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Add engine idle check for CI

Assert for hardware idleness when we assign to execlist port, if for some reason we get off the tracks on sw tracking.

---
 drivers/gpu/drm/i915/intel_engine_cs.c  | 10 ++++++++++
 drivers/gpu/drm/i915/intel_lrc.c        |  4 +++-
 drivers/gpu/drm/i915/intel_ringbuffer.h |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_engine_cs.c +10 -0
index 69a6416..ba09420 100644
@@ -524,3 +524,13 @@ void intel_engine_get_instdone(struct intel_engine_cs *engine,
 		break;
 	}
 }
+
+bool intel_engine_idle(struct intel_engine_cs *engine)
+{
+	struct drm_i915_private *dev_priv = engine->i915;
+
+	if (INTEL_GEN(engine->i915) > 2)
+		return I915_READ_MODE(engine) & MODE_IDLE;
+
+	return true;
+}
drivers/gpu/drm/i915/intel_lrc.c +3 -1
index b21dbd4..3d909e3 100644
@@ -347,9 +347,11 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
 	u64 desc[2];
 
 	GEM_BUG_ON(port[0].count > 1);
-	if (!port[0].count)
+	if (!port[0].count) {
+		GEM_BUG_ON(!intel_engine_idle(engine));
 		execlists_context_status_change(port[0].request,
 						INTEL_CONTEXT_SCHEDULE_IN);
+	}
 	desc[0] = execlists_update_context(port[0].request);
 	GEM_BUG_ONLY(port[0].context_id = upper_32_bits(desc[0]));
 	port[0].count++;
drivers/gpu/drm/i915/intel_ringbuffer.h +1 -0
index 896838c..a319df9 100644
@@ -603,6 +603,7 @@ bool intel_engine_add_wait(struct intel_engine_cs *engine,
 void intel_engine_remove_wait(struct intel_engine_cs *engine,
 			      struct intel_wait *wait);
 void intel_engine_enable_signaling(struct drm_i915_gem_request *request);
+bool intel_engine_idle(struct intel_engine_cs *engine);
 
 static inline bool intel_engine_has_waiter(const struct intel_engine_cs *engine)
 {
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

drivers/gpu/drm/i915/intel_lrc.c static void execlists_submit_ports(struct intel_engine_cs *engine) · line 351

Quoted 9 lines · Mika Kuoppala
drivers/gpu/drm/i915/intel_lrc.c +2 -1
@@ -347,9 +347,11 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
 	u64 desc[2];
 
 	GEM_BUG_ON(port[0].count > 1);
-	if (!port[0].count)
+	if (!port[0].count) {
+		GEM_BUG_ON(!intel_engine_idle(engine));

Hmm, I actually think i915_gem_mark_busy() is a better starting point for the BUG_ON. Here it looks slightly incongruous.

Quoted 11 lines
drivers/gpu/drm/i915/intel_lrc.c +1 -0
 		execlists_context_status_change(port[0].request,
 						INTEL_CONTEXT_SCHEDULE_IN);
+	}
 	desc[0] = execlists_update_context(port[0].request);
 	GEM_BUG_ONLY(port[0].context_id = upper_32_bits(desc[0]));
 	port[0].count++;
drivers/gpu/drm/i915/intel_ringbuffer.h +0 -0
index 896838c..a319df9 100644

drivers/gpu/drm/i915/intel_ringbuffer.h bool intel_engine_add_wait(struct intel_engine_cs *engine, · line 606

Quoted 4 lines
drivers/gpu/drm/i915/intel_ringbuffer.h +1 -0
@@ -603,6 +603,7 @@ bool intel_engine_add_wait(struct intel_engine_cs *engine,
 void intel_engine_remove_wait(struct intel_engine_cs *engine,
 			      struct intel_wait *wait);
 void intel_engine_enable_signaling(struct drm_i915_gem_request *request);
+bool intel_engine_idle(struct intel_engine_cs *engine);

intel_engine_is_idle()

idle can be construed as a verb (and we have used it as such in the past, e.g. i915_gpu_idle()), so let's be careful.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Add engine idle check for CI

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: drm/i915: Add engine idle check for CI
URL : https://patchwork.freedesktop.org/series/19456/
State : failure

== Summary ==

Series 19456v1 drm/i915: Add engine idle check for CI
https://patchwork.freedesktop.org/api/1.0/series/19456/revisions/1/mbox/

Test kms_pipe_crc_basic:

        Subgroup read-crc-pipe-c-frame-sequence:
                pass       -> FAIL       (fi-skl-6770hq)
fi-bdw-5557u     total:252  pass:241  dwarn:0   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:252  pass:213  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:252  pass:233  dwarn:0   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:83   pass:70   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:252  pass:225  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:252  pass:221  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-ilk-650       total:252  pass:202  dwarn:0   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:252  pass:235  dwarn:0   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:252  pass:230  dwarn:4   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:252  pass:241  dwarn:0   dfail:0   fail:1   skip:10 
fi-snb-2520m     total:252  pass:224  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2600      total:252  pass:223  dwarn:0   dfail:0   fail:0   skip:29 

fb21519eac978241398fbcb48bf2db9c107b08be drm-tip: 2017y-02m-10d-14h-12m-42s UTC integration manifest 7d957d1 drm/i915: Add engine idle check for CI

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3768/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✓ Fi.CI.BAT: success for drm/i915: Add engine idle check for CI

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: drm/i915: Add engine idle check for CI
URL : https://patchwork.freedesktop.org/series/19456/
State : success

== Summary ==

Series 19456v1 drm/i915: Add engine idle check for CI
https://patchwork.freedesktop.org/api/1.0/series/19456/revisions/1/mbox/

Test kms_pipe_crc_basic:

        Subgroup suspend-read-crc-pipe-a:
                incomplete -> PASS       (fi-ivb-3770)
fi-bdw-5557u     total:252  pass:241  dwarn:0   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:252  pass:213  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:252  pass:233  dwarn:0   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:83   pass:70   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:252  pass:225  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:252  pass:221  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-ilk-650       total:252  pass:202  dwarn:0   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:252  pass:235  dwarn:0   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:252  pass:230  dwarn:4   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10 
fi-snb-2520m     total:252  pass:224  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2600      total:252  pass:223  dwarn:0   dfail:0   fail:0   skip:29 

c02eede7256a86ccd8308612491aa5e350aad8db drm-tip: 2017y-02m-10d-19h-11m-09s UTC integration manifest fa2106f drm/i915: Add engine idle check for CI

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3774/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx