diff options
| author | Hawking Zhang <[email protected]> | 2020-02-24 06:19:56 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2020-02-26 19:17:32 +0000 |
| commit | 53e0f1e6beb0fbe83b3be611f717962681dfcef0 (patch) | |
| tree | 7838af56bd08e656a32736e7d8021010eba3314b /drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | |
| parent | drm/amdgpu: update psp firmwares loading sequence V2 (diff) | |
| download | kernel-53e0f1e6beb0fbe83b3be611f717962681dfcef0.tar.gz kernel-53e0f1e6beb0fbe83b3be611f717962681dfcef0.zip | |
drm/amdgpu: add dpm helper function for DF Cstate control
The helper function hides software smu and legacy powerplay
implementation for DF Cstate control.
Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Evan Quan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c index a2e8c3dfb4f1..ba1bb95a3cf9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c @@ -1171,3 +1171,20 @@ int amdgpu_dpm_set_xgmi_pstate(struct amdgpu_device *adev, return ret; } + +int amdgpu_dpm_set_df_cstate(struct amdgpu_device *adev, + uint32_t cstate) +{ + int ret = 0; + const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs; + void *pp_handle = adev->powerplay.pp_handle; + struct smu_context *smu = &adev->smu; + + if (is_support_sw_smu(adev)) + ret = smu_set_df_cstate(smu, cstate); + else if (pp_funcs && + pp_funcs->set_df_cstate) + ret = pp_funcs->set_df_cstate(pp_handle, cstate); + + return ret; +} |
