drm/amd/powerplay: optimize the interface for mgpu fan boost enablement
Cover the implementation details from outside(of power). Also preparing for expanding this to swSMU. Signed-off-by: Evan Quan <evan.quan@amd.com> Acked-by: Nirmoy Das <nirmoy.das@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
e1a84641d4
commit
f10bb940d8
|
@ -2228,9 +2228,7 @@ static int amdgpu_device_enable_mgpu_fan_boost(void)
|
|||
gpu_ins = &(mgpu_info.gpu_ins[i]);
|
||||
adev = gpu_ins->adev;
|
||||
if (!(adev->flags & AMD_IS_APU) &&
|
||||
!gpu_ins->mgpu_fan_enabled &&
|
||||
adev->powerplay.pp_funcs &&
|
||||
adev->powerplay.pp_funcs->enable_mgpu_fan_boost) {
|
||||
!gpu_ins->mgpu_fan_enabled) {
|
||||
ret = amdgpu_dpm_enable_mgpu_fan_boost(adev);
|
||||
if (ret)
|
||||
break;
|
||||
|
|
|
@ -1216,3 +1216,16 @@ int amdgpu_dpm_allow_xgmi_power_down(struct amdgpu_device *adev, bool en)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int amdgpu_dpm_enable_mgpu_fan_boost(struct amdgpu_device *adev)
|
||||
{
|
||||
void *pp_handle = adev->powerplay.pp_handle;
|
||||
const struct amd_pm_funcs *pp_funcs =
|
||||
adev->powerplay.pp_funcs;
|
||||
int ret = 0;
|
||||
|
||||
if (pp_funcs && pp_funcs->enable_mgpu_fan_boost)
|
||||
ret = pp_funcs->enable_mgpu_fan_boost(pp_handle);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -357,10 +357,6 @@ enum amdgpu_pcie_gen {
|
|||
((adev)->powerplay.pp_funcs->odn_edit_dpm_table(\
|
||||
(adev)->powerplay.pp_handle, type, parameter, size))
|
||||
|
||||
#define amdgpu_dpm_enable_mgpu_fan_boost(adev) \
|
||||
((adev)->powerplay.pp_funcs->enable_mgpu_fan_boost(\
|
||||
(adev)->powerplay.pp_handle))
|
||||
|
||||
#define amdgpu_dpm_get_ppfeature_status(adev, buf) \
|
||||
((adev)->powerplay.pp_funcs->get_ppfeature_status(\
|
||||
(adev)->powerplay.pp_handle, (buf)))
|
||||
|
@ -548,4 +544,6 @@ int amdgpu_dpm_set_df_cstate(struct amdgpu_device *adev,
|
|||
|
||||
int amdgpu_dpm_allow_xgmi_power_down(struct amdgpu_device *adev, bool en);
|
||||
|
||||
int amdgpu_dpm_enable_mgpu_fan_boost(struct amdgpu_device *adev);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue