Commit d7e8ef02 authored by Manasi Navare's avatar Manasi Navare Committed by Jani Nikula

drm/i915/dp: Reset the link params on HPD/connected boot/resume

The max link parameters should be set/reset only on HPD or
connected boot case or on system resume.

Add a flag reset_link_params to intel_dp to decide when
to reset the max link parameters. This prevents the parameters
from getting reset/overwritten through all other
connector->funcs->detect() calls. This is important when link
training fails and the max link params are modified to the
lower fallback values.

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1486515251-23469-1-git-send-email-manasi.d.navare@intel.com
parent 75c7b0b8
...@@ -4624,11 +4624,15 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) ...@@ -4624,11 +4624,15 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)
yesno(intel_dp_source_supports_hbr2(intel_dp)), yesno(intel_dp_source_supports_hbr2(intel_dp)),
yesno(drm_dp_tps3_supported(intel_dp->dpcd))); yesno(drm_dp_tps3_supported(intel_dp->dpcd)));
/* Set the max lane count for sink */ if (intel_dp->reset_link_params) {
intel_dp->max_sink_lane_count = drm_dp_max_lane_count(intel_dp->dpcd); /* Set the max lane count for sink */
intel_dp->max_sink_lane_count = drm_dp_max_lane_count(intel_dp->dpcd);
/* Set the max link BW for sink */ /* Set the max link BW for sink */
intel_dp->max_sink_link_bw = intel_dp_max_link_bw(intel_dp); intel_dp->max_sink_link_bw = intel_dp_max_link_bw(intel_dp);
intel_dp->reset_link_params = false;
}
intel_dp_print_rates(intel_dp); intel_dp_print_rates(intel_dp);
...@@ -5010,6 +5014,8 @@ void intel_dp_encoder_reset(struct drm_encoder *encoder) ...@@ -5010,6 +5014,8 @@ void intel_dp_encoder_reset(struct drm_encoder *encoder)
if (lspcon->active) if (lspcon->active)
lspcon_resume(lspcon); lspcon_resume(lspcon);
intel_dp->reset_link_params = true;
pps_lock(intel_dp); pps_lock(intel_dp);
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
...@@ -5079,6 +5085,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) ...@@ -5079,6 +5085,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
long_hpd ? "long" : "short"); long_hpd ? "long" : "short");
if (long_hpd) { if (long_hpd) {
intel_dp->reset_link_params = true;
intel_dp->detect_done = false; intel_dp->detect_done = false;
return IRQ_NONE; return IRQ_NONE;
} }
...@@ -5947,6 +5954,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -5947,6 +5954,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
intel_dig_port->max_lanes, port_name(port))) intel_dig_port->max_lanes, port_name(port)))
return false; return false;
intel_dp->reset_link_params = true;
intel_dp->pps_pipe = INVALID_PIPE; intel_dp->pps_pipe = INVALID_PIPE;
intel_dp->active_pipe = INVALID_PIPE; intel_dp->active_pipe = INVALID_PIPE;
......
...@@ -933,6 +933,7 @@ struct intel_dp { ...@@ -933,6 +933,7 @@ struct intel_dp {
bool has_audio; bool has_audio;
bool detect_done; bool detect_done;
bool channel_eq_status; bool channel_eq_status;
bool reset_link_params;
enum hdmi_force_audio force_audio; enum hdmi_force_audio force_audio;
bool limited_color_range; bool limited_color_range;
bool color_range_auto; bool color_range_auto;
......
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