aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_engine_cs.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-05-30 08:13:34 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2017-06-01 09:22:16 -0400
commitaed2fc102ffaa9bd41e4cff140d3ec8482d13ff5 (patch)
tree715b9530c51a80dce3c535a10b8328c26c23ec64 /drivers/gpu/drm/i915/intel_engine_cs.c
parent04f7b24eccdfae680a36e9825fe0d61dcd5ed528 (diff)
drm/i915: Check the ring is empty when declaring the engines are idle
As another precaution when testing whether the CS engine is actually idle, also inspect the ring's HEAD/TAIL registers, which should be equal when there are no commands left to execute by the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170530121334.17364-3-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_engine_cs.c')
-rw-r--r--drivers/gpu/drm/i915/intel_engine_cs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 699f2d3861c7..bc38bd128b76 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1212,6 +1212,11 @@ static bool ring_is_idle(struct intel_engine_cs *engine)
1212 1212
1213 intel_runtime_pm_get(dev_priv); 1213 intel_runtime_pm_get(dev_priv);
1214 1214
1215 /* First check that no commands are left in the ring */
1216 if ((I915_READ_HEAD(engine) & HEAD_ADDR) !=
1217 (I915_READ_TAIL(engine) & TAIL_ADDR))
1218 idle = false;
1219
1215 /* No bit for gen2, so assume the CS parser is idle */ 1220 /* No bit for gen2, so assume the CS parser is idle */
1216 if (INTEL_GEN(dev_priv) > 2 && !(I915_READ_MODE(engine) & MODE_IDLE)) 1221 if (INTEL_GEN(dev_priv) > 2 && !(I915_READ_MODE(engine) & MODE_IDLE))
1217 idle = false; 1222 idle = false;