Commit 2493f21f authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Daniel Vetter

drm/i915: Rename DP link training functions

The link training functions had confusing names. The start function
actually does the clock recovery phase of the link training, and the
complete function does the channel equalization. So call them that
instead. Also, every call to intel_dp_start_link_train() was followed
by a call to intel_dp_complete_link_train(), so add a new start
function that calls clock_recory and channel_equalization.
Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 0b5e88dc
...@@ -2320,7 +2320,6 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) ...@@ -2320,7 +2320,6 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
intel_dp_complete_link_train(intel_dp);
if (port != PORT_A || INTEL_INFO(dev)->gen >= 9) if (port != PORT_A || INTEL_INFO(dev)->gen >= 9)
intel_dp_stop_link_train(intel_dp); intel_dp_stop_link_train(intel_dp);
} else if (type == INTEL_OUTPUT_HDMI) { } else if (type == INTEL_OUTPUT_HDMI) {
......
...@@ -2604,7 +2604,6 @@ static void intel_enable_dp(struct intel_encoder *encoder) ...@@ -2604,7 +2604,6 @@ static void intel_enable_dp(struct intel_encoder *encoder)
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
intel_dp_complete_link_train(intel_dp);
intel_dp_stop_link_train(intel_dp); intel_dp_stop_link_train(intel_dp);
if (crtc->config->has_audio) { if (crtc->config->has_audio) {
...@@ -3691,8 +3690,8 @@ static void intel_dp_set_idle_link_train(struct intel_dp *intel_dp) ...@@ -3691,8 +3690,8 @@ static void intel_dp_set_idle_link_train(struct intel_dp *intel_dp)
} }
/* Enable corresponding port and start training pattern 1 */ /* Enable corresponding port and start training pattern 1 */
void static void
intel_dp_start_link_train(struct intel_dp *intel_dp) intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp)
{ {
struct drm_encoder *encoder = &dp_to_dig_port(intel_dp)->base.base; struct drm_encoder *encoder = &dp_to_dig_port(intel_dp)->base.base;
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
...@@ -3805,8 +3804,8 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) ...@@ -3805,8 +3804,8 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
intel_dp->DP = DP; intel_dp->DP = DP;
} }
void static void
intel_dp_complete_link_train(struct intel_dp *intel_dp) intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp)
{ {
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
struct drm_device *dev = dig_port->base.base.dev; struct drm_device *dev = dig_port->base.base.dev;
...@@ -3859,7 +3858,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) ...@@ -3859,7 +3858,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
if (!drm_dp_clock_recovery_ok(link_status, if (!drm_dp_clock_recovery_ok(link_status,
intel_dp->lane_count)) { intel_dp->lane_count)) {
intel_dp->train_set_valid = false; intel_dp->train_set_valid = false;
intel_dp_start_link_train(intel_dp); intel_dp_link_training_clock_recovery(intel_dp);
intel_dp_set_link_train(intel_dp, &DP, intel_dp_set_link_train(intel_dp, &DP,
training_pattern | training_pattern |
DP_LINK_SCRAMBLING_DISABLE); DP_LINK_SCRAMBLING_DISABLE);
...@@ -3876,7 +3875,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) ...@@ -3876,7 +3875,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
/* Try 5 times, then try clock recovery if that fails */ /* Try 5 times, then try clock recovery if that fails */
if (tries > 5) { if (tries > 5) {
intel_dp->train_set_valid = false; intel_dp->train_set_valid = false;
intel_dp_start_link_train(intel_dp); intel_dp_link_training_clock_recovery(intel_dp);
intel_dp_set_link_train(intel_dp, &DP, intel_dp_set_link_train(intel_dp, &DP,
training_pattern | training_pattern |
DP_LINK_SCRAMBLING_DISABLE); DP_LINK_SCRAMBLING_DISABLE);
...@@ -3909,6 +3908,13 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp) ...@@ -3909,6 +3908,13 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp)
DP_TRAINING_PATTERN_DISABLE); DP_TRAINING_PATTERN_DISABLE);
} }
void
intel_dp_start_link_train(struct intel_dp *intel_dp)
{
intel_dp_link_training_clock_recovery(intel_dp);
intel_dp_link_training_channel_equalization(intel_dp);
}
static void static void
intel_dp_link_down(struct intel_dp *intel_dp) intel_dp_link_down(struct intel_dp *intel_dp)
{ {
...@@ -4377,7 +4383,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) ...@@ -4377,7 +4383,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
!drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) { !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
DRM_DEBUG_KMS("channel EQ not ok, retraining\n"); DRM_DEBUG_KMS("channel EQ not ok, retraining\n");
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
intel_dp_complete_link_train(intel_dp);
intel_dp_stop_link_train(intel_dp); intel_dp_stop_link_train(intel_dp);
} }
...@@ -4468,7 +4473,6 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) ...@@ -4468,7 +4473,6 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n", DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n",
intel_encoder->base.name); intel_encoder->base.name);
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
intel_dp_complete_link_train(intel_dp);
intel_dp_stop_link_train(intel_dp); intel_dp_stop_link_train(intel_dp);
} }
} }
......
...@@ -188,7 +188,6 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) ...@@ -188,7 +188,6 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
intel_dp_complete_link_train(intel_dp);
intel_dp_stop_link_train(intel_dp); intel_dp_stop_link_train(intel_dp);
} }
......
...@@ -1217,7 +1217,6 @@ bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -1217,7 +1217,6 @@ bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
void intel_dp_set_link_params(struct intel_dp *intel_dp, void intel_dp_set_link_params(struct intel_dp *intel_dp,
const struct intel_crtc_state *pipe_config); const struct intel_crtc_state *pipe_config);
void intel_dp_start_link_train(struct intel_dp *intel_dp); void intel_dp_start_link_train(struct intel_dp *intel_dp);
void intel_dp_complete_link_train(struct intel_dp *intel_dp);
void intel_dp_stop_link_train(struct intel_dp *intel_dp); void intel_dp_stop_link_train(struct intel_dp *intel_dp);
void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode); void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
void intel_dp_encoder_destroy(struct drm_encoder *encoder); void intel_dp_encoder_destroy(struct drm_encoder *encoder);
......
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