diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-03-12 11:10:34 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-20 06:48:07 -0400 |
commit | 50fec21a7db84a5c40e27c83bd55a5c9b435efbf (patch) | |
tree | e900b8ccb691355181fc24511e48d3a9aeeb9a50 /drivers/gpu/drm/i915/intel_dp.c | |
parent | 2ecae76ad6c6da042dbbcce0084bd6b6c5700845 (diff) |
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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 45c35681eb48..5d8ec3a33502 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -206,7 +206,7 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
206 | target_clock = fixed_mode->clock; | 206 | target_clock = fixed_mode->clock; |
207 | } | 207 | } |
208 | 208 | ||
209 | max_link_clock = drm_dp_bw_code_to_link_rate(intel_dp_max_link_bw(intel_dp)); | 209 | max_link_clock = intel_dp_max_link_rate(intel_dp); |
210 | max_lanes = intel_dp_max_lane_count(intel_dp); | 210 | max_lanes = intel_dp_max_lane_count(intel_dp); |
211 | 211 | ||
212 | max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); | 212 | 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 | return i; | 1242 | return i; |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | int | ||
1246 | intel_dp_max_link_rate(struct intel_dp *intel_dp) | ||
1247 | { | ||
1248 | int rates[DP_MAX_SUPPORTED_RATES] = {}; | ||
1249 | int len; | ||
1250 | |||
1251 | len = intel_supported_rates(intel_dp, rates); | ||
1252 | if (WARN_ON(len <= 0)) | ||
1253 | return 162000; | ||
1254 | |||
1255 | return rates[rate_to_index(0, rates) - 1]; | ||
1256 | } | ||
1257 | |||
1245 | bool | 1258 | bool |
1246 | intel_dp_compute_config(struct intel_encoder *encoder, | 1259 | intel_dp_compute_config(struct intel_encoder *encoder, |
1247 | struct intel_crtc_state *pipe_config) | 1260 | struct intel_crtc_state *pipe_config) |