mirror of
https://github.com/torvalds/linux.git
synced 2026-05-21 13:27:57 +02:00
drm/amdgpu/vcn5: read back register after written
The addition of register read-back in VCN v5.0.0 is intended to prevent potential race conditions. Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Signed-off-by: David (Ming Qiang) Wu <David.Wu3@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
4d4275a038
commit
a8bce9b7a2
|
|
@ -794,6 +794,11 @@ static int vcn_v5_0_0_start_dpg_mode(struct amdgpu_vcn_inst *vinst,
|
|||
ring->doorbell_index << VCN_RB1_DB_CTRL__OFFSET__SHIFT |
|
||||
VCN_RB1_DB_CTRL__EN_MASK);
|
||||
|
||||
/* Keeping one read-back to ensure all register writes are done,
|
||||
* otherwise it may introduce race conditions.
|
||||
*/
|
||||
RREG32_SOC15(VCN, inst_idx, regUVD_STATUS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -946,6 +951,11 @@ static int vcn_v5_0_0_start(struct amdgpu_vcn_inst *vinst)
|
|||
WREG32_SOC15(VCN, i, regVCN_RB_ENABLE, tmp);
|
||||
fw_shared->sq.queue_mode &= ~(FW_QUEUE_RING_RESET | FW_QUEUE_DPG_HOLD_OFF);
|
||||
|
||||
/* Keeping one read-back to ensure all register writes are done,
|
||||
* otherwise it may introduce race conditions.
|
||||
*/
|
||||
RREG32_SOC15(VCN, i, regUVD_STATUS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -977,6 +987,11 @@ static void vcn_v5_0_0_stop_dpg_mode(struct amdgpu_vcn_inst *vinst)
|
|||
WREG32_P(SOC15_REG_OFFSET(VCN, inst_idx, regUVD_POWER_STATUS), 0,
|
||||
~UVD_POWER_STATUS__UVD_PG_MODE_MASK);
|
||||
|
||||
/* Keeping one read-back to ensure all register writes are done,
|
||||
* otherwise it may introduce race conditions.
|
||||
*/
|
||||
RREG32_SOC15(VCN, inst_idx, regUVD_STATUS);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1058,6 +1073,11 @@ static int vcn_v5_0_0_stop(struct amdgpu_vcn_inst *vinst)
|
|||
/* enable VCN power gating */
|
||||
vcn_v5_0_0_enable_static_power_gating(vinst);
|
||||
|
||||
/* Keeping one read-back to ensure all register writes are done,
|
||||
* otherwise it may introduce race conditions.
|
||||
*/
|
||||
RREG32_SOC15(VCN, i, regUVD_STATUS);
|
||||
|
||||
done:
|
||||
if (adev->pm.dpm_enabled)
|
||||
amdgpu_dpm_enable_vcn(adev, false, i);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user