/* * Copyright 2015 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. *
*/ #include"pp_debug.h" #include <linux/errno.h> #include"hwmgr.h" #include"hardwaremanager.h" #include"power_state.h"
int phm_register_irq_handlers(struct pp_hwmgr *hwmgr)
{
PHM_FUNC_CHECK(hwmgr);
if (hwmgr->hwmgr_func->register_irq_handlers != NULL) return hwmgr->hwmgr_func->register_irq_handlers(hwmgr);
return 0;
}
/** * phm_start_thermal_controller - Initializes the thermal controller subsystem. * * @hwmgr: the address of the powerplay hardware manager. * Exception PP_Result_Failed if any of the paramters is NULL, otherwise the return value from the dispatcher.
*/ int phm_start_thermal_controller(struct pp_hwmgr *hwmgr)
{ int ret = 0; struct PP_TemperatureRange range = {
TEMP_RANGE_MIN,
TEMP_RANGE_MAX,
TEMP_RANGE_MAX,
TEMP_RANGE_MIN,
TEMP_RANGE_MAX,
TEMP_RANGE_MAX,
TEMP_RANGE_MIN,
TEMP_RANGE_MAX,
TEMP_RANGE_MAX,
0}; struct amdgpu_device *adev = hwmgr->adev;
if (!hwmgr->not_vf) return 0;
if (hwmgr->hwmgr_func->get_thermal_temperature_range)
hwmgr->hwmgr_func->get_thermal_temperature_range(
hwmgr, &range);
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_ThermalController)
&& hwmgr->hwmgr_func->start_thermal_controller != NULL)
ret = hwmgr->hwmgr_func->start_thermal_controller(hwmgr, &range);
int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr, conststruct amd_pp_display_configuration *display_config)
{ int index = 0; int number_of_active_display = 0;
PHM_FUNC_CHECK(hwmgr);
if (display_config == NULL) return -EINVAL;
if (NULL != hwmgr->hwmgr_func->set_min_deep_sleep_dcefclk)
hwmgr->hwmgr_func->set_min_deep_sleep_dcefclk(hwmgr, display_config->min_dcef_deep_sleep_set_clk);
for (index = 0; index < display_config->num_path_including_non_display; index++) { if (display_config->displays[index].controller_id != 0)
number_of_active_display++;
}
if (NULL != hwmgr->hwmgr_func->set_active_display_count)
hwmgr->hwmgr_func->set_active_display_count(hwmgr, number_of_active_display);
if (hwmgr->hwmgr_func->store_cc6_data == NULL) return -EINVAL;
/* TODO: pass other display configuration in the future */
if (hwmgr->hwmgr_func->store_cc6_data)
hwmgr->hwmgr_func->store_cc6_data(hwmgr,
display_config->cpu_pstate_separation_time,
display_config->cpu_cc6_disable,
display_config->cpu_pstate_disable,
display_config->nb_pstate_switch_disable);
return 0;
}
int phm_get_dal_power_level(struct pp_hwmgr *hwmgr, struct amd_pp_simple_clock_info *info)
{
PHM_FUNC_CHECK(hwmgr);
/** * phm_get_clock_info * * @hwmgr: the address of the powerplay hardware manager. * @state: the address of the Power State structure. * @pclock_info: the address of PP_ClockInfo structure where the result will be returned. * @designation: PHM performance level designation * Exception PP_Result_Failed if any of the paramters is NULL, otherwise the return value from the back-end.
*/ int phm_get_clock_info(struct pp_hwmgr *hwmgr, conststruct pp_hw_power_state *state, struct pp_clock_info *pclock_info,
PHM_PerformanceLevelDesignation designation)
{ int result;
PHM_PerformanceLevel performance_level = {0};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.