drm/amd/display: Avoid MPC infinite loop
authorJosip Pavic <Josip.Pavic@amd.com>
Thu, 21 Jul 2022 19:33:00 +0000 (15:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Sep 2022 08:30:10 +0000 (10:30 +0200)
commit0c8abeceee0f58ad3fdc66e1de0c0e02b962653b
tree708add8d34dc6ac4a2975c87c9dad6eaf8565c26
parent061ffb1e419bd8185e143b69274cc9eba882a154
drm/amd/display: Avoid MPC infinite loop

[ Upstream commit 8de297dc046c180651c0500f8611663ae1c3828a ]

[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: Josip Pavic <Josip.Pavic@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c