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

drm/amd/display: Update setting of DP training parameters.

[Why]
Some links are dynamically assigned link encoders on stream enablement.

[How]
Update DisplayPort training parameter determination stage that assumes
link encoder statically assigned to link.

Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jimmy Kizito and committed by
Alex Deucher
ede4f6da 99732e52

+60 -8
+16 -1
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 48 48 #include "dce/dmub_psr.h" 49 49 #include "dmub/dmub_srv.h" 50 50 #include "inc/hw/panel_cntl.h" 51 + #include "inc/link_enc_cfg.h" 51 52 52 53 #define DC_LOGGER_INIT(logger) 53 54 ··· 3738 3737 3739 3738 bool dc_link_is_fec_supported(const struct dc_link *link) 3740 3739 { 3740 + struct link_encoder *link_enc = NULL; 3741 + 3742 + /* Links supporting dynamically assigned link encoder will be assigned next 3743 + * available encoder if one not already assigned. 3744 + */ 3745 + if (link->is_dig_mapping_flexible && 3746 + link->dc->res_pool->funcs->link_encs_assign) { 3747 + link_enc = link_enc_cfg_get_link_enc_used_by_link(link->dc->current_state, link); 3748 + if (link_enc == NULL) 3749 + link_enc = link_enc_cfg_get_next_avail_link_enc(link->dc, link->dc->current_state); 3750 + } else 3751 + link_enc = link->link_enc; 3752 + ASSERT(link_enc); 3753 + 3741 3754 return (dc_is_dp_signal(link->connector_signal) && 3742 - link->link_enc->features.fec_supported && 3755 + link_enc->features.fec_supported && 3743 3756 link->dpcd_caps.fec_cap.bits.FEC_CAPABLE && 3744 3757 !IS_FPGA_MAXIMUS_DC(link->ctx->dce_environment)); 3745 3758 }