@@ -691,13 +691,25 @@ static bool navi10_is_support_fine_grained_dpm(struct smu_context *smu, enum smu
691
691
return dpm_desc -> SnapToDiscrete == 0 ? true : false;
692
692
}
693
693
694
+ static inline bool navi10_od_feature_is_supported (struct smu_11_0_overdrive_table * od_table , enum SMU_11_0_ODFEATURE_ID feature )
695
+ {
696
+ return od_table -> cap [feature ];
697
+ }
698
+
699
+
694
700
static int navi10_print_clk_levels (struct smu_context * smu ,
695
701
enum smu_clk_type clk_type , char * buf )
696
702
{
703
+ OverDriveTable_t * od_table ;
704
+ struct smu_11_0_overdrive_table * od_settings ;
705
+ uint16_t * curve_settings ;
697
706
int i , size = 0 , ret = 0 ;
698
707
uint32_t cur_value = 0 , value = 0 , count = 0 ;
699
708
uint32_t freq_values [3 ] = {0 };
700
709
uint32_t mark_index = 0 ;
710
+ struct smu_table_context * table_context = & smu -> smu_table ;
711
+ od_table = (OverDriveTable_t * )table_context -> overdrive_table ;
712
+ od_settings = smu -> od_settings ;
701
713
702
714
switch (clk_type ) {
703
715
case SMU_GFXCLK :
@@ -748,6 +760,45 @@ static int navi10_print_clk_levels(struct smu_context *smu,
748
760
749
761
}
750
762
break ;
763
+ case SMU_OD_SCLK :
764
+ if (!smu -> od_enabled || !od_table || !od_settings )
765
+ break ;
766
+ if (!navi10_od_feature_is_supported (od_settings , SMU_11_0_ODFEATURE_GFXCLK_LIMITS ))
767
+ break ;
768
+ size += sprintf (buf + size , "OD_SCLK:\n" );
769
+ size += sprintf (buf + size , "0: %uMhz\n1: %uMhz\n" , od_table -> GfxclkFmin , od_table -> GfxclkFmax );
770
+ break ;
771
+ case SMU_OD_MCLK :
772
+ if (!smu -> od_enabled || !od_table || !od_settings )
773
+ break ;
774
+ if (!navi10_od_feature_is_supported (od_settings , SMU_11_0_ODFEATURE_UCLK_MAX ))
775
+ break ;
776
+ size += sprintf (buf + size , "OD_MCLK:\n" );
777
+ size += sprintf (buf + size , "0: %uMHz\n" , od_table -> UclkFmax );
778
+ break ;
779
+ case SMU_OD_VDDC_CURVE :
780
+ if (!smu -> od_enabled || !od_table || !od_settings )
781
+ break ;
782
+ if (!navi10_od_feature_is_supported (od_settings , SMU_11_0_ODFEATURE_GFXCLK_CURVE ))
783
+ break ;
784
+ size += sprintf (buf + size , "OD_VDDC_CURVE:\n" );
785
+ for (i = 0 ; i < 3 ; i ++ ) {
786
+ switch (i ) {
787
+ case 0 :
788
+ curve_settings = & od_table -> GfxclkFreq1 ;
789
+ break ;
790
+ case 1 :
791
+ curve_settings = & od_table -> GfxclkFreq2 ;
792
+ break ;
793
+ case 2 :
794
+ curve_settings = & od_table -> GfxclkFreq3 ;
795
+ break ;
796
+ default :
797
+ break ;
798
+ }
799
+ size += sprintf (buf + size , "%d: %uMHz @ %umV\n" , i , curve_settings [0 ], curve_settings [1 ] / NAVI10_VOLTAGE_SCALE );
800
+ }
801
+ break ;
751
802
default :
752
803
break ;
753
804
}
@@ -1661,11 +1712,6 @@ static inline void navi10_dump_od_table(OverDriveTable_t *od_table) {
1661
1712
pr_debug ("OD: OverDrivePct: %d\n" , od_table -> OverDrivePct );
1662
1713
}
1663
1714
1664
- static inline bool navi10_od_feature_is_supported (struct smu_11_0_overdrive_table * od_table , enum SMU_11_0_ODFEATURE_ID feature )
1665
- {
1666
- return od_table -> cap [feature ];
1667
- }
1668
-
1669
1715
static int navi10_od_setting_check_range (struct smu_11_0_overdrive_table * od_table , enum SMU_11_0_ODSETTING_ID setting , uint32_t value )
1670
1716
{
1671
1717
if (value < od_table -> min [setting ]) {
0 commit comments