diff options
| author | Le Ma <[email protected]> | 2023-09-07 07:32:13 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-09-26 21:00:23 +0000 |
| commit | d07f1c20dd7c5d94cb7eceb822a060c108e49d23 (patch) | |
| tree | fd6030ff1f7715e8c4ea670901a12d581471cb0f /drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | |
| parent | drm/amd/pm: add plpd_mode in smu_context to indicate current mode (diff) | |
| download | kernel-d07f1c20dd7c5d94cb7eceb822a060c108e49d23.tar.gz kernel-d07f1c20dd7c5d94cb7eceb822a060c108e49d23.zip | |
drm/amd/pm: add xgmi plpd mode selecting interface for smu v13.0.6
Add the interface to change xgmi per-link power down policy.
v2: split from sysfs interface code and miscellaneous updates
v3: check against XGMI_PLPD_DEFAULT/XGMI_PLPD_OPTIMIZED and
pass PPSMC param
Signed-off-by: Le Ma <[email protected]>
Reviewed-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c')
| -rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index e6f1620acdd4..893359b26418 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -3157,6 +3157,30 @@ static int smu_get_prv_buffer_details(void *handle, void **addr, size_t *size) return 0; } +int smu_set_xgmi_plpd_mode(struct smu_context *smu, + enum pp_xgmi_plpd_mode mode) +{ + int ret = -EOPNOTSUPP; + + if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) + return ret; + + /* PLPD policy is not supported if it's NONE */ + if (smu->plpd_mode == XGMI_PLPD_NONE) + return ret; + + if (smu->plpd_mode == mode) + return 0; + + if (smu->ppt_funcs && smu->ppt_funcs->select_xgmi_plpd_policy) + ret = smu->ppt_funcs->select_xgmi_plpd_policy(smu, mode); + + if (!ret) + smu->plpd_mode = mode; + + return ret; +} + static const struct amd_pm_funcs swsmu_pm_funcs = { /* export for sysfs */ .set_fan_control_mode = smu_set_fan_control_mode, |
