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

drm/amd/pm: setup zero rpm parameters for polaris10

Only if the ZeroRPM feature is supported.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Evan Quan and committed by
Alex Deucher
9610a3bf c420418f

+29
+1
drivers/gpu/drm/amd/pm/inc/smu7_ppsmc.h
··· 394 394 395 395 #define PPSMC_MSG_SetGpuPllDfsForSclk ((uint16_t) 0x300) 396 396 #define PPSMC_MSG_Didt_Block_Function ((uint16_t) 0x301) 397 + #define PPSMC_MSG_EnableZeroRpm ((uint16_t) 0x302) 397 398 398 399 #define PPSMC_MSG_SetVBITimeout ((uint16_t) 0x306) 399 400
+11
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_thermal.c
··· 175 175 hwmgr->thermal_controller. 176 176 advanceFanControlParameters.ucTargetTemperature, 177 177 NULL); 178 + 179 + if (!result && 180 + (hwmgr->chip_id == CHIP_POLARIS10 || 181 + hwmgr->chip_id == CHIP_POLARIS11 || 182 + hwmgr->chip_id == CHIP_POLARIS12) && 183 + hwmgr->thermal_controller.advanceFanControlParameters.ucEnableZeroRPM && 184 + !PP_CAP(PHM_PlatformCaps_customThermalManagement)) 185 + result = smum_send_msg_to_smc(hwmgr, 186 + PPSMC_MSG_EnableZeroRpm, 187 + NULL); 188 + 178 189 hwmgr->fan_ctrl_enabled = true; 179 190 180 191 return result;
+17
drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
··· 470 470 return 0; 471 471 } 472 472 473 + static void polaris10_populate_zero_rpm_parameters(struct pp_hwmgr *hwmgr) 474 + { 475 + struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smu_backend); 476 + SMU74_Discrete_DpmTable *table = &(smu_data->smc_state_table); 477 + uint16_t fan_stop_temp = 478 + ((uint16_t)hwmgr->thermal_controller.advanceFanControlParameters.ucFanStopTemperature) << 8; 479 + uint16_t fan_start_temp = 480 + ((uint16_t)hwmgr->thermal_controller.advanceFanControlParameters.ucFanStartTemperature) << 8; 481 + 482 + if (hwmgr->thermal_controller.advanceFanControlParameters.ucEnableZeroRPM) { 483 + table->FanStartTemperature = PP_HOST_TO_SMC_US(fan_start_temp); 484 + table->FanStopTemperature = PP_HOST_TO_SMC_US(fan_stop_temp); 485 + } 486 + } 487 + 473 488 static int polaris10_populate_svi_load_line(struct pp_hwmgr *hwmgr) 474 489 { 475 490 struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smu_backend); ··· 1963 1948 result = polaris10_populate_bapm_parameters_in_dpm_table(hwmgr); 1964 1949 PP_ASSERT_WITH_CODE(0 == result, 1965 1950 "Failed to populate BAPM Parameters!", return result); 1951 + 1952 + polaris10_populate_zero_rpm_parameters(hwmgr); 1966 1953 1967 1954 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, 1968 1955 PHM_PlatformCaps_ClockStretcher)) {