drm/amd/powerplay: check prerequisite for VCN power gating
authorEvan Quan <evan.quan@amd.com>
Mon, 17 Jun 2019 09:27:49 +0000 (17:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2019 16:22:08 +0000 (11:22 -0500)
VCN DPM is a necessary prerequisite for VCN power gating.

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

index 527f7fa442efc6af68ce9abb23d67a90e56cf49e..137c2a34a606e2089fe38e897823a77c72914056 100644 (file)
@@ -574,15 +574,19 @@ static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable)
        struct smu_power_gate *power_gate = &smu_power->power_gate;
 
        if (enable && power_gate->uvd_gated) {
-               ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 1);
-               if (ret)
-                       return ret;
+               if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT)) {
+                       ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 1);
+                       if (ret)
+                               return ret;
+               }
                power_gate->uvd_gated = false;
        } else {
                if (!enable && !power_gate->uvd_gated) {
-                       ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn);
-                       if (ret)
-                               return ret;
+                       if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT)) {
+                               ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn);
+                               if (ret)
+                                       return ret;
+                       }
                        power_gate->uvd_gated = true;
                }
        }