Commit e6c0c64a authored by Jani Nikula's avatar Jani Nikula

drm/i915/dp: don't call the link parameters sink parameters

If we modify these on the fly depending on the link conditions, don't
pretend they are sink properties.

Some link vs. sink confusion still remains, but we'll take care of them
in follow-up patches.

Cc: Manasi Navare <manasi.d.navare@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-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/3739b4fac502ebd1c6e075a62c1a195e4094eb16.1491485983.git.jani.nikula@intel.com
parent b1810a74
...@@ -172,7 +172,7 @@ static u8 intel_dp_max_lane_count(struct intel_dp *intel_dp) ...@@ -172,7 +172,7 @@ static u8 intel_dp_max_lane_count(struct intel_dp *intel_dp)
u8 source_max, sink_max; u8 source_max, sink_max;
source_max = intel_dig_port->max_lanes; source_max = intel_dig_port->max_lanes;
sink_max = intel_dp->max_sink_lane_count; sink_max = intel_dp->max_link_lane_count;
return min(source_max, sink_max); return min(source_max, sink_max);
} }
...@@ -326,11 +326,11 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp, ...@@ -326,11 +326,11 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
intel_dp->num_common_rates, intel_dp->num_common_rates,
link_rate); link_rate);
if (index > 0) { if (index > 0) {
intel_dp->max_sink_link_rate = intel_dp->common_rates[index - 1]; intel_dp->max_link_rate = intel_dp->common_rates[index - 1];
intel_dp->max_sink_lane_count = lane_count; intel_dp->max_link_lane_count = lane_count;
} else if (lane_count > 1) { } else if (lane_count > 1) {
intel_dp->max_sink_link_rate = intel_dp_max_sink_rate(intel_dp); intel_dp->max_link_rate = intel_dp_max_sink_rate(intel_dp);
intel_dp->max_sink_lane_count = lane_count >> 1; intel_dp->max_link_lane_count = lane_count >> 1;
} else { } else {
DRM_ERROR("Link Training Unsuccessful\n"); DRM_ERROR("Link Training Unsuccessful\n");
return -1; return -1;
...@@ -1561,8 +1561,7 @@ intel_dp_max_link_rate(struct intel_dp *intel_dp) ...@@ -1561,8 +1561,7 @@ intel_dp_max_link_rate(struct intel_dp *intel_dp)
{ {
int len; int len;
len = intel_dp_common_len_rate_limit(intel_dp, len = intel_dp_common_len_rate_limit(intel_dp, intel_dp->max_link_rate);
intel_dp->max_sink_link_rate);
if (WARN_ON(len <= 0)) if (WARN_ON(len <= 0))
return 162000; return 162000;
...@@ -1639,7 +1638,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -1639,7 +1638,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
uint8_t link_bw, rate_select; uint8_t link_bw, rate_select;
common_len = intel_dp_common_len_rate_limit(intel_dp, common_len = intel_dp_common_len_rate_limit(intel_dp,
intel_dp->max_sink_link_rate); intel_dp->max_link_rate);
/* No common link rates between source and sink */ /* No common link rates between source and sink */
WARN_ON(common_len <= 0); WARN_ON(common_len <= 0);
...@@ -3969,7 +3968,7 @@ static uint8_t intel_dp_autotest_link_training(struct intel_dp *intel_dp) ...@@ -3969,7 +3968,7 @@ static uint8_t intel_dp_autotest_link_training(struct intel_dp *intel_dp)
test_lane_count &= DP_MAX_LANE_COUNT_MASK; test_lane_count &= DP_MAX_LANE_COUNT_MASK;
/* Validate the requested lane count */ /* Validate the requested lane count */
if (test_lane_count < min_lane_count || if (test_lane_count < min_lane_count ||
test_lane_count > intel_dp->max_sink_lane_count) test_lane_count > intel_dp->max_link_lane_count)
return DP_TEST_NAK; return DP_TEST_NAK;
status = drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_LINK_RATE, status = drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_LINK_RATE,
...@@ -4637,11 +4636,11 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) ...@@ -4637,11 +4636,11 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)
yesno(drm_dp_tps3_supported(intel_dp->dpcd))); yesno(drm_dp_tps3_supported(intel_dp->dpcd)));
if (intel_dp->reset_link_params) { if (intel_dp->reset_link_params) {
/* Set the max lane count for sink */ /* Set the max lane count for link */
intel_dp->max_sink_lane_count = drm_dp_max_lane_count(intel_dp->dpcd); intel_dp->max_link_lane_count = drm_dp_max_lane_count(intel_dp->dpcd);
/* Set the max link rate for sink */ /* Set the max link rate for link */
intel_dp->max_sink_link_rate = intel_dp_max_sink_rate(intel_dp); intel_dp->max_link_rate = intel_dp_max_sink_rate(intel_dp);
intel_dp->reset_link_params = false; intel_dp->reset_link_params = false;
} }
......
...@@ -959,10 +959,10 @@ struct intel_dp { ...@@ -959,10 +959,10 @@ struct intel_dp {
/* intersection of source and sink rates */ /* intersection of source and sink rates */
int num_common_rates; int num_common_rates;
int common_rates[DP_MAX_SUPPORTED_RATES]; int common_rates[DP_MAX_SUPPORTED_RATES];
/* Max lane count for the sink as per DPCD registers */ /* Max lane count for the current link */
uint8_t max_sink_lane_count; int max_link_lane_count;
/* Max link BW for the sink as per DPCD registers */ /* Max rate for the current link */
int max_sink_link_rate; int max_link_rate;
/* sink or branch descriptor */ /* sink or branch descriptor */
struct intel_dp_desc desc; struct intel_dp_desc desc;
struct drm_dp_aux aux; struct drm_dp_aux aux;
......
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