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

Commit ab8db87b authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher
Browse files

drm/amd/powerplay: refine vce dpm update code on Cz.



Program HardMin based on the vce_arbiter.ecclk
if ecclk is 0, disable ECLK DPM 0. Otherwise VCE
could hang if switching SCLK from DPM 0 to 6/7

Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a8447647
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -1402,14 +1402,22 @@ int cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr)
					     cz_hwmgr->vce_dpm.hard_min_clk,
						PPSMC_MSG_SetEclkHardMin));
	} else {
		/*EPR# 419220 -HW limitation to to */
		/*Program HardMin based on the vce_arbiter.ecclk */
		if (hwmgr->vce_arbiter.ecclk == 0) {
			smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
					    PPSMC_MSG_SetEclkHardMin, 0);
		/* disable ECLK DPM 0. Otherwise VCE could hang if
		 * switching SCLK from DPM 0 to 6/7 */
			smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
					PPSMC_MSG_SetEclkSoftMin, 1);
		} else {
			cz_hwmgr->vce_dpm.hard_min_clk = hwmgr->vce_arbiter.ecclk;
			smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
						PPSMC_MSG_SetEclkHardMin,
						cz_get_eclk_level(hwmgr,
						cz_hwmgr->vce_dpm.hard_min_clk,
						PPSMC_MSG_SetEclkHardMin));

		}
	}
	return 0;
}