drm/amd/display: Fix hang/underflow when transitioning to ODM4:1
authorIlya Bakoulin <ilya.bakoulin@amd.com>
Fri, 8 Dec 2023 17:19:33 +0000 (12:19 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Dec 2023 19:59:03 +0000 (14:59 -0500)
[Why]
Under some circumstances, disabling an OPTC and attempting to reclaim
its OPP(s) for a different OPTC could cause a hang/underflow due to OPPs
not being properly disconnected from the disabled OPTC.

[How]
Ensure that all OPPs are unassigned from an OPTC when it gets disabled.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Ilya Bakoulin <ilya.bakoulin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c
drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c

index a2c4db2cebdd6c742a91e20d77869c5cd94b7ee1..91ea0d4da06a9443bb199759fde0c75ae44fc8f3 100644 (file)
@@ -172,6 +172,13 @@ static bool optc32_disable_crtc(struct timing_generator *optc)
        REG_UPDATE(OTG_CONTROL,
                        OTG_MASTER_EN, 0);
 
+       REG_UPDATE_5(OPTC_DATA_SOURCE_SELECT,
+                       OPTC_SEG0_SRC_SEL, 0xf,
+                       OPTC_SEG1_SRC_SEL, 0xf,
+                       OPTC_SEG2_SRC_SEL, 0xf,
+                       OPTC_SEG3_SRC_SEL, 0xf,
+                       OPTC_NUM_OF_INPUT_SEGMENT, 0);
+
        REG_UPDATE(CONTROL,
                        VTG0_ENABLE, 0);
 
index a4a39f1638cf26cecd82590c23725d70112d4d38..08a59cf449cae5c27fe7dbe8fc1b2f847f462f9f 100644 (file)
@@ -144,6 +144,13 @@ static bool optc35_disable_crtc(struct timing_generator *optc)
        REG_UPDATE(OTG_CONTROL,
                        OTG_MASTER_EN, 0);
 
+       REG_UPDATE_5(OPTC_DATA_SOURCE_SELECT,
+                       OPTC_SEG0_SRC_SEL, 0xf,
+                       OPTC_SEG1_SRC_SEL, 0xf,
+                       OPTC_SEG2_SRC_SEL, 0xf,
+                       OPTC_SEG3_SRC_SEL, 0xf,
+                       OPTC_NUM_OF_INPUT_SEGMENT, 0);
+
        REG_UPDATE(CONTROL,
                        VTG0_ENABLE, 0);