Skip to content

Commit 5f841c3

Browse files
Yang Wanggregkh
authored andcommitted
drm/amd/pm: fix smu v14 soft clock frequency setting issue
commit 239d0cc upstream. v1: resolve the issue where some freq frequencies cannot be set correctly due to insufficient floating-point precision. v2: patch this convert on 'max' value only. Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 53868dd) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 191e22e commit 5f841c3

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ extern const int decoded_link_width[8];
5757

5858
#define DECODE_GEN_SPEED(gen_speed_idx) (decoded_link_speed[gen_speed_idx])
5959
#define DECODE_LANE_WIDTH(lane_width_idx) (decoded_link_width[lane_width_idx])
60+
#define SMU_V14_SOFT_FREQ_ROUND(x) ((x) + 1)
6061

6162
struct smu_14_0_max_sustainable_clocks {
6263
uint32_t display_clock;

drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ int smu_v14_0_set_soft_freq_limited_range(struct smu_context *smu,
11781178
return clk_id;
11791179

11801180
if (max > 0) {
1181+
max = SMU_V14_SOFT_FREQ_ROUND(max);
11811182
if (automatic)
11821183
param = (uint32_t)((clk_id << 16) | 0xffff);
11831184
else

0 commit comments

Comments
 (0)