diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-10-12 18:01:33 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-10-21 02:21:55 -0400 |
commit | d64311ab4bd8d1c1e984ce3f0e772266dde95380 (patch) | |
tree | ed53347c191a944243317a9fc79a4b22f2822cb4 | |
parent | 65a21cd65316145f9302594be8e69074369e1050 (diff) |
drm/i915: fix transcoder PLL select masking
Transcoder A will always use PLL A and transcoder B will use PLL B. But
transcoder C could use either, so always mask the select bits off before
or'ing in a new value.
Reported-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2371a8e3804..ed5d4f4d702 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2906,12 +2906,16 @@ static void ironlake_pch_enable(struct drm_crtc *crtc) | |||
2906 | 2906 | ||
2907 | /* Be sure PCH DPLL SEL is set */ | 2907 | /* Be sure PCH DPLL SEL is set */ |
2908 | temp = I915_READ(PCH_DPLL_SEL); | 2908 | temp = I915_READ(PCH_DPLL_SEL); |
2909 | if (pipe == 0 && (temp & TRANSA_DPLL_ENABLE) == 0) | 2909 | if (pipe == 0) { |
2910 | temp &= ~(TRANSA_DPLLB_SEL); | ||
2910 | temp |= (TRANSA_DPLL_ENABLE | TRANSA_DPLLA_SEL); | 2911 | temp |= (TRANSA_DPLL_ENABLE | TRANSA_DPLLA_SEL); |
2911 | else if (pipe == 1 && (temp & TRANSB_DPLL_ENABLE) == 0) | 2912 | } else if (pipe == 1) { |
2913 | temp &= ~(TRANSB_DPLLB_SEL); | ||
2912 | temp |= (TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL); | 2914 | temp |= (TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL); |
2913 | else if (pipe == 2 && (temp & TRANSC_DPLL_ENABLE) == 0) | 2915 | } else if (pipe == 2) { |
2916 | temp &= ~(TRANSC_DPLLB_SEL); | ||
2914 | temp |= (TRANSC_DPLL_ENABLE | transc_sel); | 2917 | temp |= (TRANSC_DPLL_ENABLE | transc_sel); |
2918 | } | ||
2915 | I915_WRITE(PCH_DPLL_SEL, temp); | 2919 | I915_WRITE(PCH_DPLL_SEL, temp); |
2916 | } | 2920 | } |
2917 | 2921 | ||
@@ -3077,14 +3081,14 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) | |||
3077 | temp = I915_READ(PCH_DPLL_SEL); | 3081 | temp = I915_READ(PCH_DPLL_SEL); |
3078 | switch (pipe) { | 3082 | switch (pipe) { |
3079 | case 0: | 3083 | case 0: |
3080 | temp &= ~(TRANSA_DPLL_ENABLE | TRANSA_DPLLA_SEL); | 3084 | temp &= ~(TRANSA_DPLL_ENABLE | TRANSA_DPLLB_SEL); |
3081 | break; | 3085 | break; |
3082 | case 1: | 3086 | case 1: |
3083 | temp &= ~(TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL); | 3087 | temp &= ~(TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL); |
3084 | break; | 3088 | break; |
3085 | case 2: | 3089 | case 2: |
3086 | /* C shares PLL A or B */ | 3090 | /* C shares PLL A or B */ |
3087 | temp &= ~(TRANSC_DPLL_ENABLE | TRANSB_DPLLB_SEL); | 3091 | temp &= ~(TRANSC_DPLL_ENABLE | TRANSC_DPLLB_SEL); |
3088 | break; | 3092 | break; |
3089 | default: | 3093 | default: |
3090 | BUG(); /* wtf */ | 3094 | BUG(); /* wtf */ |
@@ -5590,6 +5594,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, | |||
5590 | temp |= TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL; | 5594 | temp |= TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL; |
5591 | break; | 5595 | break; |
5592 | case 2: | 5596 | case 2: |
5597 | temp &= ~(TRANSC_DPLLB_SEL); | ||
5593 | temp |= TRANSC_DPLL_ENABLE | transc_sel; | 5598 | temp |= TRANSC_DPLL_ENABLE | transc_sel; |
5594 | break; | 5599 | break; |
5595 | default: | 5600 | default: |