Commit 89c7dfa9 authored by Lewis Huang's avatar Lewis Huang Committed by Alex Deucher

drm/amd/display: Separate fec debug flag and monitor patch

[Why]
Driver apply the monitor patch into global debug flag.  When apply
monitor patch, fec feature will always disable.

[How]
Separate fec debug flag and monitor patch
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarLewis Huang <Lewis.Huang@amd.com>
Reviewed-by: default avatarWenjing Liu <Wenjing.Liu@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f03e80d2
...@@ -1065,9 +1065,6 @@ static bool dc_link_detect_helper(struct dc_link *link, ...@@ -1065,9 +1065,6 @@ static bool dc_link_detect_helper(struct dc_link *link,
break; break;
} }
if (link->local_sink->edid_caps.panel_patch.disable_fec)
link->ctx->dc->debug.disable_fec = true;
// Check if edid is the same // Check if edid is the same
if ((prev_sink) && if ((prev_sink) &&
(edid_status == EDID_THE_SAME || edid_status == EDID_OK)) (edid_status == EDID_THE_SAME || edid_status == EDID_OK))
...@@ -3635,7 +3632,7 @@ uint32_t dc_link_bandwidth_kbps( ...@@ -3635,7 +3632,7 @@ uint32_t dc_link_bandwidth_kbps(
link_bw_kbps *= 8; /* 8 bits per byte*/ link_bw_kbps *= 8; /* 8 bits per byte*/
link_bw_kbps *= link_setting->lane_count; link_bw_kbps *= link_setting->lane_count;
if (dc_link_is_fec_supported(link) && !link->dc->debug.disable_fec) { if (dc_link_should_enable_fec(link)) {
/* Account for FEC overhead. /* Account for FEC overhead.
* We have to do it based on caps, * We have to do it based on caps,
* and not based on FEC being set ready, * and not based on FEC being set ready,
...@@ -3687,3 +3684,18 @@ bool dc_link_is_fec_supported(const struct dc_link *link) ...@@ -3687,3 +3684,18 @@ bool dc_link_is_fec_supported(const struct dc_link *link)
!IS_FPGA_MAXIMUS_DC(link->ctx->dce_environment)); !IS_FPGA_MAXIMUS_DC(link->ctx->dce_environment));
} }
bool dc_link_should_enable_fec(const struct dc_link *link)
{
bool is_fec_disable = false;
bool ret = false;
if (link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT_MST &&
link->local_sink &&
link->local_sink->edid_caps.panel_patch.disable_fec)
is_fec_disable = true;
if (dc_link_is_fec_supported(link) && !link->dc->debug.disable_fec && !is_fec_disable)
ret = true;
return ret;
}
...@@ -4345,7 +4345,7 @@ void dp_set_fec_ready(struct dc_link *link, bool ready) ...@@ -4345,7 +4345,7 @@ void dp_set_fec_ready(struct dc_link *link, bool ready)
struct link_encoder *link_enc = link->link_enc; struct link_encoder *link_enc = link->link_enc;
uint8_t fec_config = 0; uint8_t fec_config = 0;
if (!dc_link_is_fec_supported(link) || link->dc->debug.disable_fec) if (!dc_link_should_enable_fec(link))
return; return;
if (link_enc->funcs->fec_set_ready && if (link_enc->funcs->fec_set_ready &&
...@@ -4380,7 +4380,7 @@ void dp_set_fec_enable(struct dc_link *link, bool enable) ...@@ -4380,7 +4380,7 @@ void dp_set_fec_enable(struct dc_link *link, bool enable)
{ {
struct link_encoder *link_enc = link->link_enc; struct link_encoder *link_enc = link->link_enc;
if (!dc_link_is_fec_supported(link) || link->dc->debug.disable_fec) if (!dc_link_should_enable_fec(link))
return; return;
if (link_enc->funcs->fec_set_enable && if (link_enc->funcs->fec_set_enable &&
......
...@@ -369,5 +369,6 @@ uint32_t dc_bandwidth_in_kbps_from_timing( ...@@ -369,5 +369,6 @@ uint32_t dc_bandwidth_in_kbps_from_timing(
const struct dc_crtc_timing *timing); const struct dc_crtc_timing *timing);
bool dc_link_is_fec_supported(const struct dc_link *link); bool dc_link_is_fec_supported(const struct dc_link *link);
bool dc_link_should_enable_fec(const struct dc_link *link);
#endif /* DC_LINK_H_ */ #endif /* DC_LINK_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment