@@ -1954,18 +1954,29 @@ static int sienna_cichlid_set_default_od_settings(struct smu_context *smu)
1954
1954
(OverDriveTable_t * )smu -> smu_table .overdrive_table ;
1955
1955
OverDriveTable_t * boot_od_table =
1956
1956
(OverDriveTable_t * )smu -> smu_table .boot_overdrive_table ;
1957
+ OverDriveTable_t * user_od_table =
1958
+ (OverDriveTable_t * )smu -> smu_table .user_overdrive_table ;
1957
1959
int ret = 0 ;
1958
1960
1961
+ /*
1962
+ * For S3/S4/Runpm resume, no need to setup those overdrive tables again as
1963
+ * - either they already have the default OD settings got during cold bootup
1964
+ * - or they have some user customized OD settings which cannot be overwritten
1965
+ */
1966
+ if (smu -> adev -> in_suspend )
1967
+ return 0 ;
1968
+
1959
1969
ret = smu_cmn_update_table (smu , SMU_TABLE_OVERDRIVE ,
1960
- 0 , (void * )od_table , false);
1970
+ 0 , (void * )boot_od_table , false);
1961
1971
if (ret ) {
1962
1972
dev_err (smu -> adev -> dev , "Failed to get overdrive table!\n" );
1963
1973
return ret ;
1964
1974
}
1965
1975
1966
- memcpy ( boot_od_table , od_table , sizeof ( OverDriveTable_t ) );
1976
+ sienna_cichlid_dump_od_table ( smu , boot_od_table );
1967
1977
1968
- sienna_cichlid_dump_od_table (smu , od_table );
1978
+ memcpy (od_table , boot_od_table , sizeof (OverDriveTable_t ));
1979
+ memcpy (user_od_table , boot_od_table , sizeof (OverDriveTable_t ));
1969
1980
1970
1981
return 0 ;
1971
1982
}
@@ -2128,13 +2139,20 @@ static int sienna_cichlid_od_edit_dpm_table(struct smu_context *smu,
2128
2139
fallthrough ;
2129
2140
2130
2141
case PP_OD_COMMIT_DPM_TABLE :
2131
- sienna_cichlid_dump_od_table (smu , od_table );
2142
+ if (memcmp (od_table , table_context -> user_overdrive_table , sizeof (OverDriveTable_t ))) {
2143
+ sienna_cichlid_dump_od_table (smu , od_table );
2144
+ ret = smu_cmn_update_table (smu , SMU_TABLE_OVERDRIVE , 0 , (void * )od_table , true);
2145
+ if (ret ) {
2146
+ dev_err (smu -> adev -> dev , "Failed to import overdrive table!\n" );
2147
+ return ret ;
2148
+ }
2149
+ memcpy (table_context -> user_overdrive_table , od_table , sizeof (OverDriveTable_t ));
2150
+ smu -> user_dpm_profile .user_od = true;
2132
2151
2133
- ret = smu_cmn_update_table (smu , SMU_TABLE_OVERDRIVE ,
2134
- 0 , (void * )od_table , true);
2135
- if (ret ) {
2136
- dev_err (smu -> adev -> dev , "Failed to import overdrive table!\n" );
2137
- return ret ;
2152
+ if (!memcmp (table_context -> user_overdrive_table ,
2153
+ table_context -> boot_overdrive_table ,
2154
+ sizeof (OverDriveTable_t )))
2155
+ smu -> user_dpm_profile .user_od = false;
2138
2156
}
2139
2157
break ;
2140
2158
@@ -3902,6 +3920,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = {
3902
3920
.set_soft_freq_limited_range = smu_v11_0_set_soft_freq_limited_range ,
3903
3921
.set_default_od_settings = sienna_cichlid_set_default_od_settings ,
3904
3922
.od_edit_dpm_table = sienna_cichlid_od_edit_dpm_table ,
3923
+ .restore_user_od_settings = smu_v11_0_restore_user_od_settings ,
3905
3924
.run_btc = sienna_cichlid_run_btc ,
3906
3925
.set_power_source = smu_v11_0_set_power_source ,
3907
3926
.get_pp_feature_mask = smu_cmn_get_pp_feature_mask ,
0 commit comments