From b909dff32458b036668a0234903b0e27f5601162 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 29 Dec 2012 12:28:20 +0000 Subject: [PATCH] drm/i915: Insert a posting read when turning off the rings Switch off the rings first, then adjust their start/tails. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_ringbuffer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 54a673a..4339bd0 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -353,20 +353,19 @@ static int init_ring_common(struct intel_ring_buffer *ring) drm_i915_private_t *dev_priv = dev->dev_private; struct drm_i915_gem_object *obj = ring->obj; int ret = 0; - u32 head; if (HAS_FORCE_WAKE(dev)) gen6_gt_force_wake_get(dev_priv); /* Stop the ring if it's running. */ I915_WRITE_CTL(ring, 0); + (void)I915_READ_CTL(ring); + I915_WRITE_HEAD(ring, 0); ring->write_tail(ring, 0); - head = I915_READ_HEAD(ring) & HEAD_ADDR; - /* G45 ring initialization fails to reset head to zero */ - if (head != 0) { + if (I915_READ_HEAD(ring) & HEAD_ADDR) { DRM_DEBUG_KMS("%s head not reset to zero " "ctl %08x head %08x tail %08x start %08x\n", ring->name, -- 1.7.10.4