drm/i915: push DDI and DSI underrun reporting on enable to encoder
authorJani Nikula <jani.nikula@intel.com>
Thu, 5 Oct 2017 10:52:12 +0000 (13:52 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 6 Oct 2017 08:30:31 +0000 (11:30 +0300)
Simplify CRTC enable.

v2: Don't forget DSI (Daniel)

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1ad8f3ccaed99a5f03e3d53345221a25ad0be50f.1507200657.git.jani.nikula@intel.com
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dsi.c

index f7c91bb9d13e40779cbfa1c9ca5ec11415eb1b8c..ce4b7335a78a47a3c4a1253ca77805285068ef8a 100644 (file)
@@ -2213,8 +2213,16 @@ static void intel_ddi_pre_enable(struct intel_encoder *encoder,
                                 const struct intel_crtc_state *pipe_config,
                                 const struct drm_connector_state *conn_state)
 {
+       struct drm_crtc *crtc = pipe_config->base.crtc;
+       struct drm_i915_private *dev_priv = to_i915(crtc->dev);
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       int pipe = intel_crtc->pipe;
        int type = encoder->type;
 
+       WARN_ON(intel_crtc->config->has_pch_encoder);
+
+       intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
+
        if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
                intel_ddi_pre_enable_dp(encoder,
                                        pipe_config->port_clock,
index 9058cdfb06496c2a2e620d026ec5723787c346d7..b55944d8149bff1d2239522d89572b9f1d1f2225 100644 (file)
@@ -5521,9 +5521,6 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
 
        intel_crtc->active = true;
 
-       if (!intel_crtc->config->has_pch_encoder)
-               intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
-
        intel_encoders_pre_enable(crtc, pipe_config, old_state);
 
        if (intel_crtc->config->has_pch_encoder)
index 20a7b004ffd70fda9b7bb25cb9623fad93a4b35d..66bbedc5fa01d1e79e6869e8cdfdd8bd4b734e34 100644 (file)
@@ -790,14 +790,19 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,
                                 const struct intel_crtc_state *pipe_config,
                                 const struct drm_connector_state *conn_state)
 {
-       struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
        struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
+       struct drm_crtc *crtc = pipe_config->base.crtc;
+       struct drm_i915_private *dev_priv = to_i915(crtc->dev);
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       int pipe = intel_crtc->pipe;
        enum port port;
        u32 val;
        bool glk_cold_boot = false;
 
        DRM_DEBUG_KMS("\n");
 
+       intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
+
        /*
         * The BIOS may leave the PLL in a wonky state where it doesn't
         * lock. It needs to be fully powered down to fix it.