diff options
author | Likun Gao <Likun.Gao@amd.com> | 2019-01-14 21:56:55 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 16:03:57 -0400 |
commit | 86ac88030725d34a2746b46185ee6b15bf42cdfe (patch) | |
tree | f3d93c95fb65fd9170e291054f61525583f80b9b /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | bed3b3a1e19a08c9028db50cb1ebe2e0106c3811 (diff) |
drm/amd/powerplay: print clock levels for smu11 (v2)
Add function to print current levels for smu11.
v2: expose get_current_clk_freq for smu v11. (Kevin)
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
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 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index a7adb7b6bd98..c124a90e1475 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "amdgpu_pm.h" | 28 | #include "amdgpu_pm.h" |
29 | #include "amdgpu_dpm.h" | 29 | #include "amdgpu_dpm.h" |
30 | #include "amdgpu_display.h" | 30 | #include "amdgpu_display.h" |
31 | #include "amdgpu_smu.h" | ||
31 | #include "atom.h" | 32 | #include "atom.h" |
32 | #include <linux/power_supply.h> | 33 | #include <linux/power_supply.h> |
33 | #include <linux/hwmon.h> | 34 | #include <linux/hwmon.h> |
@@ -711,7 +712,9 @@ static ssize_t amdgpu_get_pp_dpm_sclk(struct device *dev, | |||
711 | struct drm_device *ddev = dev_get_drvdata(dev); | 712 | struct drm_device *ddev = dev_get_drvdata(dev); |
712 | struct amdgpu_device *adev = ddev->dev_private; | 713 | struct amdgpu_device *adev = ddev->dev_private; |
713 | 714 | ||
714 | if (adev->powerplay.pp_funcs->print_clock_levels) | 715 | if (adev->smu.ppt_funcs) |
716 | return smu_print_clk_levels(&adev->smu, PP_SCLK, buf); | ||
717 | else if (adev->powerplay.pp_funcs->print_clock_levels) | ||
715 | return amdgpu_dpm_print_clock_levels(adev, PP_SCLK, buf); | 718 | return amdgpu_dpm_print_clock_levels(adev, PP_SCLK, buf); |
716 | else | 719 | else |
717 | return snprintf(buf, PAGE_SIZE, "\n"); | 720 | return snprintf(buf, PAGE_SIZE, "\n"); |
@@ -783,7 +786,9 @@ static ssize_t amdgpu_get_pp_dpm_mclk(struct device *dev, | |||
783 | struct drm_device *ddev = dev_get_drvdata(dev); | 786 | struct drm_device *ddev = dev_get_drvdata(dev); |
784 | struct amdgpu_device *adev = ddev->dev_private; | 787 | struct amdgpu_device *adev = ddev->dev_private; |
785 | 788 | ||
786 | if (adev->powerplay.pp_funcs->print_clock_levels) | 789 | if (adev->smu.ppt_funcs) |
790 | return smu_print_clk_levels(&adev->smu, PP_MCLK, buf); | ||
791 | else if (adev->powerplay.pp_funcs->print_clock_levels) | ||
787 | return amdgpu_dpm_print_clock_levels(adev, PP_MCLK, buf); | 792 | return amdgpu_dpm_print_clock_levels(adev, PP_MCLK, buf); |
788 | else | 793 | else |
789 | return snprintf(buf, PAGE_SIZE, "\n"); | 794 | return snprintf(buf, PAGE_SIZE, "\n"); |