Skip to content

Commit ee7360f

Browse files
davidwuAMDalexdeucher
authored andcommitted
drm/amdgpu: read back register after written for VCN v4.0.5
On VCN v4.0.5 there is a race condition where the WPTR is not updated after starting from idle when doorbell is used. Adding register read-back after written at function end is to ensure all register writes are done before they can be used. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12528 Signed-off-by: David (Ming Qiang) Wu <David.Wu3@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Tested-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 07c9db0) Cc: stable@vger.kernel.org
1 parent fe14c0f commit ee7360f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,10 @@ static int vcn_v4_0_5_start_dpg_mode(struct amdgpu_vcn_inst *vinst,
10231023
ring->doorbell_index << VCN_RB1_DB_CTRL__OFFSET__SHIFT |
10241024
VCN_RB1_DB_CTRL__EN_MASK);
10251025

1026+
/* Keeping one read-back to ensure all register writes are done, otherwise
1027+
* it may introduce race conditions */
1028+
RREG32_SOC15(VCN, inst_idx, regVCN_RB1_DB_CTRL);
1029+
10261030
return 0;
10271031
}
10281032

@@ -1205,6 +1209,10 @@ static int vcn_v4_0_5_start(struct amdgpu_vcn_inst *vinst)
12051209
WREG32_SOC15(VCN, i, regVCN_RB_ENABLE, tmp);
12061210
fw_shared->sq.queue_mode &= ~(FW_QUEUE_RING_RESET | FW_QUEUE_DPG_HOLD_OFF);
12071211

1212+
/* Keeping one read-back to ensure all register writes are done, otherwise
1213+
* it may introduce race conditions */
1214+
RREG32_SOC15(VCN, i, regVCN_RB_ENABLE);
1215+
12081216
return 0;
12091217
}
12101218

0 commit comments

Comments
 (0)