summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-02-27 20:46:53 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-02-28 09:16:38 +0000
commit44f8b8022d4cde821819397e9f9f57eb30c51f93 (patch)
treeb6b9948f06125cf08ec75822f13f0d2ec58e473f
parent2d5eaad007d971b8cd8cd8122f594b04e292b567 (diff)
downloadlinux-44f8b8022d4cde821819397e9f9f57eb30c51f93.tar.bz2
Revert "drm/i915: Avoid waking the engines just to check if they are idle"
This reverts commit 0b702dca26580e3bbfbbaf22dfc29280b6263414. CI reports that this is not as reliable as it first appears, with failures starting to sporadically occur in selftests. Fixes: 0b702dca2658 ("drm/i915: Avoid waking the engines just to check if they are idle") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190227204654.14907-1-chris@chris-wilson.co.uk
-rw-r--r--drivers/gpu/drm/i915/intel_engine_cs.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 43ce4c5c56c9..ef49b1b0537b 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1007,7 +1007,6 @@ static bool ring_is_idle(struct intel_engine_cs *engine)
{
struct drm_i915_private *dev_priv = engine->i915;
intel_wakeref_t wakeref;
- unsigned long flags;
bool idle = true;
if (I915_SELFTEST_ONLY(!engine->mmio_base))
@@ -1018,19 +1017,15 @@ static bool ring_is_idle(struct intel_engine_cs *engine)
if (!wakeref)
return true;
- spin_lock_irqsave(&dev_priv->uncore.lock, flags);
+ /* First check that no commands are left in the ring */
+ if ((I915_READ_HEAD(engine) & HEAD_ADDR) !=
+ (I915_READ_TAIL(engine) & TAIL_ADDR))
+ idle = false;
- /*
- * Check that no commands are left in the ring.
- *
- * If the engine is not awake, both reads return 0 as we do so without
- * forcewake.
- */
- if ((I915_READ_FW(RING_HEAD(engine->mmio_base)) & HEAD_ADDR) !=
- (I915_READ_FW(RING_TAIL(engine->mmio_base)) & TAIL_ADDR))
+ /* No bit for gen2, so assume the CS parser is idle */
+ if (INTEL_GEN(dev_priv) > 2 && !(I915_READ_MODE(engine) & MODE_IDLE))
idle = false;
- spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
intel_runtime_pm_put(dev_priv, wakeref);
return idle;