drm/amd/powerplay: enable swSMU mgpu fan boost support
Enable mgpu fan boost feature on swSMU routines. 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
f10bb940d8
commit
9f979a49e2
@ -1222,9 +1222,12 @@ 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;
|
||||
struct smu_context *smu = &adev->smu;
|
||||
int ret = 0;
|
||||
|
||||
if (pp_funcs && pp_funcs->enable_mgpu_fan_boost)
|
||||
if (is_support_sw_smu(adev))
|
||||
ret = smu_enable_mgpu_fan_boost(smu);
|
||||
else if (pp_funcs && pp_funcs->enable_mgpu_fan_boost)
|
||||
ret = pp_funcs->enable_mgpu_fan_boost(pp_handle);
|
||||
|
||||
return ret;
|
||||
|
||||
@ -2652,3 +2652,20 @@ ssize_t smu_sys_get_gpu_metrics(struct smu_context *smu,
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
int smu_enable_mgpu_fan_boost(struct smu_context *smu)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
mutex_lock(&smu->mutex);
|
||||
|
||||
if (smu->ppt_funcs->enable_mgpu_fan_boost)
|
||||
ret = smu->ppt_funcs->enable_mgpu_fan_boost(smu);
|
||||
|
||||
mutex_unlock(&smu->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -595,6 +595,7 @@ struct pptable_funcs {
|
||||
size_t (*get_pp_feature_mask)(struct smu_context *smu, char *buf);
|
||||
int (*set_pp_feature_mask)(struct smu_context *smu, uint64_t new_mask);
|
||||
ssize_t (*get_gpu_metrics)(struct smu_context *smu, void **table);
|
||||
int (*enable_mgpu_fan_boost)(struct smu_context *smu);
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
@ -799,5 +800,7 @@ int smu_get_status_gfxoff(struct amdgpu_device *adev, uint32_t *value);
|
||||
|
||||
ssize_t smu_sys_get_gpu_metrics(struct smu_context *smu, void **table);
|
||||
|
||||
int smu_enable_mgpu_fan_boost(struct smu_context *smu);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user