From: Monk Liu Date: Wed, 2 Nov 2016 07:33:46 +0000 (+0800) Subject: drm/amdgpu/gfx9: programing wptr_poll_addr register X-Git-Tag: v4.14-rc1~674^2~26^2~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fc08b61df3837701fd6665c1b2b3df7ca44225b;p=platform%2Fkernel%2Flinux-rpi3.git drm/amdgpu/gfx9: programing wptr_poll_addr register Required for SR-IOV. Signed-off-by: Monk Liu Signed-off-by: Xiangliang Yu Reviewed-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index e0a3cdc..4c1c5b5 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -1502,7 +1502,7 @@ static int gfx_v9_0_cp_gfx_resume(struct amdgpu_device *adev) struct amdgpu_ring *ring; u32 tmp; u32 rb_bufsz; - u64 rb_addr, rptr_addr; + u64 rb_addr, rptr_addr, wptr_gpu_addr; /* Set the write pointer delay */ WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_RB_WPTR_DELAY), 0); @@ -1530,6 +1530,10 @@ static int gfx_v9_0_cp_gfx_resume(struct amdgpu_device *adev) WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_RB0_RPTR_ADDR), lower_32_bits(rptr_addr)); WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_RB0_RPTR_ADDR_HI), upper_32_bits(rptr_addr) & CP_RB_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK); + wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs * 4); + WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_RB_WPTR_POLL_ADDR_LO), lower_32_bits(wptr_gpu_addr)); + WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_RB_WPTR_POLL_ADDR_HI), upper_32_bits(wptr_gpu_addr)); + mdelay(1); WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_RB0_CNTL), tmp);