drm/amd/display: Set number of pipes to 1 if the second pipe was disabled
authorNikola Cornij <nikola.cornij@amd.com>
Wed, 28 Aug 2019 22:30:43 +0000 (18:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:43:29 +0000 (16:43 +0100)
commit19378ed7eb3a7649dc62502a776b6b3eb3054066
tree361b16c29cd8e00ac96ef1eac3898e0ec7af0c5d
parentf780e4ace1eda3caaa21b80cbf3abd7152c9d563
drm/amd/display: Set number of pipes to 1 if the second pipe was disabled

[ Upstream commit 2fef0faa1cdc5d41ce3ef83f7b8f7e7ecb02d700 ]

[why]
Some ODM-related register settings are inconsistently updated by VBIOS, causing
the state in DC to be invalid, which would then end up crashing in certain
use-cases (such as disable/enable device).

[how]
Check the enabled status of the second pipe when determining the number of
OPTC sources. If the second pipe is disabled, set the number of sources to 1
regardless of other settings (that may not be updated correctly).

Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Leo Li <sunpeng.li@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/dcn20/dcn20_optc.c