From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Use the port_clock that compute_config filled out in intel_fdi_link_freq() on DDI platforms. This means we're going to compute the FDI M/N based on the actual clock we're going to use, and we'll also check the link bandwidth against that clock. This eliminates the hidden assumptions about the actaul FDI frequency. However as FDI is specified to operate at 2.7GHz always, we should complain if we've misconfigured things. So add a WARN if port_clock isn't what it should be. Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4702858..fb04fe9 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -82,9 +82,15 @@ intel_pch_rawclk(struct drm_device *dev) } static inline int /* units of 10kHz */ -intel_fdi_link_freq(struct drm_device *dev) +intel_fdi_link_freq(struct drm_device *dev, + const struct intel_crtc_config *pipe_config) { - if (IS_GEN5(dev)) { + if (HAS_DDI(dev)) { + WARN(pipe_config->port_clock != 270000, + "Invalid FDI link frequency %d\n", + pipe_config->port_clock); + return pipe_config->port_clock; + } else if (IS_GEN5(dev)) { struct drm_i915_private *dev_priv = dev->dev_private; return ((I915_READ(FDI_PLL_BIOS_0) & FDI_PLL_FB_CLOCK_MASK) + 2) * 10000; } else @@ -4521,7 +4527,7 @@ static int ironlake_fdi_compute_config(struct intel_crtc *intel_crtc, bool setup_ok, needs_recompute = false; retry: - link_bw = intel_fdi_link_freq(dev); + link_bw = intel_fdi_link_freq(dev, pipe_config); fdi_dotclock = adjusted_mode->crtc_clock; @@ -8062,7 +8068,7 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc, * get_config() function. */ pipe_config->adjusted_mode.crtc_clock = - intel_dotclock_calculate(intel_fdi_link_freq(dev), + intel_dotclock_calculate(intel_fdi_link_freq(dev, pipe_config), &pipe_config->fdi_m_n); } -- 1.8.3.2 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx