diff options
author | Kevin Wang <Kevin1.Wang@amd.com> | 2019-01-17 00:15:48 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 16:03:58 -0400 |
commit | 0989532330e1e7d25693c14b3d57288aa4915f81 (patch) | |
tree | 34002bb1560b8bcea5af25b91d130970b59d6d4c /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | 143c75d6514dd65ba49d3846a5a02c45a4b7f15b (diff) |
drm/amd/powerplay: implement sysfs of get num states function
add function smu_get_power_num_state function for sw-smu.
it's only for sysfs interface, the power state feature is not ready for sw-smu.
Signed-off-by: Kevin Wang <Kevin1.Wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@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/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 53b470c30da4..5eda007ea632 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -350,9 +350,13 @@ static ssize_t amdgpu_get_pp_num_states(struct device *dev, | |||
350 | struct drm_device *ddev = dev_get_drvdata(dev); | 350 | struct drm_device *ddev = dev_get_drvdata(dev); |
351 | struct amdgpu_device *adev = ddev->dev_private; | 351 | struct amdgpu_device *adev = ddev->dev_private; |
352 | struct pp_states_info data; | 352 | struct pp_states_info data; |
353 | int i, buf_len; | 353 | int i, buf_len, ret; |
354 | 354 | ||
355 | if (adev->powerplay.pp_funcs->get_pp_num_states) | 355 | if (is_support_sw_smu(adev)) { |
356 | ret = smu_get_power_num_states(&adev->smu, &data); | ||
357 | if (ret) | ||
358 | return ret; | ||
359 | } else if (adev->powerplay.pp_funcs->get_pp_num_states) | ||
356 | amdgpu_dpm_get_pp_num_states(adev, &data); | 360 | amdgpu_dpm_get_pp_num_states(adev, &data); |
357 | 361 | ||
358 | buf_len = snprintf(buf, PAGE_SIZE, "states: %d\n", data.nums); | 362 | buf_len = snprintf(buf, PAGE_SIZE, "states: %d\n", data.nums); |