<div dir="ltr">On Mon, Mar 17, 2014 at 3:42 PM, Jani Nikula <span dir="ltr"><<a href="mailto:jani.nikula@intel.com" target="_blank">jani.nikula@intel.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This reverts<br>
commit dff392dbd258381a6c3164f38420593f2d291e3b<br>
Author: Paulo Zanoni <<a href="mailto:paulo.r.zanoni@intel.com">paulo.r.zanoni@intel.com</a>><br>
Date:   Fri Dec 6 17:32:41 2013 -0200<br>
<br>
    drm/i915: don't touch the VDD when disabling the panel<br>
<br>
which didn't take into account<br>
<br>
commit 6cb49835da0426f69a2931bc2a0a8156344b0e41<br>
Author: Daniel Vetter <<a href="mailto:daniel.vetter@ffwll.ch">daniel.vetter@ffwll.ch</a>><br>
Date:   Sun May 20 17:14:50 2012 +0200<br>
<br>
    drm/i915: enable vdd when switching off the eDP panel<br>
<br>
and<br>
<br>
commit 35a38556d900b9cb5dfa2529c93944b847f8a8a4<br>
Author: Daniel Vetter <<a href="mailto:daniel.vetter@ffwll.ch">daniel.vetter@ffwll.ch</a>><br>
Date:   Sun Aug 12 22:17:14 2012 +0200<br>
<br>
    drm/i915: reorder edp disabling to fix ivb MacBook Air<br>
<br>
Unsurprisingly, various MacBooks failed.<br>
<br>
Effectively the same has already been done in drm-intel-next-queued.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=74628" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=74628</a><br>
Cc: Patrik Jakobsson <<a href="mailto:patrik.r.jakobsson@gmail.com">patrik.r.jakobsson@gmail.com</a>><br>
Cc: Paulo Zanoni <<a href="mailto:paulo.r.zanoni@intel.com">paulo.r.zanoni@intel.com</a>><br>
Signed-off-by: Jani Nikula <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>><br>
---<br>
 drivers/gpu/drm/i915/intel_ddi.c |    1 +<br>
 drivers/gpu/drm/i915/intel_dp.c  |   10 +++++++++-<br>
 2 files changed, 10 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c<br>
index e06b9e017d6b..234ac5f7bc5a 100644<br>
--- a/drivers/gpu/drm/i915/intel_ddi.c<br>
+++ b/drivers/gpu/drm/i915/intel_ddi.c<br>
@@ -1244,6 +1244,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)<br>
        if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) {<br>
                struct intel_dp *intel_dp = enc_to_intel_dp(encoder);<br>
                intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);<br>
+               ironlake_edp_panel_vdd_on(intel_dp);<br>
                ironlake_edp_panel_off(intel_dp);<br>
        }<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c<br>
index 41bdac44dfc1..2688f6d64bb9 100644<br>
--- a/drivers/gpu/drm/i915/intel_dp.c<br>
+++ b/drivers/gpu/drm/i915/intel_dp.c<br>
@@ -1249,17 +1249,24 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp)<br>
<br>
        DRM_DEBUG_KMS("Turn eDP power off\n");<br>
<br>
+       WARN(!intel_dp->want_panel_vdd, "Need VDD to turn off panel\n");<br>
+<br>
        pp = ironlake_get_pp_control(intel_dp);<br>
        /* We need to switch off panel power _and_ force vdd, for otherwise some<br>
         * panels get very unhappy and cease to work. */<br>
-       pp &= ~(POWER_TARGET_ON | PANEL_POWER_RESET | EDP_BLC_ENABLE);<br>
+       pp &= ~(POWER_TARGET_ON | EDP_FORCE_VDD | PANEL_POWER_RESET | EDP_BLC_ENABLE);<br>
<br>
        pp_ctrl_reg = _pp_ctrl_reg(intel_dp);<br>
<br>
        I915_WRITE(pp_ctrl_reg, pp);<br>
        POSTING_READ(pp_ctrl_reg);<br>
<br>
+       intel_dp->want_panel_vdd = false;<br>
+<br>
        ironlake_wait_panel_off(intel_dp);<br>
+<br>
+       /* We got a reference when we enabled the VDD. */<br>
+       intel_runtime_pm_put(dev_priv);<br>
 }<br>
<br>
 void ironlake_edp_backlight_on(struct intel_dp *intel_dp)<br>
@@ -1784,6 +1791,7 @@ static void intel_disable_dp(struct intel_encoder *encoder)<br>
<br>
        /* Make sure the panel is off before trying to change the mode. But also<br>
         * ensure that we have vdd while we switch off the panel. */<br>
+       ironlake_edp_panel_vdd_on(intel_dp);<br>
        ironlake_edp_backlight_off(intel_dp);<br>
        intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);<br>
        ironlake_edp_panel_off(intel_dp);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
</font></span></blockquote></div><br></div><div class="gmail_extra">This fixes my MacBook Air problem.<br><br></div><div class="gmail_extra">Thanks<br>Patrik<br></div></div>