Reset decode r/w point after unset jpeg/non_jpeg pause mode to address a hardware bug. Signed-off-by: James Zhu <James.Zhu@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c index 564ed94..dab68e7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c @@ -288,6 +288,10 @@ static int amdgpu_vcn_pause_dpg_mode(struct amdgpu_device *adev, /* unpause dpg non-jpeg, no need to wait */ reg_data &= ~UVD_DPG_PAUSE__NJ_PAUSE_DPG_REQ_MASK; WREG32_SOC15(UVD, 0, mmUVD_DPG_PAUSE, reg_data); + SOC15_WAIT_ON_RREG(UVD, 0, mmUVD_RBC_RB_RPTR, 0, 0xFFFFFFFF, ret_code); + WREG32_SOC15(UVD, 0, mmUVD_RBC_RB_RPTR, tmp); + WREG32_SOC15(UVD, 0, mmUVD_RBC_RB_WPTR, tmp); + SOC15_WAIT_ON_RREG(UVD, 0, mmUVD_RBC_RB_RPTR, tmp, 0xFFFFFFFF, ret_code); } adev->vcn.pause_state.fw_based = new_state->fw_based; } @@ -348,6 +352,10 @@ static int amdgpu_vcn_pause_dpg_mode(struct amdgpu_device *adev, /* unpause dpg jpeg, no need to wait */ reg_data &= ~UVD_DPG_PAUSE__JPEG_PAUSE_DPG_REQ_MASK; WREG32_SOC15(UVD, 0, mmUVD_DPG_PAUSE, reg_data); + SOC15_WAIT_ON_RREG(UVD, 0, mmUVD_RBC_RB_RPTR, 0, 0xFFFFFFFF, ret_code); + WREG32_SOC15(UVD, 0, mmUVD_RBC_RB_RPTR, tmp); + WREG32_SOC15(UVD, 0, mmUVD_RBC_RB_WPTR, tmp); + SOC15_WAIT_ON_RREG(UVD, 0, mmUVD_RBC_RB_RPTR, tmp, 0xFFFFFFFF, ret_code); } adev->vcn.pause_state.jpeg = new_state->jpeg; } -- 2.7.4 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx