drm/i915: eDP mode set sequence corrections
authorJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 11 Aug 2010 17:06:44 +0000 (10:06 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 18 Aug 2010 20:00:21 +0000 (13:00 -0700)
We should disable the panel first when shutting down an eDP link.  And
when turning one on, the panel needs to be enabled before link training
or eDP I/O won't be enabled.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/gpu/drm/i915/intel_dp.c

index d1b4ece4df0075de1736e2076cde4f47a2b583fb..8061a48804a31cbb8fe550c1a07538ac514fa94e 100644 (file)
@@ -840,20 +840,19 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
        uint32_t dp_reg = I915_READ(intel_dp->output_reg);
 
        if (mode != DRM_MODE_DPMS_ON) {
-               if (dp_reg & DP_PORT_EN) {
-                       intel_dp_link_down(intel_dp);
-                       if (IS_eDP(intel_dp) || IS_PCH_eDP(intel_dp)) {
-                               ironlake_edp_backlight_off(dev);
-                               ironlake_edp_panel_off(dev);
-                       }
+               if (IS_eDP(intel_dp) || IS_PCH_eDP(intel_dp)) {
+                       ironlake_edp_backlight_off(dev);
+                       ironlake_edp_panel_off(dev);
                }
+               if (dp_reg & DP_PORT_EN)
+                       intel_dp_link_down(intel_dp);
        } else {
                if (!(dp_reg & DP_PORT_EN)) {
-                       intel_dp_link_train(intel_dp);
-                       if (IS_eDP(intel_dp) || IS_PCH_eDP(intel_dp)) {
+                       if (IS_eDP(intel_dp) || IS_PCH_eDP(intel_dp))
                                ironlake_edp_panel_on(dev);
+                       intel_dp_link_train(intel_dp);
+                       if (IS_eDP(intel_dp) || IS_PCH_eDP(intel_dp))
                                ironlake_edp_backlight_on(dev);
-                       }
                }
        }
        intel_dp->dpms_mode = mode;