Skip to content

Commit 0d9cabc

Browse files
Leon Huangalexdeucher
authored andcommitted
drm/amd/display: Fix incorrect DPCD configs while Replay/PSR switch
[Why] When switching between PSR/Replay, the DPCD config of previous mode is not cleared, resulting in unexpected behavior in TCON. [How] Initialize the DPCD in setup function Reviewed-by: Robin Chen <robin.chen@amd.com> Signed-off-by: Leon Huang <Leon.Huang1@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent ed962f8 commit 0d9cabc

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,18 @@ bool edp_setup_psr(struct dc_link *link,
675675
if (!link)
676676
return false;
677677

678+
//Clear PSR cfg
679+
memset(&psr_configuration, 0, sizeof(psr_configuration));
680+
dm_helpers_dp_write_dpcd(
681+
link->ctx,
682+
link,
683+
DP_PSR_EN_CFG,
684+
&psr_configuration.raw,
685+
sizeof(psr_configuration.raw));
686+
687+
if (link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED)
688+
return false;
689+
678690
dc = link->ctx->dc;
679691
dmcu = dc->res_pool->dmcu;
680692
psr = dc->res_pool->psr;
@@ -685,9 +697,6 @@ bool edp_setup_psr(struct dc_link *link,
685697
if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
686698
return false;
687699

688-
689-
memset(&psr_configuration, 0, sizeof(psr_configuration));
690-
691700
psr_configuration.bits.ENABLE = 1;
692701
psr_configuration.bits.CRC_VERIFICATION = 1;
693702
psr_configuration.bits.FRAME_CAPTURE_INDICATION =
@@ -950,6 +959,16 @@ bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream
950959
if (!link)
951960
return false;
952961

962+
//Clear Replay config
963+
dm_helpers_dp_write_dpcd(link->ctx, link,
964+
DP_SINK_PR_ENABLE_AND_CONFIGURATION,
965+
(uint8_t *)&(replay_config.raw), sizeof(uint8_t));
966+
967+
if (!(link->replay_settings.config.replay_supported))
968+
return false;
969+
970+
link->replay_settings.config.replay_error_status.raw = 0;
971+
953972
dc = link->ctx->dc;
954973

955974
replay = dc->res_pool->replay;

0 commit comments

Comments
 (0)