drm/i915: Update to Linux 3.9.11
[dragonfly.git] / sys / dev / drm / i915 / intel_crt.c
index 756127d..8886d4d 100644 (file)
@@ -257,27 +257,27 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
 
                crt->force_hotplug_required = 0;
 
-               save_adpa = adpa = I915_READ(PCH_ADPA);
+               save_adpa = adpa = I915_READ(crt->adpa_reg);
                DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);
 
                adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;
                if (turn_off_dac)
                        adpa &= ~ADPA_DAC_ENABLE;
 
-               I915_WRITE(PCH_ADPA, adpa);
+               I915_WRITE(crt->adpa_reg, adpa);
 
-               if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
+               if (wait_for((I915_READ(crt->adpa_reg) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
                             1000))
                        DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
 
                if (turn_off_dac) {
-                       I915_WRITE(PCH_ADPA, save_adpa);
-                       POSTING_READ(PCH_ADPA);
+                       I915_WRITE(crt->adpa_reg, save_adpa);
+                       POSTING_READ(crt->adpa_reg);
                }
        }
 
        /* Check the status to see if both blue and green are on now */
-       adpa = I915_READ(PCH_ADPA);
+       adpa = I915_READ(crt->adpa_reg);
        if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
                ret = true;
        else
@@ -290,26 +290,27 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
 static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
 {
        struct drm_device *dev = connector->dev;
+       struct intel_crt *crt = intel_attached_crt(connector);
        struct drm_i915_private *dev_priv = dev->dev_private;
        u32 adpa;
        bool ret;
        u32 save_adpa;
 
-       save_adpa = adpa = I915_READ(ADPA);
+       save_adpa = adpa = I915_READ(crt->adpa_reg);
        DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);
 
        adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;
 
-       I915_WRITE(ADPA, adpa);
+       I915_WRITE(crt->adpa_reg, adpa);
 
-       if (wait_for((I915_READ(ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
+       if (wait_for((I915_READ(crt->adpa_reg) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
                     1000)) {
                DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
-               I915_WRITE(ADPA, save_adpa);
+               I915_WRITE(crt->adpa_reg, save_adpa);
        }
 
        /* Check the status to see if both blue and green are on now */
-       adpa = I915_READ(ADPA);
+       adpa = I915_READ(crt->adpa_reg);
        if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
                ret = true;
        else
@@ -657,11 +658,11 @@ static void intel_crt_reset(struct drm_connector *connector)
        if (HAS_PCH_SPLIT(dev)) {
                u32 adpa;
 
-               adpa = I915_READ(PCH_ADPA);
+               adpa = I915_READ(crt->adpa_reg);
                adpa &= ~ADPA_CRT_HOTPLUG_MASK;
                adpa |= ADPA_HOTPLUG_BITS;
-               I915_WRITE(PCH_ADPA, adpa);
-               POSTING_READ(PCH_ADPA);
+               I915_WRITE(crt->adpa_reg, adpa);
+               POSTING_READ(crt->adpa_reg);
 
                DRM_DEBUG_KMS("pch crt adpa set to 0x%x\n", adpa);
                crt->force_hotplug_required = 1;
@@ -770,7 +771,7 @@ void intel_crt_init(struct drm_device *dev)
 
        crt->base.disable = intel_disable_crt;
        crt->base.enable = intel_enable_crt;
-       if (IS_HASWELL(dev))
+       if (HAS_DDI(dev))
                crt->base.get_hw_state = intel_ddi_get_hw_state;
        else
                crt->base.get_hw_state = intel_crt_get_hw_state;