aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorChengming Gui <Jack.Gui@amd.com>2019-01-04 04:42:09 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 16:03:59 -0400
commit8554e67d6e22b0bc3ba213b87a0b6e1ae0fd838c (patch)
tree7ac0b6f6f3e2330765c1ab7daf601ff32eda1b57 /drivers/gpu/drm/amd/amdgpu
parentad88f0517b239a08b148fbd300de103e8f7a78ef (diff)
drm/amd/powerplay: implement power_dpm_state sys interface for SMU11
Add functions to get/set dpm state for SMU11. Signed-off-by: Chengming Gui <Jack.Gui@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Kevin Wang <kevin.wang@amd.com> Reviewd-by: Evan Quan <evan.quan@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h6
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
index cc3f27e314e8..5b1539e72101 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
@@ -290,6 +290,12 @@ enum amdgpu_pcie_gen {
290#define amdgpu_dpm_get_current_power_state(adev) \ 290#define amdgpu_dpm_get_current_power_state(adev) \
291 ((adev)->powerplay.pp_funcs->get_current_power_state((adev)->powerplay.pp_handle)) 291 ((adev)->powerplay.pp_funcs->get_current_power_state((adev)->powerplay.pp_handle))
292 292
293#define amdgpu_smu_get_current_power_state(adev) \
294 ((adev)->smu.ppt_funcs->get_current_power_state(&((adev)->smu)))
295
296#define amdgpu_smu_set_power_state(adev) \
297 ((adev)->smu.ppt_funcs->set_power_state(&((adev)->smu)))
298
293#define amdgpu_dpm_get_pp_num_states(adev, data) \ 299#define amdgpu_dpm_get_pp_num_states(adev, data) \
294 ((adev)->powerplay.pp_funcs->get_pp_num_states((adev)->powerplay.pp_handle, data)) 300 ((adev)->powerplay.pp_funcs->get_pp_num_states((adev)->powerplay.pp_handle, data))
295 301
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 7fe0330ca319..f36e86b11880 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -144,7 +144,9 @@ static ssize_t amdgpu_get_dpm_state(struct device *dev,
144 struct amdgpu_device *adev = ddev->dev_private; 144 struct amdgpu_device *adev = ddev->dev_private;
145 enum amd_pm_state_type pm; 145 enum amd_pm_state_type pm;
146 146
147 if (adev->powerplay.pp_funcs->get_current_power_state) 147 if (adev->smu.ppt_funcs->get_current_power_state)
148 pm = amdgpu_smu_get_current_power_state(adev);
149 else if (adev->powerplay.pp_funcs->get_current_power_state)
148 pm = amdgpu_dpm_get_current_power_state(adev); 150 pm = amdgpu_dpm_get_current_power_state(adev);
149 else 151 else
150 pm = adev->pm.dpm.user_state; 152 pm = adev->pm.dpm.user_state;