Skip to content

Commit 85e0689

Browse files
Horatio Zhangalexdeucher
authored andcommitted
drm/amd/pm: correct SMU13.0.7 max shader clock reporting
Correct the max shader clock reporting on SMU 13.0.7. Signed-off-by: Horatio Zhang <[email protected]> Reviewed-by: Kenneth Feng <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.1.x
1 parent f06b888 commit 85e0689

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,14 @@ static int smu_v13_0_7_set_default_dpm_table(struct smu_context *smu)
575575
dpm_table);
576576
if (ret)
577577
return ret;
578+
579+
if (skutable->DriverReportedClocks.GameClockAc &&
580+
(dpm_table->dpm_levels[dpm_table->count - 1].value >
581+
skutable->DriverReportedClocks.GameClockAc)) {
582+
dpm_table->dpm_levels[dpm_table->count - 1].value =
583+
skutable->DriverReportedClocks.GameClockAc;
584+
dpm_table->max = skutable->DriverReportedClocks.GameClockAc;
585+
}
578586
} else {
579587
dpm_table->count = 1;
580588
dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.gfxclk / 100;
@@ -828,6 +836,57 @@ static int smu_v13_0_7_get_smu_metrics_data(struct smu_context *smu,
828836
return ret;
829837
}
830838

839+
static int smu_v13_0_7_get_dpm_ultimate_freq(struct smu_context *smu,
840+
enum smu_clk_type clk_type,
841+
uint32_t *min,
842+
uint32_t *max)
843+
{
844+
struct smu_13_0_dpm_context *dpm_context =
845+
smu->smu_dpm.dpm_context;
846+
struct smu_13_0_dpm_table *dpm_table;
847+
848+
switch (clk_type) {
849+
case SMU_MCLK:
850+
case SMU_UCLK:
851+
/* uclk dpm table */
852+
dpm_table = &dpm_context->dpm_tables.uclk_table;
853+
break;
854+
case SMU_GFXCLK:
855+
case SMU_SCLK:
856+
/* gfxclk dpm table */
857+
dpm_table = &dpm_context->dpm_tables.gfx_table;
858+
break;
859+
case SMU_SOCCLK:
860+
/* socclk dpm table */
861+
dpm_table = &dpm_context->dpm_tables.soc_table;
862+
break;
863+
case SMU_FCLK:
864+
/* fclk dpm table */
865+
dpm_table = &dpm_context->dpm_tables.fclk_table;
866+
break;
867+
case SMU_VCLK:
868+
case SMU_VCLK1:
869+
/* vclk dpm table */
870+
dpm_table = &dpm_context->dpm_tables.vclk_table;
871+
break;
872+
case SMU_DCLK:
873+
case SMU_DCLK1:
874+
/* dclk dpm table */
875+
dpm_table = &dpm_context->dpm_tables.dclk_table;
876+
break;
877+
default:
878+
dev_err(smu->adev->dev, "Unsupported clock type!\n");
879+
return -EINVAL;
880+
}
881+
882+
if (min)
883+
*min = dpm_table->min;
884+
if (max)
885+
*max = dpm_table->max;
886+
887+
return 0;
888+
}
889+
831890
static int smu_v13_0_7_read_sensor(struct smu_context *smu,
832891
enum amd_pp_sensors sensor,
833892
void *data,
@@ -1684,7 +1743,7 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
16841743
.dpm_set_jpeg_enable = smu_v13_0_set_jpeg_enable,
16851744
.init_pptable_microcode = smu_v13_0_init_pptable_microcode,
16861745
.populate_umd_state_clk = smu_v13_0_7_populate_umd_state_clk,
1687-
.get_dpm_ultimate_freq = smu_v13_0_get_dpm_ultimate_freq,
1746+
.get_dpm_ultimate_freq = smu_v13_0_7_get_dpm_ultimate_freq,
16881747
.get_vbios_bootup_values = smu_v13_0_get_vbios_bootup_values,
16891748
.read_sensor = smu_v13_0_7_read_sensor,
16901749
.feature_is_enabled = smu_cmn_feature_is_enabled,

0 commit comments

Comments
 (0)