aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2019-05-13 03:32:21 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-05-24 13:20:59 -0400
commitfe75a323713e9ed254c4e3d27b391b2416cee237 (patch)
treeb75a32210470b083b33d02cb4f3d9369d3a5605c /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
parente969f29148baee095a6ca5f81e840890578abeac (diff)
drm/amd/powerplay: support ppfeatures sysfs interface on sw smu routine
Support ppfeatures sysfs interface on Vega20 sw smu routine. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@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.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index bd40d5d72508..adba9ea03e63 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -767,7 +767,11 @@ static ssize_t amdgpu_set_ppfeature_status(struct device *dev,
767 767
768 pr_debug("featuremask = 0x%llx\n", featuremask); 768 pr_debug("featuremask = 0x%llx\n", featuremask);
769 769
770 if (adev->powerplay.pp_funcs->set_ppfeature_status) { 770 if (is_support_sw_smu(adev)) {
771 ret = smu_set_ppfeature_status(&adev->smu, featuremask);
772 if (ret)
773 return -EINVAL;
774 } else if (adev->powerplay.pp_funcs->set_ppfeature_status) {
771 ret = amdgpu_dpm_set_ppfeature_status(adev, featuremask); 775 ret = amdgpu_dpm_set_ppfeature_status(adev, featuremask);
772 if (ret) 776 if (ret)
773 return -EINVAL; 777 return -EINVAL;
@@ -783,7 +787,9 @@ static ssize_t amdgpu_get_ppfeature_status(struct device *dev,
783 struct drm_device *ddev = dev_get_drvdata(dev); 787 struct drm_device *ddev = dev_get_drvdata(dev);
784 struct amdgpu_device *adev = ddev->dev_private; 788 struct amdgpu_device *adev = ddev->dev_private;
785 789
786 if (adev->powerplay.pp_funcs->get_ppfeature_status) 790 if (is_support_sw_smu(adev)) {
791 return smu_get_ppfeature_status(&adev->smu, buf);
792 } else if (adev->powerplay.pp_funcs->get_ppfeature_status)
787 return amdgpu_dpm_get_ppfeature_status(adev, buf); 793 return amdgpu_dpm_get_ppfeature_status(adev, buf);
788 794
789 return snprintf(buf, PAGE_SIZE, "\n"); 795 return snprintf(buf, PAGE_SIZE, "\n");