aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ring.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ring.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index fb5ea6208970..46a25f037b84 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -363,11 +363,10 @@ u32 radeon_ring_generic_get_rptr(struct radeon_device *rdev,
363{ 363{
364 u32 rptr; 364 u32 rptr;
365 365
366 if (rdev->wb.enabled && ring != &rdev->ring[R600_RING_TYPE_UVD_INDEX]) 366 if (rdev->wb.enabled)
367 rptr = le32_to_cpu(rdev->wb.wb[ring->rptr_offs/4]); 367 rptr = le32_to_cpu(rdev->wb.wb[ring->rptr_offs/4]);
368 else 368 else
369 rptr = RREG32(ring->rptr_reg); 369 rptr = RREG32(ring->rptr_reg);
370 rptr = (rptr & ring->ptr_reg_mask) >> ring->ptr_reg_shift;
371 370
372 return rptr; 371 return rptr;
373} 372}
@@ -378,7 +377,6 @@ u32 radeon_ring_generic_get_wptr(struct radeon_device *rdev,
378 u32 wptr; 377 u32 wptr;
379 378
380 wptr = RREG32(ring->wptr_reg); 379 wptr = RREG32(ring->wptr_reg);
381 wptr = (wptr & ring->ptr_reg_mask) >> ring->ptr_reg_shift;
382 380
383 return wptr; 381 return wptr;
384} 382}
@@ -386,7 +384,7 @@ u32 radeon_ring_generic_get_wptr(struct radeon_device *rdev,
386void radeon_ring_generic_set_wptr(struct radeon_device *rdev, 384void radeon_ring_generic_set_wptr(struct radeon_device *rdev,
387 struct radeon_ring *ring) 385 struct radeon_ring *ring)
388{ 386{
389 WREG32(ring->wptr_reg, (ring->wptr << ring->ptr_reg_shift) & ring->ptr_reg_mask); 387 WREG32(ring->wptr_reg, ring->wptr);
390 (void)RREG32(ring->wptr_reg); 388 (void)RREG32(ring->wptr_reg);
391} 389}
392 390
@@ -719,16 +717,13 @@ int radeon_ring_restore(struct radeon_device *rdev, struct radeon_ring *ring,
719 * @rptr_offs: offset of the rptr writeback location in the WB buffer 717 * @rptr_offs: offset of the rptr writeback location in the WB buffer
720 * @rptr_reg: MMIO offset of the rptr register 718 * @rptr_reg: MMIO offset of the rptr register
721 * @wptr_reg: MMIO offset of the wptr register 719 * @wptr_reg: MMIO offset of the wptr register
722 * @ptr_reg_shift: bit offset of the rptr/wptr values
723 * @ptr_reg_mask: bit mask of the rptr/wptr values
724 * @nop: nop packet for this ring 720 * @nop: nop packet for this ring
725 * 721 *
726 * Initialize the driver information for the selected ring (all asics). 722 * Initialize the driver information for the selected ring (all asics).
727 * Returns 0 on success, error on failure. 723 * Returns 0 on success, error on failure.
728 */ 724 */
729int radeon_ring_init(struct radeon_device *rdev, struct radeon_ring *ring, unsigned ring_size, 725int radeon_ring_init(struct radeon_device *rdev, struct radeon_ring *ring, unsigned ring_size,
730 unsigned rptr_offs, unsigned rptr_reg, unsigned wptr_reg, 726 unsigned rptr_offs, unsigned rptr_reg, unsigned wptr_reg, u32 nop)
731 u32 ptr_reg_shift, u32 ptr_reg_mask, u32 nop)
732{ 727{
733 int r; 728 int r;
734 729
@@ -736,8 +731,6 @@ int radeon_ring_init(struct radeon_device *rdev, struct radeon_ring *ring, unsig
736 ring->rptr_offs = rptr_offs; 731 ring->rptr_offs = rptr_offs;
737 ring->rptr_reg = rptr_reg; 732 ring->rptr_reg = rptr_reg;
738 ring->wptr_reg = wptr_reg; 733 ring->wptr_reg = wptr_reg;
739 ring->ptr_reg_shift = ptr_reg_shift;
740 ring->ptr_reg_mask = ptr_reg_mask;
741 ring->nop = nop; 734 ring->nop = nop;
742 /* Allocate ring buffer */ 735 /* Allocate ring buffer */
743 if (ring->ring_obj == NULL) { 736 if (ring->ring_obj == NULL) {