drm/amdgpu/smu13: set the threshold for TEMP_HOTSPOT throttling
Subsystems (3)
PATCH v2 1/1 drm/amdgpu/smu13: set the threshold for TEMP_HOTSPOT throttling
ThrottlingPercentage for TEMP_HOTSPOT on SMU v13.0.0/7 is almost always greater then or equal to 1. The THROTTLER_TEMP_HOTSPOT_BIT bit will be set even in idle states and some applications will continue to detect it. Therefore, set a threshold and make it work like any other throttling.
Signed-off-by Umio Yasuno <[email protected]>
---
V1 -> V2: Decrease threshold to 80 and update description
--- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 13 ++++++++++--- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +10 -3
@@ -744,14 +744,21 @@ static int smu_v13_0_0_system_features_control(struct smu_context *smu,return smu_v13_0_system_features_control (smu, en); } +#define SMU_13_0_0_TEMP_HOTSPOT_THRESHOLD 80static uint32_t smu_v13_0_get_throttler_status (SmuMetrics_t *metrics) {uint32_t throttler_status =0 ;int i; -for (i =0 ; i <THROTTLER_COUNT ; i++) - throttler_status |= - (metrics->ThrottlingPercentage[i] ?1U << i :0 ); +for (i =0 ; i <THROTTLER_COUNT ; i++) { +if (i ==THROTTLER_TEMP_HOTSPOT_BIT ) { + throttler_status |= + ((metrics->ThrottlingPercentage[i] >=SMU_13_0_0_TEMP_HOTSPOT_THRESHOLD ) ?1U << i :0 ); + }else { + throttler_status |= + (metrics->ThrottlingPercentage[i] ?1U << i :0 ); + } + }return throttler_status; }
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +10 -3
@@ -736,14 +736,21 @@ static bool smu_v13_0_7_is_dpm_running(struct smu_context *smu)return !!(feature_enabled &SMC_DPM_FEATURE ); } +#define SMU_13_0_7_TEMP_HOTSPOT_THRESHOLD 80static uint32_t smu_v13_0_7_get_throttler_status (SmuMetrics_t *metrics) {uint32_t throttler_status =0 ;int i; -for (i =0 ; i <THROTTLER_COUNT ; i++) - throttler_status |= - (metrics->ThrottlingPercentage[i] ?1U << i :0 ); +for (i =0 ; i <THROTTLER_COUNT ; i++) { +if (i ==THROTTLER_TEMP_HOTSPOT_BIT ) { + throttler_status |= + ((metrics->ThrottlingPercentage[i] >=SMU_13_0_7_TEMP_HOTSPOT_THRESHOLD ) ?1U << i :0 ); + }else { + throttler_status |= + (metrics->ThrottlingPercentage[i] ?1U << i :0 ); + } + }return throttler_status; }
Signature · 1 line
2.39.5