Commit 1ab47204 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/powerplay: refine code for thermal control in powerplay

add function point start_thermal_controller in hwmgr,
delete thermal function table and related functions
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 97bae49c
...@@ -306,8 +306,10 @@ int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRa ...@@ -306,8 +306,10 @@ int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRa
range.min = temperature_range->min; range.min = temperature_range->min;
} }
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_ThermalController)) PHM_PlatformCaps_ThermalController)
return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), &range, NULL); && hwmgr->hwmgr_func->start_thermal_controller != NULL)
return hwmgr->hwmgr_func->start_thermal_controller(hwmgr, &range);
return 0; return 0;
} }
......
...@@ -73,6 +73,7 @@ int hwmgr_early_init(struct pp_instance *handle) ...@@ -73,6 +73,7 @@ int hwmgr_early_init(struct pp_instance *handle)
hwmgr->dpm_level = AMD_DPM_FORCED_LEVEL_AUTO; hwmgr->dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
hwmgr_init_default_caps(hwmgr); hwmgr_init_default_caps(hwmgr);
hwmgr_set_user_specify_caps(hwmgr); hwmgr_set_user_specify_caps(hwmgr);
hwmgr->fan_ctrl_is_in_default_mode = true;
switch (hwmgr->chip_family) { switch (hwmgr->chip_family) {
case AMDGPU_FAMILY_CZ: case AMDGPU_FAMILY_CZ:
......
...@@ -2284,7 +2284,6 @@ static int smu7_hwmgr_backend_fini(struct pp_hwmgr *hwmgr) ...@@ -2284,7 +2284,6 @@ static int smu7_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
{ {
kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl); kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL; hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
pp_smu7_thermal_fini(hwmgr);
kfree(hwmgr->backend); kfree(hwmgr->backend);
hwmgr->backend = NULL; hwmgr->backend = NULL;
...@@ -2301,8 +2300,6 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr) ...@@ -2301,8 +2300,6 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
return -ENOMEM; return -ENOMEM;
hwmgr->backend = data; hwmgr->backend = data;
pp_smu7_thermal_initialize(hwmgr);
smu7_patch_voltage_workaround(hwmgr); smu7_patch_voltage_workaround(hwmgr);
smu7_init_dpm_defaults(hwmgr); smu7_init_dpm_defaults(hwmgr);
...@@ -4661,6 +4658,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = { ...@@ -4661,6 +4658,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
.set_power_profile_state = smu7_set_power_profile_state, .set_power_profile_state = smu7_set_power_profile_state,
.avfs_control = smu7_avfs_control, .avfs_control = smu7_avfs_control,
.disable_smc_firmware_ctf = smu7_thermal_disable_alert, .disable_smc_firmware_ctf = smu7_thermal_disable_alert,
.start_thermal_controller = smu7_start_thermal_controller,
}; };
uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock, uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock,
......
...@@ -360,7 +360,7 @@ static int smu7_thermal_initialize(struct pp_hwmgr *hwmgr) ...@@ -360,7 +360,7 @@ static int smu7_thermal_initialize(struct pp_hwmgr *hwmgr)
* *
* @param hwmgr The address of the hardware manager. * @param hwmgr The address of the hardware manager.
*/ */
int smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr) static void smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr)
{ {
uint32_t alert; uint32_t alert;
...@@ -371,7 +371,7 @@ int smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr) ...@@ -371,7 +371,7 @@ int smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr)
CG_THERMAL_INT, THERM_INT_MASK, alert); CG_THERMAL_INT, THERM_INT_MASK, alert);
/* send message to SMU to enable internal thermal interrupts */ /* send message to SMU to enable internal thermal interrupts */
return smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_Thermal_Cntl_Enable); smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_Thermal_Cntl_Enable);
} }
/** /**
...@@ -416,8 +416,7 @@ int smu7_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr) ...@@ -416,8 +416,7 @@ int smu7_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr)
* @param Result the last failure code * @param Result the last failure code
* @return result from set temperature range routine * @return result from set temperature range routine
*/ */
static int tf_smu7_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr, static int smu7_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr)
void *input, void *output, void *storage, int result)
{ {
/* If the fantable setup has failed we could have disabled /* If the fantable setup has failed we could have disabled
* PHM_PlatformCaps_MicrocodeFanControl even after * PHM_PlatformCaps_MicrocodeFanControl even after
...@@ -432,108 +431,34 @@ static int tf_smu7_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr, ...@@ -432,108 +431,34 @@ static int tf_smu7_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr,
return 0; return 0;
} }
/** int smu7_start_thermal_controller(struct pp_hwmgr *hwmgr,
* Set temperature range for high and low alerts struct PP_TemperatureRange *range)
* @param hwmgr the address of the powerplay hardware manager.
* @param pInput the pointer to input data
* @param pOutput the pointer to output data
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from set temperature range routine
*/
static int tf_smu7_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{ {
struct PP_TemperatureRange *range = (struct PP_TemperatureRange *)input; int ret = 0;
if (range == NULL) if (range == NULL)
return -EINVAL; return -EINVAL;
return smu7_thermal_set_temperature_range(hwmgr, range->min, range->max); smu7_thermal_initialize(hwmgr);
} ret = smu7_thermal_set_temperature_range(hwmgr, range->min, range->max);
if (ret)
/** return -EINVAL;
* Programs one-time setting registers smu7_thermal_enable_alert(hwmgr);
* @param hwmgr the address of the powerplay hardware manager. ret = smum_thermal_avfs_enable(hwmgr);
* @param pInput the pointer to input data if (ret)
* @param pOutput the pointer to output data return -EINVAL;
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from initialize thermal controller routine
*/
static int tf_smu7_thermal_initialize(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{
return smu7_thermal_initialize(hwmgr);
}
/**
* Enable high and low alerts
* @param hwmgr the address of the powerplay hardware manager.
* @param pInput the pointer to input data
* @param pOutput the pointer to output data
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from enable alert routine
*/
static int tf_smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{
return smu7_thermal_enable_alert(hwmgr);
}
/**
* Disable high and low alerts
* @param hwmgr the address of the powerplay hardware manager.
* @param pInput the pointer to input data
* @param pOutput the pointer to output data
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from disable alert routine
*/
static int tf_smu7_thermal_disable_alert(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{
return smu7_thermal_disable_alert(hwmgr);
}
static const struct phm_master_table_item
phm_thermal_start_thermal_controller_master_list[] = {
{ .tableFunction = tf_smu7_thermal_initialize },
{ .tableFunction = tf_smu7_thermal_set_temperature_range },
{ .tableFunction = tf_smu7_thermal_enable_alert },
{ .tableFunction = smum_thermal_avfs_enable },
/* We should restrict performance levels to low before we halt the SMC. /* We should restrict performance levels to low before we halt the SMC.
* On the other hand we are still in boot state when we do this * On the other hand we are still in boot state when we do this
* so it would be pointless. * so it would be pointless.
* If this assumption changes we have to revisit this table. * If this assumption changes we have to revisit this table.
*/ */
{ .tableFunction = smum_thermal_setup_fan_table }, smum_thermal_setup_fan_table(hwmgr);
{ .tableFunction = tf_smu7_thermal_start_smc_fan_control }, smu7_thermal_start_smc_fan_control(hwmgr);
{ } return 0;
}; }
static const struct phm_master_table_header
phm_thermal_start_thermal_controller_master = {
0,
PHM_MasterTableFlag_None,
phm_thermal_start_thermal_controller_master_list
};
static const struct phm_master_table_item
phm_thermal_set_temperature_range_master_list[] = {
{ .tableFunction = tf_smu7_thermal_disable_alert },
{ .tableFunction = tf_smu7_thermal_set_temperature_range },
{ .tableFunction = tf_smu7_thermal_enable_alert },
{ }
};
static const struct phm_master_table_header
phm_thermal_set_temperature_range_master = {
0,
PHM_MasterTableFlag_None,
phm_thermal_set_temperature_range_master_list
};
int smu7_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr) int smu7_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr)
{ {
...@@ -542,34 +467,3 @@ int smu7_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr) ...@@ -542,34 +467,3 @@ int smu7_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr)
return 0; return 0;
} }
/**
* Initializes the thermal controller related functions in the Hardware Manager structure.
* @param hwmgr The address of the hardware manager.
* @exception Any error code from the low-level communication.
*/
int pp_smu7_thermal_initialize(struct pp_hwmgr *hwmgr)
{
int result;
result = phm_construct_table(hwmgr,
&phm_thermal_set_temperature_range_master,
&(hwmgr->set_temperature_range));
if (!result) {
result = phm_construct_table(hwmgr,
&phm_thermal_start_thermal_controller_master,
&(hwmgr->start_thermal_controller));
if (result)
phm_destroy_table(hwmgr, &(hwmgr->set_temperature_range));
}
if (!result)
hwmgr->fan_ctrl_is_in_default_mode = true;
return result;
}
void pp_smu7_thermal_fini(struct pp_hwmgr *hwmgr)
{
phm_destroy_table(hwmgr, &(hwmgr->set_temperature_range));
phm_destroy_table(hwmgr, &(hwmgr->start_thermal_controller));
}
...@@ -46,14 +46,13 @@ extern int smu7_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr); ...@@ -46,14 +46,13 @@ extern int smu7_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr);
extern int smu7_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode); extern int smu7_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode);
extern int smu7_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr, uint32_t speed); extern int smu7_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr, uint32_t speed);
extern int smu7_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr); extern int smu7_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr);
extern int pp_smu7_thermal_initialize(struct pp_hwmgr *hwmgr);
extern void pp_smu7_thermal_fini(struct pp_hwmgr *hwmgr);
extern int smu7_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr); extern int smu7_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr);
extern int smu7_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed); extern int smu7_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed);
extern int smu7_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t *speed); extern int smu7_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t *speed);
extern int smu7_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr); extern int smu7_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr);
extern int smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr);
extern int smu7_thermal_disable_alert(struct pp_hwmgr *hwmgr); extern int smu7_thermal_disable_alert(struct pp_hwmgr *hwmgr);
extern int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr); extern int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
extern int smu7_start_thermal_controller(struct pp_hwmgr *hwmgr,
struct PP_TemperatureRange *temperature_range);
#endif #endif
...@@ -5060,6 +5060,6 @@ int vega10_hwmgr_init(struct pp_hwmgr *hwmgr) ...@@ -5060,6 +5060,6 @@ int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
{ {
hwmgr->hwmgr_func = &vega10_hwmgr_funcs; hwmgr->hwmgr_func = &vega10_hwmgr_funcs;
hwmgr->pptable_func = &vega10_pptable_funcs; hwmgr->pptable_func = &vega10_pptable_funcs;
pp_vega10_thermal_initialize(hwmgr);
return 0; return 0;
} }
...@@ -528,8 +528,7 @@ int vega10_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr) ...@@ -528,8 +528,7 @@ int vega10_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr)
* @param Result the last failure code * @param Result the last failure code
* @return result from set temperature range routine * @return result from set temperature range routine
*/ */
int tf_vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr, int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
void *input, void *output, void *storage, int result)
{ {
int ret; int ret;
struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend); struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend);
...@@ -593,8 +592,7 @@ int tf_vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr, ...@@ -593,8 +592,7 @@ int tf_vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr,
* @param Result the last failure code * @param Result the last failure code
* @return result from set temperature range routine * @return result from set temperature range routine
*/ */
int tf_vega10_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr, int vega10_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr)
void *input, void *output, void *storage, int result)
{ {
/* If the fantable setup has failed we could have disabled /* If the fantable setup has failed we could have disabled
* PHM_PlatformCaps_MicrocodeFanControl even after * PHM_PlatformCaps_MicrocodeFanControl even after
...@@ -607,107 +605,37 @@ int tf_vega10_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr, ...@@ -607,107 +605,37 @@ int tf_vega10_thermal_start_smc_fan_control(struct pp_hwmgr *hwmgr,
return 0; return 0;
} }
/**
* Set temperature range for high and low alerts int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,
* @param hwmgr the address of the powerplay hardware manager. struct PP_TemperatureRange *range)
* @param pInput the pointer to input data
* @param pOutput the pointer to output data
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from set temperature range routine
*/
int tf_vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{ {
struct PP_TemperatureRange *range = (struct PP_TemperatureRange *)input; int ret = 0;
if (range == NULL) if (range == NULL)
return -EINVAL; return -EINVAL;
return vega10_thermal_set_temperature_range(hwmgr, range); vega10_thermal_initialize(hwmgr);
} ret = vega10_thermal_set_temperature_range(hwmgr, range);
if (ret)
/** return -EINVAL;
* Programs one-time setting registers
* @param hwmgr the address of the powerplay hardware manager.
* @param pInput the pointer to input data
* @param pOutput the pointer to output data
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from initialize thermal controller routine
*/
int tf_vega10_thermal_initialize(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{
return vega10_thermal_initialize(hwmgr);
}
/**
* Enable high and low alerts
* @param hwmgr the address of the powerplay hardware manager.
* @param pInput the pointer to input data
* @param pOutput the pointer to output data
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from enable alert routine
*/
int tf_vega10_thermal_enable_alert(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{
return vega10_thermal_enable_alert(hwmgr);
}
/**
* Disable high and low alerts
* @param hwmgr the address of the powerplay hardware manager.
* @param pInput the pointer to input data
* @param pOutput the pointer to output data
* @param pStorage the pointer to temporary storage
* @param Result the last failure code
* @return result from disable alert routine
*/
static int tf_vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result)
{
return vega10_thermal_disable_alert(hwmgr);
}
static struct phm_master_table_item vega10_thermal_enable_alert(hwmgr);
vega10_thermal_start_thermal_controller_master_list[] = {
{ .tableFunction = tf_vega10_thermal_initialize },
{ .tableFunction = tf_vega10_thermal_set_temperature_range },
{ .tableFunction = tf_vega10_thermal_enable_alert },
/* We should restrict performance levels to low before we halt the SMC. /* We should restrict performance levels to low before we halt the SMC.
* On the other hand we are still in boot state when we do this * On the other hand we are still in boot state when we do this
* so it would be pointless. * so it would be pointless.
* If this assumption changes we have to revisit this table. * If this assumption changes we have to revisit this table.
*/ */
{ .tableFunction = tf_vega10_thermal_setup_fan_table }, ret = vega10_thermal_setup_fan_table(hwmgr);
{ .tableFunction = tf_vega10_thermal_start_smc_fan_control }, if (ret)
{ } return -EINVAL;
};
static struct phm_master_table_header vega10_thermal_start_smc_fan_control(hwmgr);
vega10_thermal_start_thermal_controller_master = {
0,
PHM_MasterTableFlag_None,
vega10_thermal_start_thermal_controller_master_list
};
static struct phm_master_table_item return 0;
vega10_thermal_set_temperature_range_master_list[] = {
{ .tableFunction = tf_vega10_thermal_disable_alert },
{ .tableFunction = tf_vega10_thermal_set_temperature_range },
{ .tableFunction = tf_vega10_thermal_enable_alert },
{ }
}; };
struct phm_master_table_header
vega10_thermal_set_temperature_range_master = {
0,
PHM_MasterTableFlag_None,
vega10_thermal_set_temperature_range_master_list
};
int vega10_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr) int vega10_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr)
{ {
...@@ -717,32 +645,3 @@ int vega10_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr) ...@@ -717,32 +645,3 @@ int vega10_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr)
} }
return 0; return 0;
} }
/**
* Initializes the thermal controller related functions
* in the Hardware Manager structure.
* @param hwmgr The address of the hardware manager.
* @exception Any error code from the low-level communication.
*/
int pp_vega10_thermal_initialize(struct pp_hwmgr *hwmgr)
{
int result;
result = phm_construct_table(hwmgr,
&vega10_thermal_set_temperature_range_master,
&(hwmgr->set_temperature_range));
if (!result) {
result = phm_construct_table(hwmgr,
&vega10_thermal_start_thermal_controller_master,
&(hwmgr->start_thermal_controller));
if (result)
phm_destroy_table(hwmgr,
&(hwmgr->set_temperature_range));
}
if (!result)
hwmgr->fan_ctrl_is_in_default_mode = true;
return result;
}
...@@ -50,13 +50,6 @@ struct vega10_temperature { ...@@ -50,13 +50,6 @@ struct vega10_temperature {
#define FDO_PWM_MODE_STATIC_RPM 5 #define FDO_PWM_MODE_STATIC_RPM 5
extern int tf_vega10_thermal_initialize(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result);
extern int tf_vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result);
extern int tf_vega10_thermal_enable_alert(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result);
extern int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr); extern int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr);
extern int vega10_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr); extern int vega10_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr);
extern int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr, extern int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,
...@@ -69,7 +62,6 @@ extern int vega10_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, ...@@ -69,7 +62,6 @@ extern int vega10_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr,
extern int vega10_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr, extern int vega10_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,
uint32_t speed); uint32_t speed);
extern int vega10_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr); extern int vega10_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr);
extern int pp_vega10_thermal_initialize(struct pp_hwmgr *hwmgr);
extern int vega10_thermal_ctrl_uninitialize_thermal_controller( extern int vega10_thermal_ctrl_uninitialize_thermal_controller(
struct pp_hwmgr *hwmgr); struct pp_hwmgr *hwmgr);
extern int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, extern int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr,
...@@ -77,9 +69,10 @@ extern int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, ...@@ -77,9 +69,10 @@ extern int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr,
extern int vega10_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, extern int vega10_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr,
uint32_t *speed); uint32_t *speed);
extern int vega10_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr); extern int vega10_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr);
extern uint32_t smu7_get_xclk(struct pp_hwmgr *hwmgr);
extern int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr); extern int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr);
int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr); extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
extern uint32_t smu7_get_xclk(struct pp_hwmgr *hwmgr);
#endif #endif
...@@ -380,6 +380,7 @@ struct pp_hwmgr_func { ...@@ -380,6 +380,7 @@ struct pp_hwmgr_func {
int (*disable_smc_firmware_ctf)(struct pp_hwmgr *hwmgr); int (*disable_smc_firmware_ctf)(struct pp_hwmgr *hwmgr);
int (*set_active_display_count)(struct pp_hwmgr *hwmgr, uint32_t count); int (*set_active_display_count)(struct pp_hwmgr *hwmgr, uint32_t count);
int (*set_deep_sleep_dcefclk)(struct pp_hwmgr *hwmgr, uint32_t clock); int (*set_deep_sleep_dcefclk)(struct pp_hwmgr *hwmgr, uint32_t clock);
int (*start_thermal_controller)(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *range);
}; };
struct pp_table_func { struct pp_table_func {
...@@ -766,8 +767,6 @@ struct pp_hwmgr { ...@@ -766,8 +767,6 @@ struct pp_hwmgr {
struct phm_runtime_table_header set_power_state; struct phm_runtime_table_header set_power_state;
struct phm_runtime_table_header enable_clock_power_gatings; struct phm_runtime_table_header enable_clock_power_gatings;
struct phm_runtime_table_header display_configuration_changed; struct phm_runtime_table_header display_configuration_changed;
struct phm_runtime_table_header start_thermal_controller;
struct phm_runtime_table_header set_temperature_range;
const struct pp_hwmgr_func *hwmgr_func; const struct pp_hwmgr_func *hwmgr_func;
const struct pp_table_func *pptable_func; const struct pp_table_func *pptable_func;
struct pp_power_state *ps; struct pp_power_state *ps;
......
...@@ -186,10 +186,8 @@ extern int smum_update_sclk_threshold(struct pp_hwmgr *hwmgr); ...@@ -186,10 +186,8 @@ extern int smum_update_sclk_threshold(struct pp_hwmgr *hwmgr);
extern int smum_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type); extern int smum_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type);
extern int smum_process_firmware_header(struct pp_hwmgr *hwmgr); extern int smum_process_firmware_header(struct pp_hwmgr *hwmgr);
extern int smum_thermal_avfs_enable(struct pp_hwmgr *hwmgr, extern int smum_thermal_avfs_enable(struct pp_hwmgr *hwmgr);
void *input, void *output, void *storage, int result); extern int smum_thermal_setup_fan_table(struct pp_hwmgr *hwmgr);
extern int smum_thermal_setup_fan_table(struct pp_hwmgr *hwmgr,
void *input, void *output, void *storage, int result);
extern int smum_init_smc_table(struct pp_hwmgr *hwmgr); extern int smum_init_smc_table(struct pp_hwmgr *hwmgr);
extern int smum_populate_all_graphic_levels(struct pp_hwmgr *hwmgr); extern int smum_populate_all_graphic_levels(struct pp_hwmgr *hwmgr);
extern int smum_populate_all_memory_levels(struct pp_hwmgr *hwmgr); extern int smum_populate_all_memory_levels(struct pp_hwmgr *hwmgr);
......
...@@ -114,8 +114,7 @@ int smum_early_init(struct pp_instance *handle) ...@@ -114,8 +114,7 @@ int smum_early_init(struct pp_instance *handle)
return 0; return 0;
} }
int smum_thermal_avfs_enable(struct pp_hwmgr *hwmgr, int smum_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
void *input, void *output, void *storage, int result)
{ {
if (NULL != hwmgr->smumgr->smumgr_funcs->thermal_avfs_enable) if (NULL != hwmgr->smumgr->smumgr_funcs->thermal_avfs_enable)
return hwmgr->smumgr->smumgr_funcs->thermal_avfs_enable(hwmgr); return hwmgr->smumgr->smumgr_funcs->thermal_avfs_enable(hwmgr);
...@@ -123,8 +122,7 @@ int smum_thermal_avfs_enable(struct pp_hwmgr *hwmgr, ...@@ -123,8 +122,7 @@ int smum_thermal_avfs_enable(struct pp_hwmgr *hwmgr,
return 0; return 0;
} }
int smum_thermal_setup_fan_table(struct pp_hwmgr *hwmgr, int smum_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
void *input, void *output, void *storage, int result)
{ {
if (NULL != hwmgr->smumgr->smumgr_funcs->thermal_setup_fan_table) if (NULL != hwmgr->smumgr->smumgr_funcs->thermal_setup_fan_table)
return hwmgr->smumgr->smumgr_funcs->thermal_setup_fan_table(hwmgr); return hwmgr->smumgr->smumgr_funcs->thermal_setup_fan_table(hwmgr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment