aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2009-10-19 03:43:48 -0400
committerEric Anholt <eric@anholt.net>2009-10-19 14:03:37 -0400
commitc038e51e841581cc3fb9a76e5e16331331e9c85c (patch)
tree4bdf6e3aa2eb8f3b97c99c906ec14804b92f90bb /drivers/gpu
parent0d9c778978ff268228c095ae737c282c03a5986d (diff)
drm/i915: fix to setup display reference clock control on Ironlake
For new stepping of PCH, the display reference clock is fully under driver's control. This one trys to setup all needed reference clock for different outputs. Older stepping of PCH chipset should be ignoring this. This fixes output failure issue on newer PCH which requires driver to take control of reference clock enabling. Cc: Stable Team <stable@kernel.org> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h4
-rw-r--r--drivers/gpu/drm/i915/intel_display.c40
2 files changed, 42 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index b4813586d92c..cd0ffa015c27 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2158,11 +2158,11 @@
2158#define DREF_CPU_SOURCE_OUTPUT_MASK (3<<13) 2158#define DREF_CPU_SOURCE_OUTPUT_MASK (3<<13)
2159#define DREF_SSC_SOURCE_DISABLE (0<<11) 2159#define DREF_SSC_SOURCE_DISABLE (0<<11)
2160#define DREF_SSC_SOURCE_ENABLE (2<<11) 2160#define DREF_SSC_SOURCE_ENABLE (2<<11)
2161#define DREF_SSC_SOURCE_MASK (2<<11) 2161#define DREF_SSC_SOURCE_MASK (3<<11)
2162#define DREF_NONSPREAD_SOURCE_DISABLE (0<<9) 2162#define DREF_NONSPREAD_SOURCE_DISABLE (0<<9)
2163#define DREF_NONSPREAD_CK505_ENABLE (1<<9) 2163#define DREF_NONSPREAD_CK505_ENABLE (1<<9)
2164#define DREF_NONSPREAD_SOURCE_ENABLE (2<<9) 2164#define DREF_NONSPREAD_SOURCE_ENABLE (2<<9)
2165#define DREF_NONSPREAD_SOURCE_MASK (2<<9) 2165#define DREF_NONSPREAD_SOURCE_MASK (3<<9)
2166#define DREF_SUPERSPREAD_SOURCE_DISABLE (0<<7) 2166#define DREF_SUPERSPREAD_SOURCE_DISABLE (0<<7)
2167#define DREF_SUPERSPREAD_SOURCE_ENABLE (2<<7) 2167#define DREF_SUPERSPREAD_SOURCE_ENABLE (2<<7)
2168#define DREF_SSC4_DOWNSPREAD (0<<6) 2168#define DREF_SSC4_DOWNSPREAD (0<<6)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 123cce1ae470..db4c38700951 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2814,6 +2814,46 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
2814 link_bw, &m_n); 2814 link_bw, &m_n);
2815 } 2815 }
2816 2816
2817 /* Ironlake: try to setup display ref clock before DPLL
2818 * enabling. This is only under driver's control after
2819 * PCH B stepping, previous chipset stepping should be
2820 * ignoring this setting.
2821 */
2822 if (IS_IGDNG(dev)) {
2823 temp = I915_READ(PCH_DREF_CONTROL);
2824 /* Always enable nonspread source */
2825 temp &= ~DREF_NONSPREAD_SOURCE_MASK;
2826 temp |= DREF_NONSPREAD_SOURCE_ENABLE;
2827 I915_WRITE(PCH_DREF_CONTROL, temp);
2828 POSTING_READ(PCH_DREF_CONTROL);
2829
2830 temp &= ~DREF_SSC_SOURCE_MASK;
2831 temp |= DREF_SSC_SOURCE_ENABLE;
2832 I915_WRITE(PCH_DREF_CONTROL, temp);
2833 POSTING_READ(PCH_DREF_CONTROL);
2834
2835 udelay(200);
2836
2837 if (is_edp) {
2838 if (dev_priv->lvds_use_ssc) {
2839 temp |= DREF_SSC1_ENABLE;
2840 I915_WRITE(PCH_DREF_CONTROL, temp);
2841 POSTING_READ(PCH_DREF_CONTROL);
2842
2843 udelay(200);
2844
2845 temp &= ~DREF_CPU_SOURCE_OUTPUT_MASK;
2846 temp |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD;
2847 I915_WRITE(PCH_DREF_CONTROL, temp);
2848 POSTING_READ(PCH_DREF_CONTROL);
2849 } else {
2850 temp |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD;
2851 I915_WRITE(PCH_DREF_CONTROL, temp);
2852 POSTING_READ(PCH_DREF_CONTROL);
2853 }
2854 }
2855 }
2856
2817 if (IS_IGD(dev)) { 2857 if (IS_IGD(dev)) {
2818 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2; 2858 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2;
2819 if (has_reduced_clock) 2859 if (has_reduced_clock)