diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp_mst.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp_mst.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 1f98757f61e7..205fe4748ec5 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c | |||
@@ -350,7 +350,17 @@ static enum drm_mode_status | |||
350 | intel_dp_mst_mode_valid(struct drm_connector *connector, | 350 | intel_dp_mst_mode_valid(struct drm_connector *connector, |
351 | struct drm_display_mode *mode) | 351 | struct drm_display_mode *mode) |
352 | { | 352 | { |
353 | struct intel_connector *intel_connector = to_intel_connector(connector); | ||
354 | struct intel_dp *intel_dp = intel_connector->mst_port; | ||
353 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; | 355 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; |
356 | int bpp = 24; /* MST uses fixed bpp */ | ||
357 | int max_rate, mode_rate, max_lanes, max_link_clock; | ||
358 | |||
359 | max_link_clock = intel_dp_max_link_rate(intel_dp); | ||
360 | max_lanes = drm_dp_max_lane_count(intel_dp->dpcd); | ||
361 | |||
362 | max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); | ||
363 | mode_rate = intel_dp_link_required(mode->clock, bpp); | ||
354 | 364 | ||
355 | /* TODO - validate mode against available PBN for link */ | 365 | /* TODO - validate mode against available PBN for link */ |
356 | if (mode->clock < 10000) | 366 | if (mode->clock < 10000) |
@@ -359,7 +369,7 @@ intel_dp_mst_mode_valid(struct drm_connector *connector, | |||
359 | if (mode->flags & DRM_MODE_FLAG_DBLCLK) | 369 | if (mode->flags & DRM_MODE_FLAG_DBLCLK) |
360 | return MODE_H_ILLEGAL; | 370 | return MODE_H_ILLEGAL; |
361 | 371 | ||
362 | if (mode->clock > max_dotclk) | 372 | if (mode_rate > max_rate || mode->clock > max_dotclk) |
363 | return MODE_CLOCK_HIGH; | 373 | return MODE_CLOCK_HIGH; |
364 | 374 | ||
365 | return MODE_OK; | 375 | return MODE_OK; |