Commit 50fec21a authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm/i915: Fix max link rate in intel_dp_mode_valid()

Consider the link rates reported by the sink via
DP_SUPPORTED_LINK_RATES when checking modes against the max link
rate.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarSonika Jindal <sonika.jindal@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 2ecae76a
...@@ -206,7 +206,7 @@ intel_dp_mode_valid(struct drm_connector *connector, ...@@ -206,7 +206,7 @@ intel_dp_mode_valid(struct drm_connector *connector,
target_clock = fixed_mode->clock; target_clock = fixed_mode->clock;
} }
max_link_clock = drm_dp_bw_code_to_link_rate(intel_dp_max_link_bw(intel_dp)); max_link_clock = intel_dp_max_link_rate(intel_dp);
max_lanes = intel_dp_max_lane_count(intel_dp); max_lanes = intel_dp_max_lane_count(intel_dp);
max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes);
...@@ -1242,6 +1242,19 @@ static int rate_to_index(int find, const int *rates) ...@@ -1242,6 +1242,19 @@ static int rate_to_index(int find, const int *rates)
return i; return i;
} }
int
intel_dp_max_link_rate(struct intel_dp *intel_dp)
{
int rates[DP_MAX_SUPPORTED_RATES] = {};
int len;
len = intel_supported_rates(intel_dp, rates);
if (WARN_ON(len <= 0))
return 162000;
return rates[rate_to_index(0, rates) - 1];
}
bool bool
intel_dp_compute_config(struct intel_encoder *encoder, intel_dp_compute_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config) struct intel_crtc_state *pipe_config)
......
...@@ -1062,6 +1062,7 @@ void intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *co ...@@ -1062,6 +1062,7 @@ void intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *co
void intel_dp_mst_suspend(struct drm_device *dev); void intel_dp_mst_suspend(struct drm_device *dev);
void intel_dp_mst_resume(struct drm_device *dev); void intel_dp_mst_resume(struct drm_device *dev);
int intel_dp_max_link_bw(struct intel_dp *intel_dp); int intel_dp_max_link_bw(struct intel_dp *intel_dp);
int intel_dp_max_link_rate(struct intel_dp *intel_dp);
void intel_dp_hot_plug(struct intel_encoder *intel_encoder); void intel_dp_hot_plug(struct intel_encoder *intel_encoder);
void vlv_power_sequencer_reset(struct drm_i915_private *dev_priv); void vlv_power_sequencer_reset(struct drm_i915_private *dev_priv);
uint32_t intel_dp_pack_aux(const uint8_t *src, int src_bytes); uint32_t intel_dp_pack_aux(const uint8_t *src, int src_bytes);
......
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