Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59364704 authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher
Browse files

drm/amd/powerplay: Tidy up cz_dpm_powerup_uvd()



Use PP_CAP and simplify enable/disable logic.

Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 610dd60b
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -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 {
	if (PP_CAP(PHM_PlatformCaps_UVDPowerGating)) {
		return smum_send_msg_to_smc_with_parameter(
			hwmgr,
						   PPSMC_MSG_UVDPowerON, 0);
		}
			PPSMC_MSG_UVDPowerON,
			PP_CAP(PHM_PlatformCaps_UVDDynamicPowerGating) ? 1 : 0);
	}

	return 0;