summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
diff options
context:
space:
mode:
authorHaohui Mai <ricetons@gmail.com>2022-04-25 20:23:38 +0800
committerAlex Deucher <alexander.deucher@amd.com>2022-04-26 11:44:06 -0400
commitca5d251b3b6e3aabf2d1bb7261c6b8e156b7ee16 (patch)
tree6c00c46f2910668320ec41b5d21515c90b7863fd /drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
parent7dba6e838e741caadcf27ef717b6dcb561e77f89 (diff)
downloadlinux-stable-ca5d251b3b6e3aabf2d1bb7261c6b8e156b7ee16.tar.gz
linux-stable-ca5d251b3b6e3aabf2d1bb7261c6b8e156b7ee16.tar.bz2
linux-stable-ca5d251b3b6e3aabf2d1bb7261c6b8e156b7ee16.zip
drm/amdgpu/sdma: Remove redundant lower_32_bits() calls when settings SDMA doorbell
Updated the patch for the pre-vega hardware. I kept the clamping code to be safe. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Haohui Mai <ricetons@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index 3695374896ed..8af5c94d526a 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -389,14 +389,14 @@ static void sdma_v3_0_ring_set_wptr(struct amdgpu_ring *ring)
if (ring->use_doorbell) {
u32 *wb = (u32 *)&adev->wb.wb[ring->wptr_offs];
/* XXX check if swapping is necessary on BE */
- WRITE_ONCE(*wb, (lower_32_bits(ring->wptr) << 2));
- WDOORBELL32(ring->doorbell_index, lower_32_bits(ring->wptr) << 2);
+ WRITE_ONCE(*wb, ring->wptr << 2);
+ WDOORBELL32(ring->doorbell_index, ring->wptr << 2);
} else if (ring->use_pollmem) {
u32 *wb = (u32 *)&adev->wb.wb[ring->wptr_offs];
- WRITE_ONCE(*wb, (lower_32_bits(ring->wptr) << 2));
+ WRITE_ONCE(*wb, ring->wptr << 2);
} else {
- WREG32(mmSDMA0_GFX_RB_WPTR + sdma_offsets[ring->me], lower_32_bits(ring->wptr) << 2);
+ WREG32(mmSDMA0_GFX_RB_WPTR + sdma_offsets[ring->me], ring->wptr << 2);
}
}