drm/amd/powerplay: add socclk profile dpm support.
authorKevin Wang <kevin1.wang@amd.com>
Fri, 12 Jul 2019 06:40:12 +0000 (14:40 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Jul 2019 18:03:03 +0000 (13:03 -0500)
1.miss socclk profile support when bringup.
2.add feature check for socclk.

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 04132653e289368971dd61e6edff124f92cb46a5..5f844357e6acbd4af78464545eb726ba8a8dc886 100644 (file)
@@ -149,6 +149,11 @@ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
                        pr_warn("gfxclk dpm is not enabled\n");
                        return 0;
                }
+       case SMU_SOCCLK:
+               if (!smu_feature_is_enabled(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
+                       pr_warn("sockclk dpm is not enabled\n");
+                       return 0;
+               }
                break;
        default:
                break;
@@ -1388,6 +1393,7 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu,
                                return ret;
                        smu_force_clk_levels(smu, SMU_SCLK, 1 << sclk_mask);
                        smu_force_clk_levels(smu, SMU_MCLK, 1 << mclk_mask);
+                       smu_force_clk_levels(smu, SMU_SOCCLK, 1 << soc_mask);
                        break;
 
                case AMD_DPM_FORCED_LEVEL_MANUAL: