aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-03 16:35:48 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2010-12-04 19:37:36 -0500
commitc1858123dba4a9e40355363ac7a153ea23a5315d (patch)
tree0f5c60c6fdf413b78dbe7d8c1f3927db925908de /drivers/gpu/drm/i915
parenta589b9f429ac0e5bcdebda0f74ee313d39d69b7f (diff)
drm/i915: Enable CB tuning of the Display PLL
Magic numbers from the specs. This is supposed to allow the PLL some variance to improve jitter performance and VCO headroom across manufacturing and environmental variations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c17
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 998457063d5e..06175e98c5bb 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2712,6 +2712,7 @@
2712#define PCH_DPLL(pipe) _PIPE(pipe, PCH_DPLL_A, PCH_DPLL_B) 2712#define PCH_DPLL(pipe) _PIPE(pipe, PCH_DPLL_A, PCH_DPLL_B)
2713 2713
2714#define PCH_FPA0 0xc6040 2714#define PCH_FPA0 0xc6040
2715#define FP_CB_TUNE (0x3<<22)
2715#define PCH_FPA1 0xc6044 2716#define PCH_FPA1 0xc6044
2716#define PCH_FPB0 0xc6048 2717#define PCH_FPB0 0xc6048
2717#define PCH_FPB1 0xc604c 2718#define PCH_FPB1 0xc604c
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e3b8d0dc7a7d..f2aa76bd72c0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3857,6 +3857,22 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3857 reduced_clock.m2; 3857 reduced_clock.m2;
3858 } 3858 }
3859 3859
3860 /* Enable autotuning of the PLL clock (if permissible) */
3861 if (HAS_PCH_SPLIT(dev)) {
3862 int factor = 21;
3863
3864 if (is_lvds) {
3865 if ((dev_priv->lvds_use_ssc &&
3866 dev_priv->lvds_ssc_freq == 100) ||
3867 (I915_READ(PCH_LVDS) & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP)
3868 factor = 25;
3869 } else if (is_sdvo && is_tv)
3870 factor = 20;
3871
3872 if (clock.m1 < factor * clock.n)
3873 fp |= FP_CB_TUNE;
3874 }
3875
3860 dpll = 0; 3876 dpll = 0;
3861 if (!HAS_PCH_SPLIT(dev)) 3877 if (!HAS_PCH_SPLIT(dev))
3862 dpll = DPLL_VGA_MODE_DIS; 3878 dpll = DPLL_VGA_MODE_DIS;
@@ -4071,7 +4087,6 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
4071 } 4087 }
4072 4088
4073 if (!has_edp_encoder || intel_encoder_is_pch_edp(&has_edp_encoder->base)) { 4089 if (!has_edp_encoder || intel_encoder_is_pch_edp(&has_edp_encoder->base)) {
4074 I915_WRITE(fp_reg, fp);
4075 I915_WRITE(dpll_reg, dpll); 4090 I915_WRITE(dpll_reg, dpll);
4076 4091
4077 /* Wait for the clocks to stabilize. */ 4092 /* Wait for the clocks to stabilize. */