aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c15
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
1245int
1246intel_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
1245bool 1258bool
1246intel_dp_compute_config(struct intel_encoder *encoder, 1259intel_dp_compute_config(struct intel_encoder *encoder,
1247 struct intel_crtc_state *pipe_config) 1260 struct intel_crtc_state *pipe_config)