Commit 8de297dc authored by Aric Cyr's avatar Aric Cyr Committed by Alex Deucher
Browse files

drm/amd/display: Avoid MPC infinite loop



[why]
In some cases MPC tree bottom pipe ends up point to itself.  This causes
iterating from top to bottom to hang the system in an infinite loop.

[how]
When looping to next MPC bottom pipe, check that the pointer is not same
as current to avoid infinite loop.

Reviewed-by: default avatarJosip Pavic <Josip.Pavic@amd.com>
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarAric Cyr <aric.cyr@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4c5aa594
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@ void mpc1_set_bg_color(struct mpc *mpc,

	/* find bottommost mpcc. */
	while (bottommost_mpcc->mpcc_bot) {
		/* avoid circular linked link */
		ASSERT(bottommost_mpcc != bottommost_mpcc->mpcc_bot);
		if (bottommost_mpcc == bottommost_mpcc->mpcc_bot)
			break;

		bottommost_mpcc = bottommost_mpcc->mpcc_bot;
	}