summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-10-13 12:48:45 +0200
committerDave Airlie <airlied@redhat.com>2011-12-20 19:49:56 +0000
commit5596a9db156107b01ceb7db4d50cc091117da627 (patch)
tree93a485ad83c37f28ba4565292bd13492959d72f8 /drivers/gpu/drm/radeon/r600.c
parent7b1f2485db253aaa0081e1c5213533e166130732 (diff)
downloadlinux-5596a9db156107b01ceb7db4d50cc091117da627.tar.bz2
drm/radeon: make ring rptr and wptr register offsets variable
Every ring seems to have the concept of read and write pointers. Make the register offset variable so we can use the functions for different types of rings. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index eaf57cc75828..599753176741 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1372,7 +1372,7 @@ bool r600_gpu_is_lockup(struct radeon_device *rdev, struct radeon_cp *cp)
radeon_ring_write(cp, 0x80000000);
radeon_ring_unlock_commit(rdev, cp);
}
- cp->rptr = RREG32(R600_CP_RB_RPTR);
+ cp->rptr = RREG32(cp->rptr_reg);
return r100_gpu_cp_is_lockup(rdev, lockup, cp);
}
@@ -2234,12 +2234,6 @@ int r600_cp_resume(struct radeon_device *rdev)
return 0;
}
-void r600_cp_commit(struct radeon_device *rdev, struct radeon_cp *cp)
-{
- WREG32(CP_RB_WPTR, cp->wptr);
- (void)RREG32(CP_RB_WPTR);
-}
-
void r600_ring_init(struct radeon_device *rdev, struct radeon_cp *cp, unsigned ring_size)
{
u32 rb_bufsz;
@@ -2474,7 +2468,9 @@ int r600_startup(struct radeon_device *rdev)
}
r600_irq_set(rdev);
- r = radeon_ring_init(rdev, cp, cp->ring_size);
+ r = radeon_ring_init(rdev, cp, cp->ring_size, RADEON_WB_CP_RPTR_OFFSET,
+ R600_CP_RB_RPTR, R600_CP_RB_WPTR);
+
if (r)
return r;
r = r600_cp_load_microcode(rdev);