Skip to content

Commit 27d196c

Browse files
timhuang-amdalexdeucher
authored andcommitted
drm/amd/pm: fix vclk setting failed for SMU v13.0.4
PMFW use the left-shifted 16 bits argument to set the VCLK DPM frequency for SMU v13.0.4. Signed-off-by: Tim Huang <Tim.Huang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent cab69d3 commit 27d196c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#define CTF_OFFSET_HOTSPOT 5
5252
#define CTF_OFFSET_MEM 5
5353

54+
#define SMU_13_VCLK_SHIFT 16
55+
5456
extern const int pmfw_decoded_link_speed[5];
5557
extern const int pmfw_decoded_link_width[7];
5658

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,8 @@ static int smu_v13_0_4_set_soft_freq_limited_range(struct smu_context *smu,
831831
uint32_t max)
832832
{
833833
enum smu_message_type msg_set_min, msg_set_max;
834+
uint32_t min_clk = min;
835+
uint32_t max_clk = max;
834836
int ret = 0;
835837

836838
if (!smu_v13_0_4_clk_dpm_is_enabled(smu, clk_type))
@@ -859,12 +861,17 @@ static int smu_v13_0_4_set_soft_freq_limited_range(struct smu_context *smu,
859861
return -EINVAL;
860862
}
861863

862-
ret = smu_cmn_send_smc_msg_with_param(smu, msg_set_min, min, NULL);
864+
if (clk_type == SMU_VCLK) {
865+
min_clk = min << SMU_13_VCLK_SHIFT;
866+
max_clk = max << SMU_13_VCLK_SHIFT;
867+
}
868+
869+
ret = smu_cmn_send_smc_msg_with_param(smu, msg_set_min, min_clk, NULL);
863870
if (ret)
864871
return ret;
865872

866873
return smu_cmn_send_smc_msg_with_param(smu, msg_set_max,
867-
max, NULL);
874+
max_clk, NULL);
868875
}
869876

870877
static int smu_v13_0_4_force_clk_levels(struct smu_context *smu,

0 commit comments

Comments
 (0)