Skip to content

Commit 941ef8c

Browse files
committed
Reprogram PHY on FRL retraining attempt
1 parent a97befa commit 941ef8c

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "link_hwss.h"
1111
#include "link_ddc.h"
1212
#include "dc_hdmi_types.h"
13+
#include "resource.h"
1314

1415
#define DC_LOGGER link->ctx->logger
1516

@@ -249,8 +250,9 @@ bool dc_link_perform_frl_training(struct dc_link *link,
249250
bool dc_link_perform_frl_training_with_retries(struct dc_link *link,
250251
const struct link_resource *link_res)
251252
{
253+
const struct link_hwss *link_hwss = get_link_hwss(link, link_res);
252254
uint8_t min_rate;
253-
bool success;
255+
bool success = false;
254256
int i;
255257

256258
/*
@@ -264,6 +266,19 @@ bool dc_link_perform_frl_training_with_retries(struct dc_link *link,
264266
link->cur_link_settings.lane_count = link->cur_link_settings.frl_rate <= 2 ? 3 : 4;
265267

266268
for (i = 0; i < FRL_TRAINING_RETRIES; ++i) {
269+
/* Reprogram the PHY for the current rate attempt. The caller
270+
* (enable_link_hdmi) already called enable_hdmi_link_output once
271+
* at the DFM-selected rate; disable and re-enable here so the
272+
* PHY clock matches whatever rate we are about to train at.
273+
*/
274+
link_hwss->disable_link_output(link, link_res,
275+
link->connector_signal);
276+
if (link_hwss->ext.enable_hdmi_link_output)
277+
link_hwss->ext.enable_hdmi_link_output(
278+
link, link_res,
279+
link->connector_signal,
280+
&link->cur_link_settings);
281+
267282
success = dc_link_perform_frl_training(link, link_res);
268283

269284
if (success)

0 commit comments

Comments
 (0)