drm/amd/powerplay: show the right unit for the temp printed out
Subsystems (2)
PATCH 1/4 drm/amd/powerplay: show the right unit for the temp printed out
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -2
@@ -789,7 +789,7 @@ static ssize_t amdgpu_hwmon_show_temp(struct device *dev,else temp =amdgpu_dpm_get_temperature (adev); -return snprintf (buf,PAGE_SIZE ,"%d\n" , temp); +return snprintf (buf,PAGE_SIZE ,"%d millicelsius\n" , temp); } static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,
@@ -805,7 +805,7 @@ static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,else temp = adev->pm.dpm.thermal.max_temp; -return snprintf (buf,PAGE_SIZE ,"%d\n" , temp); +return snprintf (buf,PAGE_SIZE ,"%d millicelsius\n" , temp); } static ssize_t amdgpu_hwmon_get_pwm1_enable(struct device *dev,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1514533479-14038-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org
PATCH 2/4 drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
--- drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 14 +++----------- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 ++-- drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +3 -11
@@ -220,20 +220,12 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)* Initializes the thermal controller subsystem. * * @param pHwMgr the address of the powerplay hardware manager. -* @param pTemperatureRange the address of the structure holding the temperature range. * @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,struct PP_TemperatureRange *temperature_range) +int phm_start_thermal_controller (struct pp_hwmgr *hwmgr) { -struct PP_TemperatureRange range; - -if (temperature_range ==NULL ) { - range.max =TEMP_RANGE_MAX ; - range.min =TEMP_RANGE_MIN ; - }else { - range.max = temperature_range->max; - range.min = temperature_range->min; - } +struct PP_TemperatureRange range = {{TEMP_RANGE_MIN ,TEMP_RANGE_MAX }}; +if (phm_cap_enabled (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_ThermalController) && hwmgr->hwmgr_func->start_thermal_controller !=NULL )
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2 -2
@@ -265,7 +265,7 @@ int hwmgr_hw_init(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret) goto err2; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr); ret |=psm_set_performance_states (hwmgr);if (ret) goto err2;
@@ -345,7 +345,7 @@ int hwmgr_hw_resume(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret)return ret; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr);if (ret)return ret;
drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +1 -1
@@ -407,7 +407,7 @@ extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_leveextern int phm_display_configuration_changed (struct pp_hwmgr *hwmgr);extern int phm_notify_smc_display_config_after_ps_adjustment (struct pp_hwmgr *hwmgr);extern int phm_register_thermal_interrupt (struct pp_hwmgr *hwmgr,const void *info); -extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr,struct PP_TemperatureRange *temperature_range); +extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr);extern int phm_stop_thermal_controller (struct pp_hwmgr *hwmgr);extern bool phm_check_smc_update_required_for_display_configuration (struct pp_hwmgr *hwmgr);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1514533479-14038-2-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
Should this be used to set the default critical temperatures? IIRC, they were set to 0 until last week when someone sent a patch to fix them.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Friday, December 29, 2017 2:44 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
--- drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 14 +++----------- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 ++-- drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +3 -11
@@ -220,20 +220,12 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)* Initializes the thermal controller subsystem. * * @param pHwMgr the address of the powerplay hardware manager. -* @param pTemperatureRange the address of the structure holding the temperature range. * @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,struct PP_TemperatureRange *temperature_range) +int phm_start_thermal_controller (struct pp_hwmgr *hwmgr) { -struct PP_TemperatureRange range; - -if (temperature_range ==NULL ) { - range.max =TEMP_RANGE_MAX ; - range.min =TEMP_RANGE_MIN ; - }else { - range.max = temperature_range->max; - range.min = temperature_range->min; - } +struct PP_TemperatureRange range = {{TEMP_RANGE_MIN ,TEMP_RANGE_MAX }}; +if (phm_cap_enabled (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_ThermalController) && hwmgr->hwmgr_func->start_thermal_controller !=NULL )
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2 -2
@@ -265,7 +265,7 @@ int hwmgr_hw_init(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret) goto err2; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr); ret |=psm_set_performance_states (hwmgr);if (ret) goto err2;
@@ -345,7 +345,7 @@ int hwmgr_hw_resume(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret)return ret; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr);if (ret)return ret;
drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +1 -1
@@ -407,7 +407,7 @@ extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_leveextern int phm_display_configuration_changed (struct pp_hwmgr *hwmgr);extern int phm_notify_smc_display_config_after_ps_adjustment (struct pp_hwmgr *hwmgr);extern int phm_register_thermal_interrupt (struct pp_hwmgr *hwmgr,const void *info); -extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr,struct PP_TemperatureRange *temperature_range); +extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr);extern int phm_stop_thermal_controller (struct pp_hwmgr *hwmgr);extern bool phm_check_smc_update_required_for_display_configuration (struct pp_hwmgr *hwmgr);
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1652FB809C0FE26E36E11B16F71A0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
RE: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
Hi Alex,
Sorry, i cannot get your point. The patch removes the 2nd parameter 'temperature_range' which is always passed in as 'NULL'. Do you mean someone sent another patch which uses this parameter as non 'NULL'?
Regards,
Evan
From: Deucher, Alexander
Sent: Sunday, December 31, 2017 2:31 AM
To: Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
Should this be used to set the default critical temperatures? IIRC, they were set to 0 until last week when someone sent a patch to fix them.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Evan Quan <[email protected]<mailto:[email protected]>>
Sent: Friday, December 29, 2017 2:44 AM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan
Subject: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
--- drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 14 +++----------- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 ++-- drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +3 -11
@@ -220,20 +220,12 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)* Initializes the thermal controller subsystem. * * @param pHwMgr the address of the powerplay hardware manager. -* @param pTemperatureRange the address of the structure holding the temperature range. * @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,struct PP_TemperatureRange *temperature_range) +int phm_start_thermal_controller (struct pp_hwmgr *hwmgr) { -struct PP_TemperatureRange range; - -if (temperature_range ==NULL ) { - range.max =TEMP_RANGE_MAX ; - range.min =TEMP_RANGE_MIN ; - }else { - range.max = temperature_range->max; - range.min = temperature_range->min; - } +struct PP_TemperatureRange range = {{TEMP_RANGE_MIN ,TEMP_RANGE_MAX }}; +if (phm_cap_enabled (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_ThermalController) && hwmgr->hwmgr_func->start_thermal_controller !=NULL )
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2 -2
@@ -265,7 +265,7 @@ int hwmgr_hw_init(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret) goto err2; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr); ret |=psm_set_performance_states (hwmgr);if (ret) goto err2;
@@ -345,7 +345,7 @@ int hwmgr_hw_resume(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret)return ret; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr);if (ret)return ret;
drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +1 -1
@@ -407,7 +407,7 @@ extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_leveextern int phm_display_configuration_changed (struct pp_hwmgr *hwmgr);extern int phm_notify_smc_display_config_after_ps_adjustment (struct pp_hwmgr *hwmgr);extern int phm_register_thermal_interrupt (struct pp_hwmgr *hwmgr,const void *info); -extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr,struct PP_TemperatureRange *temperature_range); +extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr);extern int phm_stop_thermal_controller (struct pp_hwmgr *hwmgr);extern bool phm_check_smc_update_required_for_display_configuration (struct pp_hwmgr *hwmgr);
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR1201MB2494130290BCAC752A1FE690E4190-3iK1xFAIwjrxmnamtCvAwGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]
Re: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
If it's not used, feel free to remove it (feel free to add my Acked-by). I was just wondering if it would be useful to fix up the critical temperature ranges in sysfs.
Alex
________________________________
From: Quan, Evan
Sent: Monday, January 1, 2018 8:51 PM
To: Deucher, Alexander; [email protected]
Subject: RE: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
Hi Alex,
Sorry, i cannot get your point. The patch removes the 2nd parameter ‘temperature_range’ which is always passed in as ‘NULL’.
Do you mean someone sent another patch which uses this parameter as non ‘NULL’?
Regards,
Evan
From: Deucher, Alexander
Sent: Sunday, December 31, 2017 2:31 AM
To: Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
Should this be used to set the default critical temperatures? IIRC, they were set to 0 until last week when someone sent a patch to fix them.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Evan Quan <[email protected]<mailto:[email protected]>>
Sent: Friday, December 29, 2017 2:44 AM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan
Subject: [PATCH 2/4] drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller
--- drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 14 +++----------- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 ++-- drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +3 -11
@@ -220,20 +220,12 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)* Initializes the thermal controller subsystem. * * @param pHwMgr the address of the powerplay hardware manager. -* @param pTemperatureRange the address of the structure holding the temperature range. * @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,struct PP_TemperatureRange *temperature_range) +int phm_start_thermal_controller (struct pp_hwmgr *hwmgr) { -struct PP_TemperatureRange range; - -if (temperature_range ==NULL ) { - range.max =TEMP_RANGE_MAX ; - range.min =TEMP_RANGE_MIN ; - }else { - range.max = temperature_range->max; - range.min = temperature_range->min; - } +struct PP_TemperatureRange range = {{TEMP_RANGE_MIN ,TEMP_RANGE_MAX }}; +if (phm_cap_enabled (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_ThermalController) && hwmgr->hwmgr_func->start_thermal_controller !=NULL )
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2 -2
@@ -265,7 +265,7 @@ int hwmgr_hw_init(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret) goto err2; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr); ret |=psm_set_performance_states (hwmgr);if (ret) goto err2;
@@ -345,7 +345,7 @@ int hwmgr_hw_resume(struct pp_instance *handle) ret =phm_enable_dynamic_state_management (hwmgr);if (ret)return ret; - ret =phm_start_thermal_controller (hwmgr,NULL ); + ret =phm_start_thermal_controller (hwmgr);if (ret)return ret;
drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +1 -1
@@ -407,7 +407,7 @@ extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_leveextern int phm_display_configuration_changed (struct pp_hwmgr *hwmgr);extern int phm_notify_smc_display_config_after_ps_adjustment (struct pp_hwmgr *hwmgr);extern int phm_register_thermal_interrupt (struct pp_hwmgr *hwmgr,const void *info); -extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr,struct PP_TemperatureRange *temperature_range); +extern int phm_start_thermal_controller (struct pp_hwmgr *hwmgr);extern int phm_stop_thermal_controller (struct pp_hwmgr *hwmgr);extern bool phm_check_smc_update_required_for_display_configuration (struct pp_hwmgr *hwmgr);
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/4 drm/amd/powerplay: removed hwmgr_handle_task unused parameter and given a better name for other parameter
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 10 +++++----- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 2 +- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 12 ++++++------ drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 8 +++----- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 +- 6 files changed, 18 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +2 -2
@@ -328,8 +328,8 @@ enum amdgpu_pcie_gen {#define amdgpu_dpm_set_mclk_od (adev, value) \ ((adev)->powerplay.pp_funcs->set_mclk_od((adev)->powerplay.pp_handle, value)) -#define amdgpu_dpm_dispatch_task (adev, task_id, input, output) \ - ((adev)->powerplay.pp_funcs->dispatch_tasks)((adev)->powerplay.pp_handle, (task_id), (input), (output)) +#define amdgpu_dpm_dispatch_task (adev, task_id, user_state) \ + ((adev)->powerplay.pp_funcs->dispatch_tasks)((adev)->powerplay.pp_handle, (task_id), (user_state))#define amdgpu_dpm_check_state_equal (adev, cps, rps, equal) \ ((adev)->powerplay.pp_funcs->check_state_equal((adev)->powerplay.pp_handle, (cps), (rps), (equal)))
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +5 -5
@@ -114,7 +114,7 @@ static ssize_t amdgpu_set_dpm_state(struct device *dev, }if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_ENABLE_USER_STATE , &state,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_ENABLE_USER_STATE , &state); }else {mutex_lock (&adev->pm.mutex); adev->pm.dpm.user_state = state;
@@ -314,7 +314,7 @@ static ssize_t amdgpu_set_pp_force_state(struct device *dev,if (state !=POWER_STATE_TYPE_INTERNAL_BOOT && state !=POWER_STATE_TYPE_DEFAULT ) {amdgpu_dpm_dispatch_task (adev, -AMD_PP_TASK_ENABLE_USER_STATE , &state,NULL ); +AMD_PP_TASK_ENABLE_USER_STATE , &state); adev->pp_force_state_enabled = true; } }
@@ -528,7 +528,7 @@ static ssize_t amdgpu_set_pp_sclk_od(struct device *dev,amdgpu_dpm_set_sclk_od (adev, (uint32_t )value);if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ); }else { adev->pm.dpm.current_ps = adev->pm.dpm.boot_ps;amdgpu_pm_compute_clocks (adev);
@@ -572,7 +572,7 @@ static ssize_t amdgpu_set_pp_mclk_od(struct device *dev,amdgpu_dpm_set_mclk_od (adev, (uint32_t )value);if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ); }else { adev->pm.dpm.current_ps = adev->pm.dpm.boot_ps;amdgpu_pm_compute_clocks (adev);
@@ -1459,7 +1459,7 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev) }if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_DISPLAY_CONFIG_CHANGE ,NULL ,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_DISPLAY_CONFIG_CHANGE ,NULL ); }else {mutex_lock (&adev->pm.mutex); adev->pm.dpm.new_active_crtcs =0 ;
drivers/gpu/drm/amd/include/kgd_pp_interface.h +1 -1
@@ -256,7 +256,7 @@ struct amd_pm_funcs {void (*powergate_vce)(void *handle,bool gate);struct amd_vce_state *(*get_vce_clock_state)(void *handle,u32 idx);int (*dispatch_tasks)(void *handle,enum amd_pp_task task_id, -void *input,void *output); +enum amd_pm_state_type *user_state);int (*load_firmware)(void *handle);int (*wait_for_fw_loading_complete)(void *handle);int (*set_clockgating_by_smu)(void *handle,uint32_t msg_id);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +6 -6
@@ -33,7 +33,7 @@#define PP_DPM_DISABLED 0xCCCCstatic int pp_dpm_dispatch_tasks (void *handle,enum amd_pp_task task_id, -void *input,void *output); +enum amd_pm_state_type *user_state);static inline int pp_check (struct pp_instance *handle) {
@@ -198,7 +198,7 @@ static int pp_late_init(void *handle) ret =pp_check (pp_handle);if (ret ==0 )pp_dpm_dispatch_tasks (pp_handle, -AMD_PP_TASK_COMPLETE_INIT ,NULL ,NULL ); +AMD_PP_TASK_COMPLETE_INIT ,NULL );return 0 ; }
@@ -397,7 +397,7 @@ static int pp_dpm_force_performance_level(void *handle,mutex_lock (&pp_handle->pp_lock);pp_dpm_en_umd_pstate (hwmgr, &level); hwmgr->request_dpm_level = level; -hwmgr_handle_task (pp_handle,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ,NULL ); +hwmgr_handle_task (pp_handle,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ); ret = hwmgr->hwmgr_func->force_dpm_level (hwmgr, level);if (!ret) hwmgr->dpm_level = hwmgr->request_dpm_level;
@@ -519,7 +519,7 @@ static void pp_dpm_powergate_uvd(void *handle, bool gate) }static int pp_dpm_dispatch_tasks (void *handle,enum amd_pp_task task_id, -void *input,void *output) +enum amd_pm_state_type *user_state) {int ret =0 ;struct pp_instance *pp_handle = (struct pp_instance *)handle;
@@ -530,7 +530,7 @@ static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_task task_id,return ret;mutex_lock (&pp_handle->pp_lock); - ret =hwmgr_handle_task (pp_handle, task_id, input, output); + ret =hwmgr_handle_task (pp_handle, task_id, user_state);mutex_unlock (&pp_handle->pp_lock);return ret;
@@ -805,7 +805,7 @@ static int amd_powerplay_reset(void *handle)if (ret)return ret; -return hwmgr_handle_task (instance,AMD_PP_TASK_COMPLETE_INIT ,NULL ,NULL ); +return hwmgr_handle_task (instance,AMD_PP_TASK_COMPLETE_INIT ,NULL ); }static int pp_dpm_set_pp_table (void *handle,const char *buf,size_t size)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +3 -5
@@ -373,7 +373,7 @@ static enum PP_StateUILabel power_state_convert(enum amd_pm_state_type state) }int hwmgr_handle_task (struct pp_instance *handle,enum amd_pp_task task_id, -void *input,void *output) +enum amd_pm_state_type *user_state) {int ret =0 ;struct pp_hwmgr *hwmgr;
@@ -395,17 +395,15 @@ int hwmgr_handle_task(struct pp_instance *handle, enum amd_pp_task task_id,break ;case AMD_PP_TASK_ENABLE_USER_STATE : { -enum amd_pm_state_type ps;enum PP_StateUILabel requested_ui_label;struct pp_power_state *requested_ps =NULL ; -if (input ==NULL ) { +if (user_state ==NULL ) { ret = -EINVAL ;break ; } - ps = *(unsigned long *)input; - requested_ui_label =power_state_convert (ps); + requested_ui_label =power_state_convert (*user_state); ret =psm_set_user_performance_state (hwmgr, requested_ui_label, &requested_ps);if (ret)return ret;
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -1
@@ -815,7 +815,7 @@ extern int hwmgr_hw_suspend(struct pp_instance *handle);extern int hwmgr_hw_resume (struct pp_instance *handle);extern int hwmgr_handle_task (struct pp_instance *handle,enum amd_pp_task task_id, -void *input,void *output); +enum amd_pm_state_type *user_state);extern int phm_wait_on_register (struct pp_hwmgr *hwmgr,uint32_t index,uint32_t value,uint32_t mask);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1514533479-14038-3-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Acked-byRe: [PATCH 3/4] drm/amd/powerplay: removed hwmgr_handle_task unused parameter and given a better name for other parameter
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Friday, December 29, 2017 2:44:38 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 3/4] drm/amd/powerplay: removed hwmgr_handle_task unused parameter and given a better name for other parameter
--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 10 +++++----- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 2 +- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 12 ++++++------ drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 8 +++----- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 +- 6 files changed, 18 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +2 -2
@@ -328,8 +328,8 @@ enum amdgpu_pcie_gen {#define amdgpu_dpm_set_mclk_od (adev, value) \ ((adev)->powerplay.pp_funcs->set_mclk_od((adev)->powerplay.pp_handle, value)) -#define amdgpu_dpm_dispatch_task (adev, task_id, input, output) \ - ((adev)->powerplay.pp_funcs->dispatch_tasks)((adev)->powerplay.pp_handle, (task_id), (input), (output)) +#define amdgpu_dpm_dispatch_task (adev, task_id, user_state) \ + ((adev)->powerplay.pp_funcs->dispatch_tasks)((adev)->powerplay.pp_handle, (task_id), (user_state))#define amdgpu_dpm_check_state_equal (adev, cps, rps, equal) \ ((adev)->powerplay.pp_funcs->check_state_equal((adev)->powerplay.pp_handle, (cps), (rps), (equal)))
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +5 -5
@@ -114,7 +114,7 @@ static ssize_t amdgpu_set_dpm_state(struct device *dev, }if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_ENABLE_USER_STATE , &state,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_ENABLE_USER_STATE , &state); }else {mutex_lock (&adev->pm.mutex); adev->pm.dpm.user_state = state;
@@ -314,7 +314,7 @@ static ssize_t amdgpu_set_pp_force_state(struct device *dev,if (state !=POWER_STATE_TYPE_INTERNAL_BOOT && state !=POWER_STATE_TYPE_DEFAULT ) {amdgpu_dpm_dispatch_task (adev, -AMD_PP_TASK_ENABLE_USER_STATE , &state,NULL ); +AMD_PP_TASK_ENABLE_USER_STATE , &state); adev->pp_force_state_enabled = true; } }
@@ -528,7 +528,7 @@ static ssize_t amdgpu_set_pp_sclk_od(struct device *dev,amdgpu_dpm_set_sclk_od (adev, (uint32_t )value);if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ); }else { adev->pm.dpm.current_ps = adev->pm.dpm.boot_ps;amdgpu_pm_compute_clocks (adev);
@@ -572,7 +572,7 @@ static ssize_t amdgpu_set_pp_mclk_od(struct device *dev,amdgpu_dpm_set_mclk_od (adev, (uint32_t )value);if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ); }else { adev->pm.dpm.current_ps = adev->pm.dpm.boot_ps;amdgpu_pm_compute_clocks (adev);
@@ -1459,7 +1459,7 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev) }if (adev->powerplay.pp_funcs->dispatch_tasks) { -amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_DISPLAY_CONFIG_CHANGE ,NULL ,NULL ); +amdgpu_dpm_dispatch_task (adev,AMD_PP_TASK_DISPLAY_CONFIG_CHANGE ,NULL ); }else {mutex_lock (&adev->pm.mutex); adev->pm.dpm.new_active_crtcs =0 ;
drivers/gpu/drm/amd/include/kgd_pp_interface.h +1 -1
@@ -256,7 +256,7 @@ struct amd_pm_funcs {void (*powergate_vce)(void *handle,bool gate);struct amd_vce_state *(*get_vce_clock_state)(void *handle,u32 idx);int (*dispatch_tasks)(void *handle,enum amd_pp_task task_id, -void *input,void *output); +enum amd_pm_state_type *user_state);int (*load_firmware)(void *handle);int (*wait_for_fw_loading_complete)(void *handle);int (*set_clockgating_by_smu)(void *handle,uint32_t msg_id);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +6 -6
@@ -33,7 +33,7 @@#define PP_DPM_DISABLED 0xCCCCstatic int pp_dpm_dispatch_tasks (void *handle,enum amd_pp_task task_id, -void *input,void *output); +enum amd_pm_state_type *user_state);static inline int pp_check (struct pp_instance *handle) {
@@ -198,7 +198,7 @@ static int pp_late_init(void *handle) ret =pp_check (pp_handle);if (ret ==0 )pp_dpm_dispatch_tasks (pp_handle, -AMD_PP_TASK_COMPLETE_INIT ,NULL ,NULL ); +AMD_PP_TASK_COMPLETE_INIT ,NULL );return 0 ; }
@@ -397,7 +397,7 @@ static int pp_dpm_force_performance_level(void *handle,mutex_lock (&pp_handle->pp_lock);pp_dpm_en_umd_pstate (hwmgr, &level); hwmgr->request_dpm_level = level; -hwmgr_handle_task (pp_handle,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ,NULL ); +hwmgr_handle_task (pp_handle,AMD_PP_TASK_READJUST_POWER_STATE ,NULL ); ret = hwmgr->hwmgr_func->force_dpm_level (hwmgr, level);if (!ret) hwmgr->dpm_level = hwmgr->request_dpm_level;
@@ -519,7 +519,7 @@ static void pp_dpm_powergate_uvd(void *handle, bool gate) }static int pp_dpm_dispatch_tasks (void *handle,enum amd_pp_task task_id, -void *input,void *output) +enum amd_pm_state_type *user_state) {int ret =0 ;struct pp_instance *pp_handle = (struct pp_instance *)handle;
@@ -530,7 +530,7 @@ static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_task task_id,return ret;mutex_lock (&pp_handle->pp_lock); - ret =hwmgr_handle_task (pp_handle, task_id, input, output); + ret =hwmgr_handle_task (pp_handle, task_id, user_state);mutex_unlock (&pp_handle->pp_lock);return ret;
@@ -805,7 +805,7 @@ static int amd_powerplay_reset(void *handle)if (ret)return ret; -return hwmgr_handle_task (instance,AMD_PP_TASK_COMPLETE_INIT ,NULL ,NULL ); +return hwmgr_handle_task (instance,AMD_PP_TASK_COMPLETE_INIT ,NULL ); }static int pp_dpm_set_pp_table (void *handle,const char *buf,size_t size)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +3 -5
@@ -373,7 +373,7 @@ static enum PP_StateUILabel power_state_convert(enum amd_pm_state_type state) }int hwmgr_handle_task (struct pp_instance *handle,enum amd_pp_task task_id, -void *input,void *output) +enum amd_pm_state_type *user_state) {int ret =0 ;struct pp_hwmgr *hwmgr;
@@ -395,17 +395,15 @@ int hwmgr_handle_task(struct pp_instance *handle, enum amd_pp_task task_id,break ;case AMD_PP_TASK_ENABLE_USER_STATE : { -enum amd_pm_state_type ps;enum PP_StateUILabel requested_ui_label;struct pp_power_state *requested_ps =NULL ; -if (input ==NULL ) { +if (user_state ==NULL ) { ret = -EINVAL ;break ; } - ps = *(unsigned long *)input; - requested_ui_label =power_state_convert (ps); + requested_ui_label =power_state_convert (*user_state); ret =psm_set_user_performance_state (hwmgr, requested_ui_label, &requested_ps);if (ret)return ret;
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -1
@@ -815,7 +815,7 @@ extern int hwmgr_hw_suspend(struct pp_instance *handle);extern int hwmgr_hw_resume (struct pp_instance *handle);extern int hwmgr_handle_task (struct pp_instance *handle,enum amd_pp_task task_id, -void *input,void *output); +enum amd_pm_state_type *user_state);extern int phm_wait_on_register (struct pp_hwmgr *hwmgr,uint32_t index,uint32_t value,uint32_t mask);
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/4 drm/amd/powerplay: set pp_num_states as 0 on error situation
In reply to a message not in the archive--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +2 -0
@@ -726,6 +726,8 @@ static int pp_dpm_get_pp_num_states(void *handle,struct pp_instance *pp_handle = (struct pp_instance *)handle;int ret =0 ; +memset (data,0 ,sizeof (*data)); + ret =pp_check (pp_handle);if (ret)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1514533479-14038-4-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Acked-byRe: [PATCH 4/4] drm/amd/powerplay: set pp_num_states as 0 on error situation
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Friday, December 29, 2017 2:44:39 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 4/4] drm/amd/powerplay: set pp_num_states as 0 on error situation
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +2 -0
@@ -726,6 +726,8 @@ static int pp_dpm_get_pp_num_states(void *handle,struct pp_instance *pp_handle = (struct pp_instance *)handle;int ret =0 ; +memset (data,0 ,sizeof (*data)); + ret =pp_check (pp_handle);if (ret)
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
I don't think the hwmon interface should expose the units in the string, this will probably break some applications that use the hwmon interface. They are assumed to be milli-degrees celsius as per the API.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Friday, December 29, 2017 2:44 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 1/4] drm/amd/powerplay: show the right unit for the temp printed out
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -2
@@ -789,7 +789,7 @@ static ssize_t amdgpu_hwmon_show_temp(struct device *dev,else temp =amdgpu_dpm_get_temperature (adev); -return snprintf (buf,PAGE_SIZE ,"%d\n" , temp); +return snprintf (buf,PAGE_SIZE ,"%d millicelsius\n" , temp); } static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,
@@ -805,7 +805,7 @@ static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,else temp = adev->pm.dpm.thermal.max_temp; -return snprintf (buf,PAGE_SIZE ,"%d\n" , temp); +return snprintf (buf,PAGE_SIZE ,"%d millicelsius\n" , temp); } static ssize_t amdgpu_hwmon_get_pwm1_enable(struct device *dev,
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB16520A7E810230A8EFAFD531F71A0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Got it. I will drop this patch.
Regards,
Evan
From: Deucher, Alexander
Sent: Sunday, December 31, 2017 2:29 AM
To: Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 1/4] drm/amd/powerplay: show the right unit for the temp printed out
I don't think the hwmon interface should expose the units in the string, this will probably break some applications that use the hwmon interface. They are assumed to be milli-degrees celsius as per the API.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Evan Quan <[email protected]<mailto:[email protected]>>
Sent: Friday, December 29, 2017 2:44 AM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan
Subject: [PATCH 1/4] drm/amd/powerplay: show the right unit for the temp printed out
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -2
@@ -789,7 +789,7 @@ static ssize_t amdgpu_hwmon_show_temp(struct device *dev,else temp =amdgpu_dpm_get_temperature (adev); -return snprintf (buf,PAGE_SIZE ,"%d\n" , temp); +return snprintf (buf,PAGE_SIZE ,"%d millicelsius\n" , temp); } static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,
@@ -805,7 +805,7 @@ static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,else temp = adev->pm.dpm.thermal.max_temp; -return snprintf (buf,PAGE_SIZE ,"%d\n" , temp); +return snprintf (buf,PAGE_SIZE ,"%d millicelsius\n" , temp); } static ssize_t amdgpu_hwmon_get_pwm1_enable(struct device *dev,
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx