From: Nikola Cornij Date: Wed, 28 Aug 2019 22:30:43 +0000 (-0400) Subject: drm/amd/display: Set number of pipes to 1 if the second pipe was disabled X-Git-Tag: v5.15~4946^2~37^2~184 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2fef0faa1cdc5d41ce3ef83f7b8f7e7ecb02d700;p=platform%2Fkernel%2Flinux-starfive.git drm/amd/display: Set number of pipes to 1 if the second pipe was disabled [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 Reviewed-by: Dmytro Laktyushkin Acked-by: Leo Li Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c index 2137e2b..dda9099 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c @@ -287,6 +287,10 @@ void optc2_get_optc_source(struct timing_generator *optc, *num_of_src_opp = 2; else *num_of_src_opp = 1; + + /* Work around VBIOS not updating OPTC_NUM_OF_INPUT_SEGMENT */ + if (*src_opp_id_1 == 0xf) + *num_of_src_opp = 1; } void optc2_set_dwb_source(struct timing_generator *optc,