diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3618-drm-amdgpu-Correct-sdma_v4-get_wptr-v2.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3618-drm-amdgpu-Correct-sdma_v4-get_wptr-v2.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3618-drm-amdgpu-Correct-sdma_v4-get_wptr-v2.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3618-drm-amdgpu-Correct-sdma_v4-get_wptr-v2.patch new file mode 100644 index 00000000..0695b793 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3618-drm-amdgpu-Correct-sdma_v4-get_wptr-v2.patch @@ -0,0 +1,65 @@ +From 8f482dc94dec57ba5fe95293d6c27847866be342 Mon Sep 17 00:00:00 2001 +From: Emily Deng <Emily.Deng@amd.com> +Date: Wed, 7 Feb 2018 16:17:16 +0800 +Subject: [PATCH 3618/4131] drm/amdgpu: Correct sdma_v4 get_wptr(v2) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the original method will change the wptr value in wb. +v2: +furthur cleanup + +Signed-off-by: Emily Deng <Emily.Deng@amd.com> +Signed-off-by: Monk Liu <Monk.Liu@amd.com> +Reviewed-by: Christian König <christian.koenig@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +index 961f3d1..26bd1e7 100644 +--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +@@ -238,31 +238,27 @@ static uint64_t sdma_v4_0_ring_get_rptr(struct amdgpu_ring *ring) + static uint64_t sdma_v4_0_ring_get_wptr(struct amdgpu_ring *ring) + { + struct amdgpu_device *adev = ring->adev; +- u64 *wptr = NULL; +- uint64_t local_wptr = 0; ++ u64 wptr; + + if (ring->use_doorbell) { + /* XXX check if swapping is necessary on BE */ +- wptr = ((u64 *)&adev->wb.wb[ring->wptr_offs]); +- DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", *wptr); +- *wptr = (*wptr) >> 2; +- DRM_DEBUG("wptr/doorbell after shift == 0x%016llx\n", *wptr); ++ wptr = READ_ONCE(*((u64 *)&adev->wb.wb[ring->wptr_offs])); ++ DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", wptr); + } else { + u32 lowbit, highbit; + int me = (ring == &adev->sdma.instance[0].ring) ? 0 : 1; + +- wptr = &local_wptr; + lowbit = RREG32(sdma_v4_0_get_reg_offset(adev, me, mmSDMA0_GFX_RB_WPTR)) >> 2; + highbit = RREG32(sdma_v4_0_get_reg_offset(adev, me, mmSDMA0_GFX_RB_WPTR_HI)) >> 2; + + DRM_DEBUG("wptr [%i]high== 0x%08x low==0x%08x\n", + me, highbit, lowbit); +- *wptr = highbit; +- *wptr = (*wptr) << 32; +- *wptr |= lowbit; ++ wptr = highbit; ++ wptr = wptr << 32; ++ wptr |= lowbit; + } + +- return *wptr; ++ return wptr >> 2; + } + + /** +-- +2.7.4 + |