Commit 2a5ae84b authored by Junwei Zhang's avatar Junwei Zhang Committed by Alex Deucher

drm/amdgpu: fix gfx wptr for sdma v4

The wptr value will be shitfed when function returns.
Remove the redundant shift and clean up.
Signed-off-by: default avatarJunwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1cf03c54
...@@ -372,16 +372,11 @@ static uint64_t sdma_v4_0_ring_get_wptr(struct amdgpu_ring *ring) ...@@ -372,16 +372,11 @@ static uint64_t sdma_v4_0_ring_get_wptr(struct amdgpu_ring *ring)
wptr = READ_ONCE(*((u64 *)&adev->wb.wb[ring->wptr_offs])); wptr = READ_ONCE(*((u64 *)&adev->wb.wb[ring->wptr_offs]));
DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", wptr); DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", wptr);
} else { } else {
u32 lowbit, highbit; wptr = RREG32_SDMA(ring->me, mmSDMA0_GFX_RB_WPTR_HI);
lowbit = RREG32_SDMA(ring->me, mmSDMA0_GFX_RB_WPTR) >> 2;
highbit = RREG32_SDMA(ring->me, mmSDMA0_GFX_RB_WPTR_HI) >> 2;
DRM_DEBUG("wptr [%i]high== 0x%08x low==0x%08x\n",
ring->me, highbit, lowbit);
wptr = highbit;
wptr = wptr << 32; wptr = wptr << 32;
wptr |= lowbit; wptr |= RREG32_SDMA(ring->me, mmSDMA0_GFX_RB_WPTR);
DRM_DEBUG("wptr before shift [%i] wptr == 0x%016llx\n",
ring->me, wptr);
} }
return wptr >> 2; return wptr >> 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment