aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-02-17 14:41:10 -0500
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-03-01 06:04:14 -0500
commit21a727b365f8617e9f57229f55c9712b13ab38a6 (patch)
tree9e96209d329ed6fcf9f5a509886fdd2ce0fccebb /drivers/gpu/drm/i915/intel_display.c
parente3b247da89f0adb04010f9dad6a3e41ed085d24e (diff)
drm/i915: Remove the SPLL==270Mhz assumption from intel_fdi_link_freq()
Instead of assuming we've correctly set up SPLL to run at 270Mhz for FDI, let's use the port_clock from pipe_config which should be what we want. This would catch problems if someone misconfigures SPLL for whatever reason. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1455738073-14502-4-git-send-email-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak <imre.deak@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 992d4d568c11..36c470f3c6e5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -224,12 +224,15 @@ static void intel_update_czclk(struct drm_i915_private *dev_priv)
224} 224}
225 225
226static inline u32 /* units of 100MHz */ 226static inline u32 /* units of 100MHz */
227intel_fdi_link_freq(struct drm_i915_private *dev_priv) 227intel_fdi_link_freq(struct drm_i915_private *dev_priv,
228 const struct intel_crtc_state *pipe_config)
228{ 229{
229 if (IS_GEN5(dev_priv)) 230 if (HAS_DDI(dev_priv))
230 return (I915_READ(FDI_PLL_BIOS_0) & FDI_PLL_FB_CLOCK_MASK) + 2; 231 return pipe_config->port_clock; /* SPLL */
232 else if (IS_GEN5(dev_priv))
233 return ((I915_READ(FDI_PLL_BIOS_0) & FDI_PLL_FB_CLOCK_MASK) + 2) * 10000;
231 else 234 else
232 return 27; 235 return 270000;
233} 236}
234 237
235static const intel_limit_t intel_limits_i8xx_dac = { 238static const intel_limit_t intel_limits_i8xx_dac = {
@@ -6679,7 +6682,7 @@ retry:
6679 * Hence the bw of each lane in terms of the mode signal 6682 * Hence the bw of each lane in terms of the mode signal
6680 * is: 6683 * is:
6681 */ 6684 */
6682 link_bw = intel_fdi_link_freq(to_i915(dev)) * MHz(100)/KHz(1)/10; 6685 link_bw = intel_fdi_link_freq(to_i915(dev), pipe_config);
6683 6686
6684 fdi_dotclock = adjusted_mode->crtc_clock; 6687 fdi_dotclock = adjusted_mode->crtc_clock;
6685 6688
@@ -10840,7 +10843,7 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,
10840 * Calculate one based on the FDI configuration. 10843 * Calculate one based on the FDI configuration.
10841 */ 10844 */
10842 pipe_config->base.adjusted_mode.crtc_clock = 10845 pipe_config->base.adjusted_mode.crtc_clock =
10843 intel_dotclock_calculate(intel_fdi_link_freq(dev_priv) * 10000, 10846 intel_dotclock_calculate(intel_fdi_link_freq(dev_priv, pipe_config),
10844 &pipe_config->fdi_m_n); 10847 &pipe_config->fdi_m_n);
10845} 10848}
10846 10849
@@ -12873,7 +12876,7 @@ static void intel_pipe_config_sanity_check(struct drm_i915_private *dev_priv,
12873 const struct intel_crtc_state *pipe_config) 12876 const struct intel_crtc_state *pipe_config)
12874{ 12877{
12875 if (pipe_config->has_pch_encoder) { 12878 if (pipe_config->has_pch_encoder) {
12876 int fdi_dotclock = intel_dotclock_calculate(intel_fdi_link_freq(dev_priv) * 10000, 12879 int fdi_dotclock = intel_dotclock_calculate(intel_fdi_link_freq(dev_priv, pipe_config),
12877 &pipe_config->fdi_m_n); 12880 &pipe_config->fdi_m_n);
12878 int dotclock = pipe_config->base.adjusted_mode.crtc_clock; 12881 int dotclock = pipe_config->base.adjusted_mode.crtc_clock;
12879 12882