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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/pm: fix smu v13 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>

authored by

Yang Wang and committed by
Alex Deucher
6194f60c 1bf8b464

+2
+1
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
··· 55 55 #define SMUQ10_TO_UINT(x) ((x) >> 10) 56 56 #define SMUQ10_FRAC(x) ((x) & 0x3ff) 57 57 #define SMUQ10_ROUND(x) ((SMUQ10_TO_UINT(x)) + ((SMUQ10_FRAC(x)) >= 0x200)) 58 + #define SMU_V13_SOFT_FREQ_ROUND(x) ((x) + 1) 58 59 59 60 extern const int pmfw_decoded_link_speed[5]; 60 61 extern const int pmfw_decoded_link_width[7];
+1
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
··· 1554 1554 return clk_id; 1555 1555 1556 1556 if (max > 0) { 1557 + max = SMU_V13_SOFT_FREQ_ROUND(max); 1557 1558 if (automatic) 1558 1559 param = (uint32_t)((clk_id << 16) | 0xffff); 1559 1560 else