[PATCH 10/12] drm/amdgpu: Add a read after write DB_CTRL for vcn_v4_0_3

Alex Deucher alexander.deucher at amd.com
Tue May 9 22:11:26 UTC 2023


From: Sonny Jiang <sonny.jiang at amd.com>

To make sure VCN DB_CTRL is delivered before doorbell write.

Signed-off-by: Sonny Jiang <sonny.jiang at amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar at amd.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
index b0e28d611f2d..9d0c3dc76547 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
@@ -195,6 +195,11 @@ static int vcn_v4_0_3_hw_init(void *handle)
 				ring->doorbell_index
 						<< VCN_RB1_DB_CTRL__OFFSET__SHIFT |
 					VCN_RB1_DB_CTRL__EN_MASK);
+
+			/* Read DB_CTRL to flush the write DB_CTRL command. */
+			RREG32_SOC15(
+				VCN, GET_INST(VCN, ring->me),
+				regVCN_RB1_DB_CTRL);
 		}
 
 		r = amdgpu_ring_test_helper(ring);
-- 
2.40.1



More information about the amd-gfx mailing list