aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_crt.c
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2010-04-07 04:15:55 -0400
committerEric Anholt <eric@anholt.net>2010-04-12 12:23:41 -0400
commita4a6b90150326294b1116504ba9d678bb3f42c35 (patch)
treeed68e5cac132989cfc49e94afeddc119250ccd9f /drivers/gpu/drm/i915/intel_crt.c
parent8db9d77b1b14fd730561f64beea8c00e4478d7c5 (diff)
drm/i915: Fix CRT force detect on Cougarpoint
To make CRT force detect reliable on Cougarpoint, we need to disable DAC before force detect, and restore back when trigger is completed. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 1f732ba568f6..996d063c40ca 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -157,15 +157,21 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
157{ 157{
158 struct drm_device *dev = connector->dev; 158 struct drm_device *dev = connector->dev;
159 struct drm_i915_private *dev_priv = dev->dev_private; 159 struct drm_i915_private *dev_priv = dev->dev_private;
160 u32 adpa; 160 u32 adpa, temp;
161 bool ret; 161 bool ret;
162 162
163 adpa = I915_READ(PCH_ADPA); 163 temp = adpa = I915_READ(PCH_ADPA);
164 164
165 adpa &= ~ADPA_CRT_HOTPLUG_MASK; 165 if (HAS_PCH_CPT(dev)) {
166 /* disable HPD first */ 166 /* Disable DAC before force detect */
167 I915_WRITE(PCH_ADPA, adpa); 167 I915_WRITE(PCH_ADPA, adpa & ~ADPA_DAC_ENABLE);
168 (void)I915_READ(PCH_ADPA); 168 (void)I915_READ(PCH_ADPA);
169 } else {
170 adpa &= ~ADPA_CRT_HOTPLUG_MASK;
171 /* disable HPD first */
172 I915_WRITE(PCH_ADPA, adpa);
173 (void)I915_READ(PCH_ADPA);
174 }
169 175
170 adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 | 176 adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 |
171 ADPA_CRT_HOTPLUG_WARMUP_10MS | 177 ADPA_CRT_HOTPLUG_WARMUP_10MS |
@@ -181,6 +187,11 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
181 while ((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0) 187 while ((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0)
182 ; 188 ;
183 189
190 if (HAS_PCH_CPT(dev)) {
191 I915_WRITE(PCH_ADPA, temp);
192 (void)I915_READ(PCH_ADPA);
193 }
194
184 /* Check the status to see if both blue and green are on now */ 195 /* Check the status to see if both blue and green are on now */
185 adpa = I915_READ(PCH_ADPA); 196 adpa = I915_READ(PCH_ADPA);
186 adpa &= ADPA_CRT_HOTPLUG_MONITOR_MASK; 197 adpa &= ADPA_CRT_HOTPLUG_MONITOR_MASK;