drm/i915: move detaching scalers to begin_crtc_commit, v2.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 15 Jun 2015 10:33:48 +0000 (12:33 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 22 Jun 2015 12:25:07 +0000 (14:25 +0200)
This is probably intended to be be done during vblank evasion.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Tested-by(IVB): Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_atomic.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h

index d5afc2aa4ac7ef2426170e4a71bb16227c6b0ac5..c1263be8c98b120790a96b9a6206526b16657ea2 100644 (file)
@@ -144,9 +144,6 @@ int intel_atomic_commit(struct drm_device *dev,
        for_each_crtc_in_state(state, crtc, crtc_state, i) {
                to_intel_crtc(crtc)->config = to_intel_crtc_state(crtc->state);
 
-               if (INTEL_INFO(dev)->gen >= 9)
-                       skl_detach_scalers(to_intel_crtc(crtc));
-
                drm_atomic_helper_commit_planes_on_crtc(crtc_state);
        }
 
index bc55221ffe659bb45ccacc221c6a042e71dee6e4..449e07d29b3e74ca82bf04ea4571176e2cc66f0a 100644 (file)
@@ -2925,16 +2925,13 @@ unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane,
 /*
  * This function detaches (aka. unbinds) unused scalers in hardware
  */
-void skl_detach_scalers(struct intel_crtc *intel_crtc)
+static void skl_detach_scalers(struct intel_crtc *intel_crtc)
 {
        struct drm_device *dev;
        struct drm_i915_private *dev_priv;
        struct intel_crtc_scaler_state *scaler_state;
        int i;
 
-       if (!intel_crtc || !intel_crtc->config)
-               return;
-
        dev = intel_crtc->base.dev;
        dev_priv = dev->dev_private;
        scaler_state = &intel_crtc->config->scaler_state;
@@ -13831,6 +13828,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
                intel_crtc->atomic.evade =
                        intel_pipe_update_start(intel_crtc,
                                                &intel_crtc->atomic.start_vbl_count);
+
+       if (!needs_modeset(crtc->state) && INTEL_INFO(dev)->gen >= 9)
+               skl_detach_scalers(intel_crtc);
 }
 
 static void intel_finish_crtc_commit(struct drm_crtc *crtc)
index eaf7eaf2ffacb4ec804425c68307a13e08742623..49ec7142b9cc94c22a13eaa817644b1d33189c9c 100644 (file)
@@ -1147,7 +1147,6 @@ void intel_mode_from_pipe_config(struct drm_display_mode *mode,
                                 struct intel_crtc_state *pipe_config);
 void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc);
 void intel_modeset_preclose(struct drm_device *dev, struct drm_file *file);
-void skl_detach_scalers(struct intel_crtc *intel_crtc);
 
 int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state, int force_detach);
 int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state);