@@ -91,6 +91,12 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr)
9191 * MP0CLK DS
9292 */
9393 data -> registry_data .disallowed_features = 0xE0041C00 ;
94+ /* ECC feature should be disabled on old SMUs */
95+ smum_send_msg_to_smc (hwmgr , PPSMC_MSG_GetSmuVersion );
96+ hwmgr -> smu_version = smum_get_argument (hwmgr );
97+ if (hwmgr -> smu_version < 0x282100 )
98+ data -> registry_data .disallowed_features |= FEATURE_ECC_MASK ;
99+
94100 data -> registry_data .od_state_in_dc_support = 0 ;
95101 data -> registry_data .thermal_support = 1 ;
96102 data -> registry_data .skip_baco_hardware = 0 ;
@@ -357,6 +363,7 @@ static void vega20_init_dpm_defaults(struct pp_hwmgr *hwmgr)
357363 data -> smu_features [GNLD_DS_MP1CLK ].smu_feature_id = FEATURE_DS_MP1CLK_BIT ;
358364 data -> smu_features [GNLD_DS_MP0CLK ].smu_feature_id = FEATURE_DS_MP0CLK_BIT ;
359365 data -> smu_features [GNLD_XGMI ].smu_feature_id = FEATURE_XGMI_BIT ;
366+ data -> smu_features [GNLD_ECC ].smu_feature_id = FEATURE_ECC_BIT ;
360367
361368 for (i = 0 ; i < GNLD_FEATURES_MAX ; i ++ ) {
362369 data -> smu_features [i ].smu_feature_bitmap =
@@ -3020,7 +3027,8 @@ static int vega20_get_ppfeature_status(struct pp_hwmgr *hwmgr, char *buf)
30203027 "FCLK_DS" ,
30213028 "MP1CLK_DS" ,
30223029 "MP0CLK_DS" ,
3023- "XGMI" };
3030+ "XGMI" ,
3031+ "ECC" };
30243032 static const char * output_title [] = {
30253033 "FEATURES" ,
30263034 "BITMASK" ,
@@ -3462,6 +3470,7 @@ static int vega20_apply_clocks_adjust_rules(struct pp_hwmgr *hwmgr)
34623470 struct vega20_single_dpm_table * dpm_table ;
34633471 bool vblank_too_short = false;
34643472 bool disable_mclk_switching ;
3473+ bool disable_fclk_switching ;
34653474 uint32_t i , latency ;
34663475
34673476 disable_mclk_switching = ((1 < hwmgr -> display_config -> num_display ) &&
@@ -3537,13 +3546,20 @@ static int vega20_apply_clocks_adjust_rules(struct pp_hwmgr *hwmgr)
35373546 if (hwmgr -> display_config -> nb_pstate_switch_disable )
35383547 dpm_table -> dpm_state .hard_min_level = dpm_table -> dpm_levels [dpm_table -> count - 1 ].value ;
35393548
3549+ if ((disable_mclk_switching &&
3550+ (dpm_table -> dpm_state .hard_min_level == dpm_table -> dpm_levels [dpm_table -> count - 1 ].value )) ||
3551+ hwmgr -> display_config -> min_mem_set_clock / 100 >= dpm_table -> dpm_levels [dpm_table -> count - 1 ].value )
3552+ disable_fclk_switching = true;
3553+ else
3554+ disable_fclk_switching = false;
3555+
35403556 /* fclk */
35413557 dpm_table = & (data -> dpm_table .fclk_table );
35423558 dpm_table -> dpm_state .soft_min_level = dpm_table -> dpm_levels [0 ].value ;
35433559 dpm_table -> dpm_state .soft_max_level = VG20_CLOCK_MAX_DEFAULT ;
35443560 dpm_table -> dpm_state .hard_min_level = dpm_table -> dpm_levels [0 ].value ;
35453561 dpm_table -> dpm_state .hard_max_level = VG20_CLOCK_MAX_DEFAULT ;
3546- if (hwmgr -> display_config -> nb_pstate_switch_disable )
3562+ if (hwmgr -> display_config -> nb_pstate_switch_disable || disable_fclk_switching )
35473563 dpm_table -> dpm_state .soft_min_level = dpm_table -> dpm_levels [dpm_table -> count - 1 ].value ;
35483564
35493565 /* vclk */
0 commit comments