@@ -862,6 +862,28 @@ static void vcn_v4_0_enable_clock_gating(struct amdgpu_device *adev, int inst)
862862 return ;
863863}
864864
865+ static void vcn_v4_0_enable_ras (struct amdgpu_device * adev , int inst_idx ,
866+ bool indirect )
867+ {
868+ uint32_t tmp ;
869+
870+ if (!amdgpu_ras_is_supported (adev , AMDGPU_RAS_BLOCK__VCN ))
871+ return ;
872+
873+ tmp = VCN_RAS_CNTL__VCPU_VCODEC_REARM_MASK |
874+ VCN_RAS_CNTL__VCPU_VCODEC_IH_EN_MASK |
875+ VCN_RAS_CNTL__VCPU_VCODEC_PMI_EN_MASK |
876+ VCN_RAS_CNTL__VCPU_VCODEC_STALL_EN_MASK ;
877+ WREG32_SOC15_DPG_MODE (inst_idx ,
878+ SOC15_DPG_MODE_OFFSET (VCN , 0 , regVCN_RAS_CNTL ),
879+ tmp , 0 , indirect );
880+
881+ tmp = UVD_SYS_INT_EN__RASCNTL_VCPU_VCODEC_EN_MASK ;
882+ WREG32_SOC15_DPG_MODE (inst_idx ,
883+ SOC15_DPG_MODE_OFFSET (VCN , 0 , regUVD_SYS_INT_EN ),
884+ tmp , 0 , indirect );
885+ }
886+
865887/**
866888 * vcn_v4_0_start_dpg_mode - VCN start with dpg mode
867889 *
@@ -950,6 +972,8 @@ static int vcn_v4_0_start_dpg_mode(struct amdgpu_device *adev, int inst_idx, boo
950972 WREG32_SOC15_DPG_MODE (inst_idx , SOC15_DPG_MODE_OFFSET (
951973 VCN , inst_idx , regUVD_LMI_CTRL2 ), tmp , 0 , indirect );
952974
975+ vcn_v4_0_enable_ras (adev , inst_idx , indirect );
976+
953977 /* enable master interrupt */
954978 WREG32_SOC15_DPG_MODE (inst_idx , SOC15_DPG_MODE_OFFSET (
955979 VCN , inst_idx , regUVD_MASTINT_EN ),
0 commit comments