<br>Reviewed-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@gmail.com">rodrigo.vivi@gmail.com</a>><br><br><div class="gmail_quote">On Tue, Oct 23, 2012 at 6:29 PM, Paulo Zanoni <span dir="ltr"><<a href="mailto:przanoni@gmail.com" target="_blank">przanoni@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Paulo Zanoni <<a href="mailto:paulo.r.zanoni@intel.com">paulo.r.zanoni@intel.com</a>><br>
<br>
The last commit just forked the functions, this one removes Haswell<br>
code from the Ironlake functions and removes Ironlake code from the<br>
Haswell functions.<br>
<br>
It is worth noticing that we are not considering CPT possible on<br>
Haswell anymore. So far on Haswell enablement we kept trying to still<br>
consider IBX/CPT as a possibility with a Haswell CPU, but this was<br>
never tested, I really doubt it will work with the current code and we<br>
don't really have plans to support it. Future patches will remove the<br>
IBX/CPT code from other Haswell functions. Notice that we still have a<br>
WARN on haswell_crtc_mode_set in case we detect non-LPT PCH.<br>
<br>
Signed-off-by: Paulo Zanoni <<a href="mailto:paulo.r.zanoni@intel.com">paulo.r.zanoni@intel.com</a>><br>
---<br>
 drivers/gpu/drm/i915/intel_display.c | 73 ++++--------------------------------<br>
 1 file changed, 7 insertions(+), 66 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c<br>
index eb4dba6..a90da35 100644<br>
--- a/drivers/gpu/drm/i915/intel_display.c<br>
+++ b/drivers/gpu/drm/i915/intel_display.c<br>
@@ -3228,9 +3228,6 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)<br>
                if (encoder->pre_enable)<br>
                        encoder->pre_enable(encoder);<br>
<br>
-       if (IS_HASWELL(dev))<br>
-               intel_ddi_enable_pipe_clock(intel_crtc);<br>
-<br>
        /* Enable panel fitting for LVDS */<br>
        if (dev_priv->pch_pf_size &&<br>
            (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || HAS_eDP)) {<br>
@@ -3249,11 +3246,6 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)<br>
         */<br>
        intel_crtc_load_lut(crtc);<br>
<br>
-       if (IS_HASWELL(dev)) {<br>
-               intel_ddi_set_pipe_settings(crtc);<br>
-               intel_ddi_enable_pipe_func(crtc);<br>
-       }<br>
-<br>
        intel_enable_pipe(dev_priv, pipe, is_pch_port);<br>
        intel_enable_plane(dev_priv, plane, pipe);<br>
<br>
@@ -3291,7 +3283,6 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)<br>
        struct intel_encoder *encoder;<br>
        int pipe = intel_crtc->pipe;<br>
        int plane = intel_crtc->plane;<br>
-       u32 temp;<br>
        bool is_pch_port;<br>
<br>
        WARN_ON(!crtc->enabled);<br>
@@ -3302,12 +3293,6 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)<br>
        intel_crtc->active = true;<br>
        intel_update_watermarks(dev);<br>
<br>
-       if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {<br>
-               temp = I915_READ(PCH_LVDS);<br>
-               if ((temp & LVDS_PORT_EN) == 0)<br>
-                       I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN);<br>
-       }<br>
-<br>
        is_pch_port = intel_crtc_driving_pch(crtc);<br>
<br>
        if (is_pch_port) {<br>
@@ -3321,12 +3306,10 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)<br>
                if (encoder->pre_enable)<br>
                        encoder->pre_enable(encoder);<br>
<br>
-       if (IS_HASWELL(dev))<br>
-               intel_ddi_enable_pipe_clock(intel_crtc);<br>
+       intel_ddi_enable_pipe_clock(intel_crtc);<br>
<br>
-       /* Enable panel fitting for LVDS */<br>
-       if (dev_priv->pch_pf_size &&<br>
-           (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || HAS_eDP)) {<br>
+       /* Enable panel fitting for eDP */<br>
+       if (dev_priv->pch_pf_size && HAS_eDP) {<br>
                /* Force use of hard-coded filter coefficients<br>
                 * as some pre-programmed values are broken,<br>
                 * e.g. x201.<br>
@@ -3342,10 +3325,8 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)<br>
         */<br>
        intel_crtc_load_lut(crtc);<br>
<br>
-       if (IS_HASWELL(dev)) {<br>
-               intel_ddi_set_pipe_settings(crtc);<br>
-               intel_ddi_enable_pipe_func(crtc);<br>
-       }<br>
+       intel_ddi_set_pipe_settings(crtc);<br>
+       intel_ddi_enable_pipe_func(crtc);<br>
<br>
        intel_enable_pipe(dev_priv, pipe, is_pch_port);<br>
        intel_enable_plane(dev_priv, plane, pipe);<br>
@@ -3362,9 +3343,6 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)<br>
        for_each_encoder_on_crtc(dev, crtc, encoder)<br>
                encoder->enable(encoder);<br>
<br>
-       if (HAS_PCH_CPT(dev))<br>
-               intel_cpt_verify_modeset(dev, intel_crtc->pipe);<br>
-<br>
        /*<br>
         * There seems to be a race in PCH platform hw (at least on some<br>
         * outputs) where an enabled pipe still completes any pageflip right<br>
@@ -3404,16 +3382,10 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)<br>
<br>
        intel_disable_pipe(dev_priv, pipe);<br>
<br>
-       if (IS_HASWELL(dev))<br>
-               intel_ddi_disable_pipe_func(dev_priv, pipe);<br>
-<br>
        /* Disable PF */<br>
        I915_WRITE(PF_CTL(pipe), 0);<br>
        I915_WRITE(PF_WIN_SZ(pipe), 0);<br>
<br>
-       if (IS_HASWELL(dev))<br>
-               intel_ddi_disable_pipe_clock(intel_crtc);<br>
-<br>
        for_each_encoder_on_crtc(dev, crtc, encoder)<br>
                if (encoder->post_disable)<br>
                        encoder->post_disable(encoder);<br>
@@ -3470,8 +3442,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)<br>
        struct intel_encoder *encoder;<br>
        int pipe = intel_crtc->pipe;<br>
        int plane = intel_crtc->plane;<br>
-       u32 reg, temp;<br>
-<br>
<br>
        if (!intel_crtc->active)<br>
                return;<br>
@@ -3490,15 +3460,13 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)<br>
<br>
        intel_disable_pipe(dev_priv, pipe);<br>
<br>
-       if (IS_HASWELL(dev))<br>
-               intel_ddi_disable_pipe_func(dev_priv, pipe);<br>
+       intel_ddi_disable_pipe_func(dev_priv, pipe);<br>
<br>
        /* Disable PF */<br>
        I915_WRITE(PF_CTL(pipe), 0);<br>
        I915_WRITE(PF_WIN_SZ(pipe), 0);<br>
<br>
-       if (IS_HASWELL(dev))<br>
-               intel_ddi_disable_pipe_clock(intel_crtc);<br>
+       intel_ddi_disable_pipe_clock(intel_crtc);<br>
<br>
        for_each_encoder_on_crtc(dev, crtc, encoder)<br>
                if (encoder->post_disable)<br>
@@ -3508,33 +3476,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)<br>
<br>
        intel_disable_transcoder(dev_priv, pipe);<br>
<br>
-       if (HAS_PCH_CPT(dev)) {<br>
-               /* disable TRANS_DP_CTL */<br>
-               reg = TRANS_DP_CTL(pipe);<br>
-               temp = I915_READ(reg);<br>
-               temp &= ~(TRANS_DP_OUTPUT_ENABLE | TRANS_DP_PORT_SEL_MASK);<br>
-               temp |= TRANS_DP_PORT_SEL_NONE;<br>
-               I915_WRITE(reg, temp);<br>
-<br>
-               /* disable DPLL_SEL */<br>
-               temp = I915_READ(PCH_DPLL_SEL);<br>
-               switch (pipe) {<br>
-               case 0:<br>
-                       temp &= ~(TRANSA_DPLL_ENABLE | TRANSA_DPLLB_SEL);<br>
-                       break;<br>
-               case 1:<br>
-                       temp &= ~(TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL);<br>
-                       break;<br>
-               case 2:<br>
-                       /* C shares PLL A or B */<br>
-                       temp &= ~(TRANSC_DPLL_ENABLE | TRANSC_DPLLB_SEL);<br>
-                       break;<br>
-               default:<br>
-                       BUG(); /* wtf */<br>
-               }<br>
-               I915_WRITE(PCH_DPLL_SEL, temp);<br>
-       }<br>
-<br>
        /* disable PCH DPLL */<br>
        intel_disable_pch_pll(intel_crtc);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.11.4<br>
<br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>Rodrigo Vivi</div><div>Blog: <a href="http://blog.vivi.eng.br" target="_blank">http://blog.vivi.eng.br</a></div><div> </div><br>