Commit 5bd3e7ea authored by Imre Deak's avatar Imre Deak

drm/i915/dp: Reduce link params only after retrying with unchanged params

Try to maintain the current link parameters by retrying the link
training with unchanged link parameters before reducing these parameters
(sending an uevent to userspace to retrain the link instead).
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240610164933.2947366-9-imre.deak@intel.com
parent 3b3be899
...@@ -1771,6 +1771,8 @@ struct intel_dp { ...@@ -1771,6 +1771,8 @@ struct intel_dp {
int max_lane_count; int max_lane_count;
/* Max rate for the current link */ /* Max rate for the current link */
int max_rate; int max_rate;
/* Sequential link training failures after a passing LT */
int seq_train_failures;
} link; } link;
bool reset_link_params; bool reset_link_params;
int mso_link_count; int mso_link_count;
......
...@@ -2961,6 +2961,7 @@ static void intel_dp_reset_link_params(struct intel_dp *intel_dp) ...@@ -2961,6 +2961,7 @@ static void intel_dp_reset_link_params(struct intel_dp *intel_dp)
{ {
intel_dp->link.max_lane_count = intel_dp_max_common_lane_count(intel_dp); intel_dp->link.max_lane_count = intel_dp_max_common_lane_count(intel_dp);
intel_dp->link.max_rate = intel_dp_max_common_rate(intel_dp); intel_dp->link.max_rate = intel_dp_max_common_rate(intel_dp);
intel_dp->link.seq_train_failures = 0;
} }
/* Enable backlight PWM and backlight PP control. */ /* Enable backlight PWM and backlight PP control. */
...@@ -5075,6 +5076,9 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp) ...@@ -5075,6 +5076,9 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
intel_dp->lane_count)) intel_dp->lane_count))
return false; return false;
if (intel_dp->link.seq_train_failures)
return true;
/* Retrain if link not ok */ /* Retrain if link not ok */
return !intel_dp_link_ok(intel_dp, link_status); return !intel_dp_link_ok(intel_dp, link_status);
} }
......
...@@ -1487,10 +1487,13 @@ void intel_dp_start_link_train(struct intel_dp *intel_dp, ...@@ -1487,10 +1487,13 @@ void intel_dp_start_link_train(struct intel_dp *intel_dp,
passed = intel_dp_link_train_all_phys(intel_dp, crtc_state, lttpr_count); passed = intel_dp_link_train_all_phys(intel_dp, crtc_state, lttpr_count);
if (passed) { if (passed) {
intel_dp->link.seq_train_failures = 0;
intel_encoder_link_check_queue_work(encoder, 2000); intel_encoder_link_check_queue_work(encoder, 2000);
return; return;
} }
intel_dp->link.seq_train_failures++;
/* /*
* Ignore the link failure in CI * Ignore the link failure in CI
* *
...@@ -1508,6 +1511,11 @@ void intel_dp_start_link_train(struct intel_dp *intel_dp, ...@@ -1508,6 +1511,11 @@ void intel_dp_start_link_train(struct intel_dp *intel_dp,
return; return;
} }
if (intel_dp->link.seq_train_failures < 2) {
intel_encoder_link_check_queue_work(encoder, 0);
return;
}
intel_dp_schedule_fallback_link_training(intel_dp, crtc_state); intel_dp_schedule_fallback_link_training(intel_dp, crtc_state);
} }
......
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