@@ -339,10 +339,11 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data)
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct drm_device *dev = node->minor->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
+ struct intel_ring_buffer *ring = &dev_priv->render_ring;
unsigned int head, tail;
- head = I915_READ(PRB0_HEAD) & HEAD_ADDR;
- tail = I915_READ(PRB0_TAIL) & TAIL_ADDR;
+ head = ring->get_head(dev, ring);
+ tail = ring->get_tail(dev, ring);
seq_printf(m, "RingHead : %08x\n", head);
seq_printf(m, "RingTail : %08x\n", tail);
@@ -107,8 +107,8 @@ void i915_kernel_lost_context(struct drm_device * dev)
if (drm_core_check_feature(dev, DRIVER_MODESET))
return;
- ring->head = I915_READ(PRB0_HEAD) & HEAD_ADDR;
- ring->tail = I915_READ(PRB0_TAIL) & TAIL_ADDR;
+ ring->head = ring->get_head(dev, ring);
+ ring->tail = ring->get_tail(dev, ring);
ring->space = ring->head - (ring->tail + 8);
if (ring->space < 0)
ring->space += ring->size;
@@ -531,7 +531,7 @@ i915_ringbuffer_last_batch(struct drm_device *dev)
* to find the most recently dispatched batch buffer.
*/
bbaddr = 0;
- head = I915_READ(PRB0_HEAD) & HEAD_ADDR;
+ head = dev_priv->render_ring.get_head(dev, &dev_priv->render_ring);
ring = (u32 *)(dev_priv->render_ring.virtual_start + head);
while (--ring >= (u32 *)dev_priv->render_ring.virtual_start) {
@@ -190,7 +190,7 @@ static int init_ring_common(struct drm_device *dev,
((ring->gem_object->size - PAGE_SIZE) & RING_NR_PAGES)
| RING_NO_REPORT | RING_VALID);
- head = I915_READ(ring->regs.head) & HEAD_ADDR;
+ head = ring->get_head(dev, ring);
/* If the head is still not zero, the ring is dead */
if (head != 0) {
DRM_ERROR("%s initialization failed "