aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
diff options
context:
space:
mode:
authorLikun Gao <Likun.Gao@amd.com>2019-02-19 05:18:46 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 16:04:01 -0400
commit0967610142275c3aa1b73d923505cb8e73916af5 (patch)
tree38a811835cf04ae7f9fa5aae9305873173b8220c /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
parentf067499b4862c053a8971461d0d937e173690ddf (diff)
drm/amd/powerplay: support sysfs to get socclk, fclk, dcefclk
Add sys interface to get socclk, fclk and dcefclk for smu. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Gui Chengming <Jack.Gui@amd.com> Reviewed-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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index d3efba85683f..99309153fb9e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -906,7 +906,9 @@ static ssize_t amdgpu_get_pp_dpm_socclk(struct device *dev,
906 struct drm_device *ddev = dev_get_drvdata(dev); 906 struct drm_device *ddev = dev_get_drvdata(dev);
907 struct amdgpu_device *adev = ddev->dev_private; 907 struct amdgpu_device *adev = ddev->dev_private;
908 908
909 if (adev->powerplay.pp_funcs->print_clock_levels) 909 if (is_support_sw_smu(adev))
910 return smu_print_clk_levels(&adev->smu, PP_SOCCLK, buf);
911 else if (adev->powerplay.pp_funcs->print_clock_levels)
910 return amdgpu_dpm_print_clock_levels(adev, PP_SOCCLK, buf); 912 return amdgpu_dpm_print_clock_levels(adev, PP_SOCCLK, buf);
911 else 913 else
912 return snprintf(buf, PAGE_SIZE, "\n"); 914 return snprintf(buf, PAGE_SIZE, "\n");
@@ -942,7 +944,9 @@ static ssize_t amdgpu_get_pp_dpm_fclk(struct device *dev,
942 struct drm_device *ddev = dev_get_drvdata(dev); 944 struct drm_device *ddev = dev_get_drvdata(dev);
943 struct amdgpu_device *adev = ddev->dev_private; 945 struct amdgpu_device *adev = ddev->dev_private;
944 946
945 if (adev->powerplay.pp_funcs->print_clock_levels) 947 if (is_support_sw_smu(adev))
948 return smu_print_clk_levels(&adev->smu, PP_FCLK, buf);
949 else if (adev->powerplay.pp_funcs->print_clock_levels)
946 return amdgpu_dpm_print_clock_levels(adev, PP_FCLK, buf); 950 return amdgpu_dpm_print_clock_levels(adev, PP_FCLK, buf);
947 else 951 else
948 return snprintf(buf, PAGE_SIZE, "\n"); 952 return snprintf(buf, PAGE_SIZE, "\n");
@@ -978,7 +982,9 @@ static ssize_t amdgpu_get_pp_dpm_dcefclk(struct device *dev,
978 struct drm_device *ddev = dev_get_drvdata(dev); 982 struct drm_device *ddev = dev_get_drvdata(dev);
979 struct amdgpu_device *adev = ddev->dev_private; 983 struct amdgpu_device *adev = ddev->dev_private;
980 984
981 if (adev->powerplay.pp_funcs->print_clock_levels) 985 if (is_support_sw_smu(adev))
986 return smu_print_clk_levels(&adev->smu, PP_DCEFCLK, buf);
987 else if (adev->powerplay.pp_funcs->print_clock_levels)
982 return amdgpu_dpm_print_clock_levels(adev, PP_DCEFCLK, buf); 988 return amdgpu_dpm_print_clock_levels(adev, PP_DCEFCLK, buf);
983 else 989 else
984 return snprintf(buf, PAGE_SIZE, "\n"); 990 return snprintf(buf, PAGE_SIZE, "\n");