diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-11-29 08:29:32 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-12-08 08:00:35 -0500 |
commit | d4b1931c149e1cf78a930d7abde00bd378272e6e (patch) | |
tree | 54e314dbd541f9b3d8dcfef818d7704af35069cd /drivers/gpu | |
parent | 248138b59880a3cc69e9b7f0e06fb0caedd58305 (diff) |
drm/i915: reject modes the LPT FDI receiver can't handle
More specifically, the LPT FDI RX only supports 8bpc and a maximum of
2 lanes, so anything above that won't work and should be rejected.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 1 |
3 files changed, 20 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 5c7774396e10..3084d018c740 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -198,6 +198,11 @@ static int intel_crt_mode_valid(struct drm_connector *connector, | |||
198 | if (mode->clock > max_clock) | 198 | if (mode->clock > max_clock) |
199 | return MODE_CLOCK_HIGH; | 199 | return MODE_CLOCK_HIGH; |
200 | 200 | ||
201 | /* The FDI receiver on LPT only supports 8bpc and only has 2 lanes. */ | ||
202 | if (HAS_PCH_LPT(dev) && | ||
203 | (ironlake_get_lanes_required(mode->clock, 270000, 24) > 2)) | ||
204 | return MODE_CLOCK_HIGH; | ||
205 | |||
201 | return MODE_OK; | 206 | return MODE_OK; |
202 | } | 207 | } |
203 | 208 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f8ee3d16109c..41e2d9508ef6 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5228,6 +5228,17 @@ static bool ironlake_check_fdi_lanes(struct intel_crtc *intel_crtc) | |||
5228 | } | 5228 | } |
5229 | } | 5229 | } |
5230 | 5230 | ||
5231 | int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp) | ||
5232 | { | ||
5233 | /* | ||
5234 | * Account for spread spectrum to avoid | ||
5235 | * oversubscribing the link. Max center spread | ||
5236 | * is 2.5%; use 5% for safety's sake. | ||
5237 | */ | ||
5238 | u32 bps = target_clock * bpp * 21 / 20; | ||
5239 | return bps / (link_bw * 8) + 1; | ||
5240 | } | ||
5241 | |||
5231 | static void ironlake_set_m_n(struct drm_crtc *crtc, | 5242 | static void ironlake_set_m_n(struct drm_crtc *crtc, |
5232 | struct drm_display_mode *mode, | 5243 | struct drm_display_mode *mode, |
5233 | struct drm_display_mode *adjusted_mode) | 5244 | struct drm_display_mode *adjusted_mode) |
@@ -5281,15 +5292,9 @@ static void ironlake_set_m_n(struct drm_crtc *crtc, | |||
5281 | else | 5292 | else |
5282 | target_clock = adjusted_mode->clock; | 5293 | target_clock = adjusted_mode->clock; |
5283 | 5294 | ||
5284 | if (!lane) { | 5295 | if (!lane) |
5285 | /* | 5296 | lane = ironlake_get_lanes_required(target_clock, link_bw, |
5286 | * Account for spread spectrum to avoid | 5297 | intel_crtc->bpp); |
5287 | * oversubscribing the link. Max center spread | ||
5288 | * is 2.5%; use 5% for safety's sake. | ||
5289 | */ | ||
5290 | u32 bps = target_clock * intel_crtc->bpp * 21 / 20; | ||
5291 | lane = bps / (link_bw * 8) + 1; | ||
5292 | } | ||
5293 | 5298 | ||
5294 | intel_crtc->fdi_lanes = lane; | 5299 | intel_crtc->fdi_lanes = lane; |
5295 | 5300 | ||
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 3915ca9abd41..8a1bd4a3ad0d 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -559,6 +559,7 @@ intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv, | |||
559 | enum pipe pipe); | 559 | enum pipe pipe); |
560 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); | 560 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); |
561 | extern void intel_wait_for_pipe_off(struct drm_device *dev, int pipe); | 561 | extern void intel_wait_for_pipe_off(struct drm_device *dev, int pipe); |
562 | extern int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp); | ||
562 | 563 | ||
563 | struct intel_load_detect_pipe { | 564 | struct intel_load_detect_pipe { |
564 | struct drm_framebuffer *release_fb; | 565 | struct drm_framebuffer *release_fb; |