aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-10-29 16:44:37 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-10-29 16:49:41 -0400
commit6aa56062eaba67adfb247cded244fd877329588d (patch)
tree554352e777eafbd3ebd322168297bd68018c2ad2 /drivers/gpu/drm/i915/intel_ringbuffer.c
parentf4e0b29bf23687ac16dc476bd90cd4d8b0eacd5c (diff)
drm/i915/ringbuffer: Use the HEAD auto-reporting mechanism
My Sandybridge only reports 0 for the ring buffer registers, causing it to hang as soon as we exhaust the available ring. As a workaround, take advantage of our huge ring buffers and use the auto-reporting mechanism to update the status page with the HEAD location every 64 KiB. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 2e72d3a0740f..390aa21edbe4 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -174,7 +174,7 @@ static int init_ring_common(struct intel_ring_buffer *ring)
174 174
175 I915_WRITE_CTL(ring, 175 I915_WRITE_CTL(ring,
176 ((ring->gem_object->size - PAGE_SIZE) & RING_NR_PAGES) 176 ((ring->gem_object->size - PAGE_SIZE) & RING_NR_PAGES)
177 | RING_NO_REPORT | RING_VALID); 177 | RING_REPORT_64K | RING_VALID);
178 178
179 /* If the head is still not zero, the ring is dead */ 179 /* If the head is still not zero, the ring is dead */
180 if ((I915_READ_CTL(ring) & RING_VALID) == 0 || 180 if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||
@@ -691,6 +691,17 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
691 struct drm_device *dev = ring->dev; 691 struct drm_device *dev = ring->dev;
692 drm_i915_private_t *dev_priv = dev->dev_private; 692 drm_i915_private_t *dev_priv = dev->dev_private;
693 unsigned long end; 693 unsigned long end;
694 u32 head;
695
696 head = intel_read_status_page(ring, 4);
697 if (head) {
698 ring->head = head & HEAD_ADDR;
699 ring->space = ring->head - (ring->tail + 8);
700 if (ring->space < 0)
701 ring->space += ring->size;
702 if (ring->space >= n)
703 return 0;
704 }
694 705
695 trace_i915_ring_wait_begin (dev); 706 trace_i915_ring_wait_begin (dev);
696 end = jiffies + 3 * HZ; 707 end = jiffies + 3 * HZ;