From: Sonny Jiang <sonny.ji...@amd.com>

To make sure VCN DB_CTRL is delivered before doorbell write.

Signed-off-by: Sonny Jiang <sonny.ji...@amd.com>
Reviewed-by: Lijo Lazar <lijo.la...@amd.com>
Signed-off-by: Alex Deucher <alexander.deuc...@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

Reply via email to