Skip to content

Commit

Permalink
drm/i915: use new macros to access the ring start register
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Daniel Vetter authored and Chris Wilson committed Sep 21, 2010
1 parent 870e86d commit 6c0e1c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 4 additions & 7 deletions drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int init_ring_common(struct drm_device *dev,
ring->set_tail(dev, ring, 0);

/* Initialize the ring. */
I915_WRITE(ring->regs.start, obj_priv->gtt_offset);
I915_WRITE_START(ring, obj_priv->gtt_offset);
head = ring->get_head(dev, ring);

/* G45 ring initialization fails to reset head to zero */
Expand All @@ -168,7 +168,7 @@ static int init_ring_common(struct drm_device *dev,
I915_READ(ring->regs.ctl),
I915_READ(ring->regs.head),
I915_READ_TAIL(ring),
I915_READ(ring->regs.start));
I915_READ_START(ring));

I915_WRITE(ring->regs.head, 0);

Expand All @@ -178,7 +178,7 @@ static int init_ring_common(struct drm_device *dev,
I915_READ(ring->regs.ctl),
I915_READ(ring->regs.head),
I915_READ_TAIL(ring),
I915_READ(ring->regs.start));
I915_READ_START(ring));
}

I915_WRITE(ring->regs.ctl,
Expand All @@ -194,7 +194,7 @@ static int init_ring_common(struct drm_device *dev,
I915_READ(ring->regs.ctl),
I915_READ(ring->regs.head),
I915_READ_TAIL(ring),
I915_READ(ring->regs.start));
I915_READ_START(ring));
return -EIO;
}

Expand Down Expand Up @@ -781,7 +781,6 @@ static const struct intel_ring_buffer render_ring = {
.regs = {
.ctl = PRB0_CTL,
.head = PRB0_HEAD,
.start = PRB0_START
},
.mmio_base = RENDER_RING_BASE,
.size = 32 * PAGE_SIZE,
Expand Down Expand Up @@ -818,7 +817,6 @@ static const struct intel_ring_buffer bsd_ring = {
.regs = {
.ctl = BSD_RING_CTL,
.head = BSD_RING_HEAD,
.start = BSD_RING_START
},
.mmio_base = BSD_RING_BASE,
.size = 32 * PAGE_SIZE,
Expand Down Expand Up @@ -929,7 +927,6 @@ static const struct intel_ring_buffer gen6_bsd_ring = {
.regs = {
.ctl = GEN6_BSD_RING_CTL,
.head = GEN6_BSD_RING_HEAD,
.start = GEN6_BSD_RING_START
},
.mmio_base = GEN6_BSD_RING_BASE,
.size = 32 * PAGE_SIZE,
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/intel_ringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ struct intel_hw_status_page {

#define I915_READ_TAIL(ring) I915_READ(RING_TAIL(ring->mmio_base))
#define I915_WRITE_TAIL(ring, val) I915_WRITE(RING_TAIL(ring->mmio_base), val)
#define I915_READ_START(ring) I915_READ(RING_START(ring->mmio_base))
#define I915_WRITE_START(ring, val) I915_WRITE(RING_START(ring->mmio_base), val)

struct drm_i915_gem_execbuffer2;
struct intel_ring_buffer {
Expand All @@ -20,7 +22,6 @@ struct intel_ring_buffer {
struct ring_regs {
u32 ctl;
u32 head;
u32 start;
} regs;
u32 mmio_base;
unsigned long size;
Expand Down

0 comments on commit 6c0e1c5

Please sign in to comment.