From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> More removal of implicit dev_priv from using old mmio accessors. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_gem.c | 40 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f5bf1fe208a6..4cffa7bea582 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1231,28 +1231,30 @@ void i915_gem_init_swizzling(struct intel_uncore *uncore) MISSING_CASE(INTEL_GEN(i915)); } -static void init_unused_ring(struct drm_i915_private *dev_priv, u32 base) +static void init_unused_ring(struct intel_uncore *uncore, u32 base) { - I915_WRITE(RING_CTL(base), 0); - I915_WRITE(RING_HEAD(base), 0); - I915_WRITE(RING_TAIL(base), 0); - I915_WRITE(RING_START(base), 0); + intel_uncore_write(uncore, RING_CTL(base), 0); + intel_uncore_write(uncore, RING_HEAD(base), 0); + intel_uncore_write(uncore, RING_TAIL(base), 0); + intel_uncore_write(uncore, RING_START(base), 0); } -static void init_unused_rings(struct drm_i915_private *dev_priv) +static void init_unused_rings(struct intel_uncore *uncore) { - if (IS_I830(dev_priv)) { - init_unused_ring(dev_priv, PRB1_BASE); - init_unused_ring(dev_priv, SRB0_BASE); - init_unused_ring(dev_priv, SRB1_BASE); - init_unused_ring(dev_priv, SRB2_BASE); - init_unused_ring(dev_priv, SRB3_BASE); - } else if (IS_GEN(dev_priv, 2)) { - init_unused_ring(dev_priv, SRB0_BASE); - init_unused_ring(dev_priv, SRB1_BASE); - } else if (IS_GEN(dev_priv, 3)) { - init_unused_ring(dev_priv, PRB1_BASE); - init_unused_ring(dev_priv, PRB2_BASE); + struct drm_i915_private *i915 = uncore_to_i915(uncore); + + if (IS_I830(i915)) { + init_unused_ring(uncore, PRB1_BASE); + init_unused_ring(uncore, SRB0_BASE); + init_unused_ring(uncore, SRB1_BASE); + init_unused_ring(uncore, SRB2_BASE); + init_unused_ring(uncore, SRB3_BASE); + } else if (IS_GEN(i915, 2)) { + init_unused_ring(uncore, SRB0_BASE); + init_unused_ring(uncore, SRB1_BASE); + } else if (IS_GEN(i915, 3)) { + init_unused_ring(uncore, PRB1_BASE); + init_unused_ring(uncore, PRB2_BASE); } } @@ -1285,7 +1287,7 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv) * will prevent c3 entry. Makes sure all unused rings * are totally idle. */ - init_unused_rings(dev_priv); + init_unused_rings(&dev_priv->uncore); BUG_ON(!dev_priv->kernel_context); ret = i915_terminally_wedged(dev_priv); -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx