drm/amd/powerplay: move clock dpm enablement check to smu_v11/v12
authorEvan Quan <evan.quan@amd.com>
Tue, 7 Jul 2020 02:24:31 +0000 (10:24 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Jul 2020 19:37:37 +0000 (15:37 -0400)
As those APIs of smu_v11/v12 are more widely called. And they
need this check also.

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

index 0516eb0ec68718f4bb7a9ac20fc042b40bd5f68c..ba568ff3ab2268cc04542ef0cc4c089143651056 100644 (file)
@@ -262,9 +262,6 @@ int smu_set_soft_freq_range(struct smu_context *smu,
 {
        int ret = 0;
 
-       if (!smu_clk_dpm_is_enabled(smu, clk_type))
-               return 0;
-
        mutex_lock(&smu->mutex);
 
        if (smu->ppt_funcs->set_soft_freq_limited_range)
index f5a981d79ee356b03f0688205d7afdc7510cdb42..17b165e428537ba689ba5283d24e167ca1cc3ee5 100644 (file)
@@ -1769,6 +1769,9 @@ int smu_v11_0_set_soft_freq_limited_range(struct smu_context *smu,
        int ret = 0, clk_id = 0;
        uint32_t param;
 
+       if (!smu_clk_dpm_is_enabled(smu, clk_type))
+               return 0;
+
        clk_id = smu_cmn_to_asic_specific_index(smu,
                                                CMN2ASIC_MAPPING_CLK,
                                                clk_type);
index 05e3870c13d70e5164a9f736529dc4b0b8b67ef9..7286edec2789652150ad17fd69ae9798d86a5b29 100644 (file)
@@ -328,6 +328,9 @@ int smu_v12_0_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_
 {
        int ret = 0;
 
+       if (!smu_clk_dpm_is_enabled(smu, clk_type))
+               return 0;
+
        switch (clk_type) {
        case SMU_GFXCLK:
        case SMU_SCLK: