Skip to content

Commit ff11cd6

Browse files
Leon Huanggregkh
authored andcommitted
drm/amd/display: Fix incorrect DPCD configs while Replay/PSR switch
[ Upstream commit 0d9cabc ] [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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ed7eda6 commit ff11cd6

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
@@ -674,6 +674,18 @@ bool edp_setup_psr(struct dc_link *link,
674674
if (!link)
675675
return false;
676676

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

687-
688-
memset(&psr_configuration, 0, sizeof(psr_configuration));
689-
690699
psr_configuration.bits.ENABLE = 1;
691700
psr_configuration.bits.CRC_VERIFICATION = 1;
692701
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)