diff mbox

[2/3] drm/i915: Pretend the engine is always idle when mocking

Message ID 20170411234427.14841-2-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson April 11, 2017, 11:44 p.m. UTC
If we have a mock engine and it has no more requests in flight, report
it as idle as there is no hardware to contradict us! Otherwise we
attempt to query the hw that doesn't exist and find that the hw hasn't
set its idle bit and we get upset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Joonas Lahtinen April 12, 2017, 8:49 a.m. UTC | #1
On ke, 2017-04-12 at 00:44 +0100, Chris Wilson wrote:
> If we have a mock engine and it has no more requests in flight, report
> it as idle as there is no hardware to contradict us! Otherwise we
> attempt to query the hw that doesn't exist and find that the hw hasn't
> set its idle bit and we get upset.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index ee87ca7420de..402769d9d840 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1140,6 +1140,9 @@  bool intel_engine_is_idle(struct intel_engine_cs *engine)
 			       intel_engine_last_submit(engine)))
 		return false;
 
+	if (I915_SELFTEST_ONLY(engine->breadcrumbs.mock))
+		return true;
+
 	/* Interrupt/tasklet pending? */
 	if (test_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted))
 		return false;