Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/pm: fix smu v14 soft clock frequency setting issue

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 53868dd8774344051999c880115740da92f97feb)
Cc: stable@vger.kernel.org

authored by

Yang Wang and committed by
Alex Deucher
239d0ccf c764b7af

+2
+1
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v14_0.h
··· 57 57 58 58 #define DECODE_GEN_SPEED(gen_speed_idx) (decoded_link_speed[gen_speed_idx]) 59 59 #define DECODE_LANE_WIDTH(lane_width_idx) (decoded_link_width[lane_width_idx]) 60 + #define SMU_V14_SOFT_FREQ_ROUND(x) ((x) + 1) 60 61 61 62 struct smu_14_0_max_sustainable_clocks { 62 63 uint32_t display_clock;
+1
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c
··· 1178 1178 return clk_id; 1179 1179 1180 1180 if (max > 0) { 1181 + max = SMU_V14_SOFT_FREQ_ROUND(max); 1181 1182 if (automatic) 1182 1183 param = (uint32_t)((clk_id << 16) | 0xffff); 1183 1184 else