Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David (Ming Qiang) Wu and committed by
Alex Deucher
07c9db09 f6a305d4

+8
+8
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
··· 1034 1034 ring->doorbell_index << VCN_RB1_DB_CTRL__OFFSET__SHIFT | 1035 1035 VCN_RB1_DB_CTRL__EN_MASK); 1036 1036 1037 + /* Keeping one read-back to ensure all register writes are done, otherwise 1038 + * it may introduce race conditions */ 1039 + RREG32_SOC15(VCN, inst_idx, regVCN_RB1_DB_CTRL); 1040 + 1037 1041 return 0; 1038 1042 } 1039 1043 ··· 1219 1215 tmp |= VCN_RB_ENABLE__RB1_EN_MASK; 1220 1216 WREG32_SOC15(VCN, i, regVCN_RB_ENABLE, tmp); 1221 1217 fw_shared->sq.queue_mode &= ~(FW_QUEUE_RING_RESET | FW_QUEUE_DPG_HOLD_OFF); 1218 + 1219 + /* Keeping one read-back to ensure all register writes are done, otherwise 1220 + * it may introduce race conditions */ 1221 + RREG32_SOC15(VCN, i, regVCN_RB_ENABLE); 1222 1222 1223 1223 return 0; 1224 1224 }