diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2016-03-23 03:04:23 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-04 20:29:03 -0400 |
commit | e16ff21d2a694a317b62318822090c5350e58088 (patch) | |
tree | c46ccb5f4f529db767c7da21098dfa4ceeeb8b31 | |
parent | 9e26bbb36ad6cac78accf959271604449d9ee887 (diff) |
drm/amd/powerplay: parameter updates according to SMC.
Update to latest changes for SMC team.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_powertune.c | 32 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h | 10 |
2 files changed, 22 insertions, 20 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_powertune.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_powertune.c index 4d97326517e5..02bcedc7f549 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_powertune.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_powertune.c | |||
@@ -57,6 +57,13 @@ void polaris10_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr) | |||
57 | 57 | ||
58 | } | 58 | } |
59 | 59 | ||
60 | static uint16_t scale_fan_gain_settings(uint16_t raw_setting) | ||
61 | { | ||
62 | uint32_t tmp; | ||
63 | tmp = raw_setting * 4096 / 100; | ||
64 | return (uint16_t)tmp; | ||
65 | } | ||
66 | |||
60 | int polaris10_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr) | 67 | int polaris10_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr) |
61 | { | 68 | { |
62 | struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend); | 69 | struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend); |
@@ -65,6 +72,8 @@ int polaris10_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr) | |||
65 | struct phm_ppt_v1_information *table_info = | 72 | struct phm_ppt_v1_information *table_info = |
66 | (struct phm_ppt_v1_information *)(hwmgr->pptable); | 73 | (struct phm_ppt_v1_information *)(hwmgr->pptable); |
67 | struct phm_cac_tdp_table *cac_dtp_table = table_info->cac_dtp_table; | 74 | struct phm_cac_tdp_table *cac_dtp_table = table_info->cac_dtp_table; |
75 | struct pp_advance_fan_control_parameters *fan_table= | ||
76 | &hwmgr->thermal_controller.advanceFanControlParameters; | ||
68 | int i, j, k; | 77 | int i, j, k; |
69 | uint16_t *pdef1; | 78 | uint16_t *pdef1; |
70 | uint16_t *pdef2; | 79 | uint16_t *pdef2; |
@@ -75,15 +84,16 @@ int polaris10_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr) | |||
75 | PP_ASSERT_WITH_CODE(cac_dtp_table->usTargetOperatingTemp <= 255, | 84 | PP_ASSERT_WITH_CODE(cac_dtp_table->usTargetOperatingTemp <= 255, |
76 | "Target Operating Temp is out of Range!", | 85 | "Target Operating Temp is out of Range!", |
77 | ); | 86 | ); |
78 | /* This is the same value as TemperatureLimitHigh except it is integer with no fraction bit. */ | ||
79 | dpm_table->GpuTjMax = (uint8_t)(cac_dtp_table->usTargetOperatingTemp); | ||
80 | 87 | ||
81 | /* HW request to hard code this value to 8 which is 0.5C */ | 88 | dpm_table->TemperatureLimitEdge = PP_HOST_TO_SMC_US( |
82 | dpm_table->GpuTjHyst = 8; | 89 | cac_dtp_table->usTargetOperatingTemp * 256); |
90 | dpm_table->TemperatureLimitHotspot = PP_HOST_TO_SMC_US( | ||
91 | cac_dtp_table->usTemperatureLimitHotspot * 256); | ||
92 | dpm_table->FanGainEdge = PP_HOST_TO_SMC_US( | ||
93 | scale_fan_gain_settings(fan_table->usFanGainEdge)); | ||
94 | dpm_table->FanGainHotspot = PP_HOST_TO_SMC_US( | ||
95 | scale_fan_gain_settings(fan_table->usFanGainHotspot)); | ||
83 | 96 | ||
84 | dpm_table->DTEAmbientTempBase = defaults->DTEAmbientTempBase; | ||
85 | dpm_table->DTETjOffset = (uint8_t)(data->dte_tj_offset); | ||
86 | dpm_table->BAPM_TEMP_GRADIENT = PP_HOST_TO_SMC_UL(defaults->BAPM_TEMP_GRADIENT); | ||
87 | pdef1 = defaults->BAPMTI_R; | 97 | pdef1 = defaults->BAPMTI_R; |
88 | pdef2 = defaults->BAPMTI_RC; | 98 | pdef2 = defaults->BAPMTI_RC; |
89 | 99 | ||
@@ -330,14 +340,6 @@ int polaris10_enable_power_containment(struct pp_hwmgr *hwmgr) | |||
330 | data->power_containment_features = 0; | 340 | data->power_containment_features = 0; |
331 | if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, | 341 | if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, |
332 | PHM_PlatformCaps_PowerContainment)) { | 342 | PHM_PlatformCaps_PowerContainment)) { |
333 | if (data->enable_dte_feature) { | ||
334 | smc_result = smum_send_msg_to_smc(hwmgr->smumgr, | ||
335 | (uint16_t)(PPSMC_MSG_EnableDTE)); | ||
336 | PP_ASSERT_WITH_CODE((0 == smc_result), | ||
337 | "Failed to enable DTE in SMC.", result = -1;); | ||
338 | if (0 == smc_result) | ||
339 | data->power_containment_features |= POWERCONTAINMENT_FEATURE_DTE; | ||
340 | } | ||
341 | 343 | ||
342 | if (data->enable_tdc_limit_feature) { | 344 | if (data->enable_tdc_limit_feature) { |
343 | smc_result = smum_send_msg_to_smc(hwmgr->smumgr, | 345 | smc_result = smum_send_msg_to_smc(hwmgr->smumgr, |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h b/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h index f6a7591274ba..0dfe82336dc7 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h +++ b/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h | |||
@@ -323,14 +323,14 @@ struct SMU74_Discrete_DpmTable { | |||
323 | uint16_t BAPMTI_R[SMU74_DTE_ITERATIONS][SMU74_DTE_SOURCES][SMU74_DTE_SINKS]; | 323 | uint16_t BAPMTI_R[SMU74_DTE_ITERATIONS][SMU74_DTE_SOURCES][SMU74_DTE_SINKS]; |
324 | uint16_t BAPMTI_RC[SMU74_DTE_ITERATIONS][SMU74_DTE_SOURCES][SMU74_DTE_SINKS]; | 324 | uint16_t BAPMTI_RC[SMU74_DTE_ITERATIONS][SMU74_DTE_SOURCES][SMU74_DTE_SINKS]; |
325 | 325 | ||
326 | uint8_t DTEAmbientTempBase; | 326 | uint16_t TemperatureLimitEdge; |
327 | uint8_t DTETjOffset; | 327 | uint16_t TemperatureLimitHotspot; |
328 | uint8_t GpuTjMax; | 328 | |
329 | uint8_t GpuTjHyst; | ||
330 | uint16_t BootVddc; | 329 | uint16_t BootVddc; |
331 | uint16_t BootVddci; | 330 | uint16_t BootVddci; |
332 | 331 | ||
333 | uint32_t BAPM_TEMP_GRADIENT; | 332 | uint16_t FanGainEdge; |
333 | uint16_t FanGainHotspot; | ||
334 | 334 | ||
335 | uint32_t LowSclkInterruptThreshold; | 335 | uint32_t LowSclkInterruptThreshold; |
336 | uint32_t VddGfxReChkWait; | 336 | uint32_t VddGfxReChkWait; |