Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Remove PIPE_DTO_SRC_SEL programming from set_dtbclk_dto

There are cases where an OTG is remapped from driving a regular HDMI
display to a DP/eDP display. There are also cases where DTBCLK needs to
be enabled for HPO, but DTBCLK DTO programming may be done while OTG is
still enabled which is dangerous as the PIPE_DTO_SRC_SEL programming may
change the pixel clock generator source for a mapped and running OTG and
cause it to hang.

Remove the PIPE_DTO_SRC_SEL programming from this sequence since it is
already done in program_pixel_clk(). Additionally, make sure that
program_pixel_clk sets DTBCLK DTO as source for special HDMI cases.

Cc: stable@vger.kernel.org # 6.11+
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Ovidiu Bunea <Ovidiu.Bunea@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ovidiu Bunea and committed by
Alex Deucher
a3e6079b 1df1d452

+9 -6
+9 -6
drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c
··· 1392 1392 1393 1393 /* The recommended programming sequence to enable DTBCLK DTO to generate 1394 1394 * valid pixel HPO DPSTREAM ENCODER, specifies that DTO source select should 1395 - * be set only after DTO is enabled 1395 + * be set only after DTO is enabled. 1396 + * PIPEx_DTO_SRC_SEL should not be programmed during DTBCLK update since OTG may still be on, and the 1397 + * programming is handled in program_pix_clk() regardless, so it can be removed from here. 1396 1398 */ 1397 - REG_UPDATE(OTG_PIXEL_RATE_CNTL[params->otg_inst], 1398 - PIPE_DTO_SRC_SEL[params->otg_inst], 2); 1399 1399 } else { 1400 1400 switch (params->otg_inst) { 1401 1401 case 0: ··· 1412 1412 break; 1413 1413 } 1414 1414 1415 - REG_UPDATE_2(OTG_PIXEL_RATE_CNTL[params->otg_inst], 1416 - DTBCLK_DTO_ENABLE[params->otg_inst], 0, 1417 - PIPE_DTO_SRC_SEL[params->otg_inst], params->is_hdmi ? 0 : 1); 1415 + /** 1416 + * PIPEx_DTO_SRC_SEL should not be programmed during DTBCLK update since OTG may still be on, and the 1417 + * programming is handled in program_pix_clk() regardless, so it can be removed from here. 1418 + */ 1419 + REG_UPDATE(OTG_PIXEL_RATE_CNTL[params->otg_inst], 1420 + DTBCLK_DTO_ENABLE[params->otg_inst], 0); 1418 1421 1419 1422 REG_WRITE(DTBCLK_DTO_MODULO[params->otg_inst], 0); 1420 1423 REG_WRITE(DTBCLK_DTO_PHASE[params->otg_inst], 0);