Commit 573a0a03 authored by Jimmy Kizito's avatar Jimmy Kizito Committed by Alex Deucher

drm/amd/display: Expand DP module training API.

[Why & How]
Add functionality useful for DP link training to public interface.
Signed-off-by: default avatarJimmy Kizito <Jimmy.Kizito@amd.com>
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarStylon Wang <stylon.wang@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 82253671
...@@ -1175,7 +1175,7 @@ static inline enum link_training_result perform_link_training_int( ...@@ -1175,7 +1175,7 @@ static inline enum link_training_result perform_link_training_int(
return status; return status;
} }
static enum link_training_result check_link_loss_status( enum link_training_result dp_check_link_loss_status(
struct dc_link *link, struct dc_link *link,
const struct link_training_settings *link_training_setting) const struct link_training_settings *link_training_setting)
{ {
...@@ -1309,7 +1309,7 @@ static void initialize_training_settings( ...@@ -1309,7 +1309,7 @@ static void initialize_training_settings(
lt_settings->enhanced_framing = 1; lt_settings->enhanced_framing = 1;
} }
static uint8_t convert_to_count(uint8_t lttpr_repeater_count) uint8_t dp_convert_to_count(uint8_t lttpr_repeater_count)
{ {
switch (lttpr_repeater_count) { switch (lttpr_repeater_count) {
case 0x80: // 1 lttpr repeater case 0x80: // 1 lttpr repeater
...@@ -1378,7 +1378,7 @@ static void configure_lttpr_mode_non_transparent(struct dc_link *link) ...@@ -1378,7 +1378,7 @@ static void configure_lttpr_mode_non_transparent(struct dc_link *link)
link->dpcd_caps.lttpr_caps.mode = repeater_mode; link->dpcd_caps.lttpr_caps.mode = repeater_mode;
} }
repeater_cnt = convert_to_count(link->dpcd_caps.lttpr_caps.phy_repeater_cnt); repeater_cnt = dp_convert_to_count(link->dpcd_caps.lttpr_caps.phy_repeater_cnt);
for (repeater_id = repeater_cnt; repeater_id > 0; repeater_id--) { for (repeater_id = repeater_cnt; repeater_id > 0; repeater_id--) {
aux_interval_address = DP_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER1 + aux_interval_address = DP_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER1 +
...@@ -1605,7 +1605,7 @@ enum link_training_result dc_link_dp_perform_link_training( ...@@ -1605,7 +1605,7 @@ enum link_training_result dc_link_dp_perform_link_training(
/* 2. perform link training (set link training done /* 2. perform link training (set link training done
* to false is done as well) * to false is done as well)
*/ */
repeater_cnt = convert_to_count(link->dpcd_caps.lttpr_caps.phy_repeater_cnt); repeater_cnt = dp_convert_to_count(link->dpcd_caps.lttpr_caps.phy_repeater_cnt);
for (repeater_id = repeater_cnt; (repeater_id > 0 && status == LINK_TRAINING_SUCCESS); for (repeater_id = repeater_cnt; (repeater_id > 0 && status == LINK_TRAINING_SUCCESS);
repeater_id--) { repeater_id--) {
...@@ -1648,7 +1648,7 @@ enum link_training_result dc_link_dp_perform_link_training( ...@@ -1648,7 +1648,7 @@ enum link_training_result dc_link_dp_perform_link_training(
*/ */
if (link->connector_signal != SIGNAL_TYPE_EDP && status == LINK_TRAINING_SUCCESS) { if (link->connector_signal != SIGNAL_TYPE_EDP && status == LINK_TRAINING_SUCCESS) {
msleep(5); msleep(5);
status = check_link_loss_status(link, &lt_settings); status = dp_check_link_loss_status(link, &lt_settings);
} }
/* 6. print status message*/ /* 6. print status message*/
......
...@@ -97,5 +97,12 @@ void dp_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable); ...@@ -97,5 +97,12 @@ void dp_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable);
bool dp_update_dsc_config(struct pipe_ctx *pipe_ctx); bool dp_update_dsc_config(struct pipe_ctx *pipe_ctx);
bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable); bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable);
/* Convert PHY repeater count read from DPCD uint8_t. */
uint8_t dp_convert_to_count(uint8_t lttpr_repeater_count);
/* Check DPCD training status registers to detect link loss. */
enum link_training_result dp_check_link_loss_status(
struct dc_link *link,
const struct link_training_settings *link_training_setting);
#endif /* __DC_LINK_DP_H__ */ #endif /* __DC_LINK_DP_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