diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-01-25 14:44:42 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-26 11:29:52 -0500 |
commit | ca54b8107f6ad8c161fa102920dd70dfef19cd2e (patch) | |
tree | e1455c940d93f5639f9a0ac20020480dbc75b2b1 /drivers/gpu | |
parent | fc2de40986f5a35c02f06dea4221113b3a7a7c3c (diff) |
drm/i915: Always use adpa_reg
Instead of using ADPA/VLV_ADPA/PCH_ADPA in various parts of
intel_crt code, just use adpa_reg which always contains the
correct value for the platform.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 71a5ebad14fb..68e79f32e100 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -267,27 +267,27 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) | |||
267 | 267 | ||
268 | crt->force_hotplug_required = 0; | 268 | crt->force_hotplug_required = 0; |
269 | 269 | ||
270 | save_adpa = adpa = I915_READ(PCH_ADPA); | 270 | save_adpa = adpa = I915_READ(crt->adpa_reg); |
271 | DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa); | 271 | DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa); |
272 | 272 | ||
273 | adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER; | 273 | adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER; |
274 | if (turn_off_dac) | 274 | if (turn_off_dac) |
275 | adpa &= ~ADPA_DAC_ENABLE; | 275 | adpa &= ~ADPA_DAC_ENABLE; |
276 | 276 | ||
277 | I915_WRITE(PCH_ADPA, adpa); | 277 | I915_WRITE(crt->adpa_reg, adpa); |
278 | 278 | ||
279 | if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, | 279 | if (wait_for((I915_READ(crt->adpa_reg) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, |
280 | 1000)) | 280 | 1000)) |
281 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); | 281 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); |
282 | 282 | ||
283 | if (turn_off_dac) { | 283 | if (turn_off_dac) { |
284 | I915_WRITE(PCH_ADPA, save_adpa); | 284 | I915_WRITE(crt->adpa_reg, save_adpa); |
285 | POSTING_READ(PCH_ADPA); | 285 | POSTING_READ(crt->adpa_reg); |
286 | } | 286 | } |
287 | } | 287 | } |
288 | 288 | ||
289 | /* Check the status to see if both blue and green are on now */ | 289 | /* Check the status to see if both blue and green are on now */ |
290 | adpa = I915_READ(PCH_ADPA); | 290 | adpa = I915_READ(crt->adpa_reg); |
291 | if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0) | 291 | if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0) |
292 | ret = true; | 292 | ret = true; |
293 | else | 293 | else |
@@ -300,26 +300,27 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) | |||
300 | static bool valleyview_crt_detect_hotplug(struct drm_connector *connector) | 300 | static bool valleyview_crt_detect_hotplug(struct drm_connector *connector) |
301 | { | 301 | { |
302 | struct drm_device *dev = connector->dev; | 302 | struct drm_device *dev = connector->dev; |
303 | struct intel_crt *crt = intel_attached_crt(connector); | ||
303 | struct drm_i915_private *dev_priv = dev->dev_private; | 304 | struct drm_i915_private *dev_priv = dev->dev_private; |
304 | u32 adpa; | 305 | u32 adpa; |
305 | bool ret; | 306 | bool ret; |
306 | u32 save_adpa; | 307 | u32 save_adpa; |
307 | 308 | ||
308 | save_adpa = adpa = I915_READ(ADPA); | 309 | save_adpa = adpa = I915_READ(crt->adpa_reg); |
309 | DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa); | 310 | DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa); |
310 | 311 | ||
311 | adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER; | 312 | adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER; |
312 | 313 | ||
313 | I915_WRITE(ADPA, adpa); | 314 | I915_WRITE(crt->adpa_reg, adpa); |
314 | 315 | ||
315 | if (wait_for((I915_READ(ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, | 316 | if (wait_for((I915_READ(crt->adpa_reg) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, |
316 | 1000)) { | 317 | 1000)) { |
317 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); | 318 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); |
318 | I915_WRITE(ADPA, save_adpa); | 319 | I915_WRITE(crt->adpa_reg, save_adpa); |
319 | } | 320 | } |
320 | 321 | ||
321 | /* Check the status to see if both blue and green are on now */ | 322 | /* Check the status to see if both blue and green are on now */ |
322 | adpa = I915_READ(ADPA); | 323 | adpa = I915_READ(crt->adpa_reg); |
323 | if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0) | 324 | if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0) |
324 | ret = true; | 325 | ret = true; |
325 | else | 326 | else |
@@ -665,11 +666,11 @@ static void intel_crt_reset(struct drm_connector *connector) | |||
665 | if (HAS_PCH_SPLIT(dev)) { | 666 | if (HAS_PCH_SPLIT(dev)) { |
666 | u32 adpa; | 667 | u32 adpa; |
667 | 668 | ||
668 | adpa = I915_READ(PCH_ADPA); | 669 | adpa = I915_READ(crt->adpa_reg); |
669 | adpa &= ~ADPA_CRT_HOTPLUG_MASK; | 670 | adpa &= ~ADPA_CRT_HOTPLUG_MASK; |
670 | adpa |= ADPA_HOTPLUG_BITS; | 671 | adpa |= ADPA_HOTPLUG_BITS; |
671 | I915_WRITE(PCH_ADPA, adpa); | 672 | I915_WRITE(crt->adpa_reg, adpa); |
672 | POSTING_READ(PCH_ADPA); | 673 | POSTING_READ(crt->adpa_reg); |
673 | 674 | ||
674 | DRM_DEBUG_KMS("pch crt adpa set to 0x%x\n", adpa); | 675 | DRM_DEBUG_KMS("pch crt adpa set to 0x%x\n", adpa); |
675 | crt->force_hotplug_required = 1; | 676 | crt->force_hotplug_required = 1; |