Merge tag 'drm-intel-next-2022-07-06' of git://anongit.freedesktop.org/drm/drm-intel...
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / display / intel_display.c
index 903226e..a0f84cb 100644 (file)
 
 static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state);
 static void intel_set_pipe_src_size(const struct intel_crtc_state *crtc_state);
-static void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state);
-static void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state);
 static void hsw_set_transconf(const struct intel_crtc_state *crtc_state);
 static void bdw_set_pipemisc(const struct intel_crtc_state *crtc_state);
 static void ilk_pfit_enable(const struct intel_crtc_state *crtc_state);
@@ -3015,14 +3013,18 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc,
        intel_bigjoiner_adjust_pipe_src(pipe_config);
 }
 
-static void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state)
+void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state)
 {
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        u32 pipeconf = 0;
 
-       /* we keep both pipes enabled on 830 */
-       if (IS_I830(dev_priv))
+       /*
+        * - We keep both pipes enabled on 830
+        * - During modeset the pipe is still disabled and must remain so
+        * - During fastset the pipe is already enabled and must remain so
+        */
+       if (IS_I830(dev_priv) || !intel_crtc_needs_modeset(crtc_state))
                pipeconf |= PIPECONF_ENABLE;
 
        if (crtc_state->double_wide)
@@ -3335,14 +3337,19 @@ out:
        return ret;
 }
 
-static void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state)
+void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state)
 {
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum pipe pipe = crtc->pipe;
-       u32 val;
+       u32 val = 0;
 
-       val = 0;
+       /*
+        * - During modeset the pipe is still disabled and must remain so
+        * - During fastset the pipe is already enabled and must remain so
+        */
+       if (!intel_crtc_needs_modeset(crtc_state))
+               val |= PIPECONF_ENABLE;
 
        switch (crtc_state->pipe_bpp) {
        default:
@@ -3401,6 +3408,13 @@ static void hsw_set_transconf(const struct intel_crtc_state *crtc_state)
        enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
        u32 val = 0;
 
+       /*
+        * - During modeset the pipe is still disabled and must remain so
+        * - During fastset the pipe is already enabled and must remain so
+        */
+       if (!intel_crtc_needs_modeset(crtc_state))
+               val |= PIPECONF_ENABLE;
+
        if (IS_HASWELL(dev_priv) && crtc_state->dither)
                val |= PIPECONF_DITHER_EN | PIPECONF_DITHER_TYPE_SP;