Commit 1c9a9082 authored by Vitaly Prosyak's avatar Vitaly Prosyak Committed by Alex Deucher

amd/powerplay: Fix get dal power level

Simplify data struct for get dal power level
Signed-off-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
parent c4dd206b
...@@ -620,7 +620,8 @@ int amd_powerplay_display_configuration_change(void *handle, const void *input) ...@@ -620,7 +620,8 @@ int amd_powerplay_display_configuration_change(void *handle, const void *input)
return 0; return 0;
} }
int amd_powerplay_get_display_power_level(void *handle, void *output) int amd_powerplay_get_display_power_level(void *handle,
struct amd_pp_dal_clock_info *output)
{ {
struct pp_hwmgr *hwmgr; struct pp_hwmgr *hwmgr;
...@@ -629,6 +630,5 @@ int amd_powerplay_get_display_power_level(void *handle, void *output) ...@@ -629,6 +630,5 @@ int amd_powerplay_get_display_power_level(void *handle, void *output)
hwmgr = ((struct pp_instance *)handle)->hwmgr; hwmgr = ((struct pp_instance *)handle)->hwmgr;
return phm_get_dal_power_level(hwmgr, return phm_get_dal_power_level(hwmgr, output);
(struct pp_dal_clock_info *)output);
} }
...@@ -1597,7 +1597,7 @@ static void cz_hw_print_display_cfg( ...@@ -1597,7 +1597,7 @@ static void cz_hw_print_display_cfg(
} }
static int cz_get_dal_power_level(struct pp_hwmgr *hwmgr, static int cz_get_dal_power_level(struct pp_hwmgr *hwmgr,
struct pp_dal_clock_info*info) struct amd_pp_dal_clock_info*info)
{ {
uint32_t i; uint32_t i;
const struct phm_clock_voltage_dependency_table * table = const struct phm_clock_voltage_dependency_table * table =
......
...@@ -262,12 +262,13 @@ int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr, ...@@ -262,12 +262,13 @@ int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
} }
int phm_get_dal_power_level(struct pp_hwmgr *hwmgr, int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
struct pp_dal_clock_info*info) struct amd_pp_dal_clock_info*info)
{ {
if (hwmgr == NULL || hwmgr->hwmgr_func->get_dal_power_level == NULL) if (info == NULL || hwmgr == NULL ||
hwmgr->hwmgr_func->get_dal_power_level == NULL)
return -EINVAL; return -EINVAL;
return hwmgr->hwmgr_func->get_dal_power_level(hwmgr,info); return hwmgr->hwmgr_func->get_dal_power_level(hwmgr, info);
} }
int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr) int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr)
......
...@@ -218,7 +218,8 @@ int amd_powerplay_fini(void *handle); ...@@ -218,7 +218,8 @@ int amd_powerplay_fini(void *handle);
int amd_powerplay_display_configuration_change(void *handle, const void *input); int amd_powerplay_display_configuration_change(void *handle, const void *input);
int amd_powerplay_get_display_power_level(void *handle, void *output); int amd_powerplay_get_display_power_level(void *handle,
struct amd_pp_dal_clock_info *output);
#endif /* _AMD_POWERPLAY_H_ */ #endif /* _AMD_POWERPLAY_H_ */
...@@ -340,11 +340,6 @@ enum PP_DAL_POWERLEVEL { ...@@ -340,11 +340,6 @@ enum PP_DAL_POWERLEVEL {
PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1, PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,
}; };
struct pp_dal_clock_info {
uint32_t engine_max_clock;/*dal validation clock on AC*/
uint32_t memory_max_clock;/*dal validation clock on AC*/
enum PP_DAL_POWERLEVEL level; /*number of levels for the given clocks*/
};
extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr); extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr);
extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate); extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate);
...@@ -380,7 +375,7 @@ extern int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr, ...@@ -380,7 +375,7 @@ extern int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
const struct amd_pp_display_configuration *display_config); const struct amd_pp_display_configuration *display_config);
extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr, extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
struct pp_dal_clock_info*info); struct amd_pp_dal_clock_info*info);
extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr); extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr);
......
...@@ -325,7 +325,7 @@ struct pp_hwmgr_func { ...@@ -325,7 +325,7 @@ struct pp_hwmgr_func {
bool cc6_disable, bool pstate_disable, bool cc6_disable, bool pstate_disable,
bool pstate_switch_disable); bool pstate_switch_disable);
int (*get_dal_power_level)(struct pp_hwmgr *hwmgr, int (*get_dal_power_level)(struct pp_hwmgr *hwmgr,
struct pp_dal_clock_info*info); struct amd_pp_dal_clock_info*info);
}; };
struct pp_table_func { struct pp_table_func {
......
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