drm/amd/powerplay: Tidy up cz_dpm_powerup_uvd()
authorTom St Denis <tom.stdenis@amd.com>
Mon, 16 Oct 2017 17:28:24 +0000 (13:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Oct 2017 19:27:13 +0000 (15:27 -0400)
Use PP_CAP and simplify enable/disable logic.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c

index c2afc0aaa2cbeaffcb3fce7f23054b493e869a8d..c57f7f3b54ec7a9b31ef4b73a0efbbe6ba215297 100644 (file)
@@ -1281,18 +1281,11 @@ int cz_dpm_powerdown_uvd(struct pp_hwmgr *hwmgr)
 
 int cz_dpm_powerup_uvd(struct pp_hwmgr *hwmgr)
 {
-       if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-                                        PHM_PlatformCaps_UVDPowerGating)) {
-               if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
-                                 PHM_PlatformCaps_UVDDynamicPowerGating)) {
-                       return smum_send_msg_to_smc_with_parameter(
-                                                               hwmgr,
-                                                  PPSMC_MSG_UVDPowerON, 1);
-               } else {
-                       return smum_send_msg_to_smc_with_parameter(
-                                                               hwmgr,
-                                                  PPSMC_MSG_UVDPowerON, 0);
-               }
+       if (PP_CAP(PHM_PlatformCaps_UVDPowerGating)) {
+               return smum_send_msg_to_smc_with_parameter(
+                       hwmgr,
+                       PPSMC_MSG_UVDPowerON,
+                       PP_CAP(PHM_PlatformCaps_UVDDynamicPowerGating) ? 1 : 0);
        }
 
        return 0;