[Intel-gfx] [PATCH] drm/i915/skl: Only disable scalers once

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Aug 5 07:59:36 PDT 2015


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Only disable scalers once when transitioning from enabled state.

Avoids a lot of log noise as a side effect.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Chandra Konduru <chandra.konduru at intel.com>
---
Compile tested only due momentary lack of suitable hardware for testing!!!
---
 drivers/gpu/drm/i915/intel_display.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 83dadb4796a4..b7541a9b5223 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2954,16 +2954,19 @@ static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id)
 /*
  * This function detaches (aka. unbinds) unused scalers in hardware
  */
-static void skl_detach_scalers(struct intel_crtc *intel_crtc)
+static void skl_detach_scalers(struct intel_crtc *intel_crtc,
+			       struct intel_crtc_state *old_intel_crtc_state)
 {
-	struct intel_crtc_scaler_state *scaler_state;
+	struct intel_crtc_scaler_state *scaler_state, *old_scaler_state;
 	int i;
 
 	scaler_state = &intel_crtc->config->scaler_state;
+	old_scaler_state = &old_intel_crtc_state->scaler_state;
 
 	/* loop through and disable scalers that aren't in use */
 	for (i = 0; i < intel_crtc->num_scalers; i++) {
-		if (!scaler_state->scalers[i].in_use)
+		if (!scaler_state->scalers[i].in_use &&
+		    old_scaler_state->scalers[i].in_use)
 			skl_detach_scaler(intel_crtc, i);
 	}
 }
@@ -13665,7 +13668,8 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
 		intel_pipe_update_start(intel_crtc, &intel_crtc->start_vbl_count);
 
 	if (!needs_modeset(crtc->state) && INTEL_INFO(dev)->gen >= 9)
-		skl_detach_scalers(intel_crtc);
+		skl_detach_scalers(intel_crtc,
+				   to_intel_crtc_state(old_crtc_state));
 }
 
 static void intel_finish_crtc_commit(struct drm_crtc *crtc,
-- 
2.4.6



More information about the Intel-gfx mailing list