ec226c2
From 73a35468564f4e47deade0a4a5eb7ec289611ebc Mon Sep 17 00:00:00 2001
ec226c2
From: Matt Roper <matthew.d.roper@intel.com>
ec226c2
Date: Thu, 12 May 2016 07:06:11 -0700
0903551
Subject: [PATCH 17/17] drm/i915: Remove wm_config from
0903551
 dev_priv/intel_atomic_state
0903551
ec226c2
We calculate the watermark config into intel_atomic_state and then save
ec226c2
it into dev_priv, but never actually use it from there.  This is
ec226c2
left-over from some early ILK-style watermark programming designs that
ec226c2
got changed over time.
0903551
ec226c2
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
ec226c2
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
ec226c2
Link: http://patchwork.freedesktop.org/patch/msgid/1463061971-19638-18-git-send-email-matthew.d.roper@intel.com
0903551
---
0903551
 drivers/gpu/drm/i915/i915_drv.h      |  3 ---
0903551
 drivers/gpu/drm/i915/intel_display.c | 31 -------------------------------
0903551
 drivers/gpu/drm/i915/intel_drv.h     |  1 -
0903551
 3 files changed, 35 deletions(-)
0903551
0903551
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
ec226c2
index e7bde72..608f8e4 100644
0903551
--- a/drivers/gpu/drm/i915/i915_drv.h
0903551
+++ b/drivers/gpu/drm/i915/i915_drv.h
ec226c2
@@ -1961,9 +1961,6 @@ struct drm_i915_private {
0903551
 		 */
0903551
 		uint16_t skl_latency[8];
0903551
 
0903551
-		/* Committed wm config */
0903551
-		struct intel_wm_config config;
0903551
-
0903551
 		/*
0903551
 		 * The skl_wm_values structure is a bit too big for stack
0903551
 		 * allocation, so we keep the staging struct where we store
0903551
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
ec226c2
index a75daac..9c109c6 100644
0903551
--- a/drivers/gpu/drm/i915/intel_display.c
0903551
+++ b/drivers/gpu/drm/i915/intel_display.c
ec226c2
@@ -13343,35 +13343,6 @@ static int calc_watermark_data(struct drm_atomic_state *state)
0903551
 {
0903551
 	struct drm_device *dev = state->dev;
0903551
 	struct drm_i915_private *dev_priv = to_i915(dev);
0903551
-	struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
0903551
-	struct drm_crtc *crtc;
0903551
-	struct drm_crtc_state *cstate;
0903551
-	struct drm_plane *plane;
0903551
-	struct drm_plane_state *pstate;
0903551
-
0903551
-	/*
0903551
-	 * Calculate watermark configuration details now that derived
0903551
-	 * plane/crtc state is all properly updated.
0903551
-	 */
0903551
-	drm_for_each_crtc(crtc, dev) {
0903551
-		cstate = drm_atomic_get_existing_crtc_state(state, crtc) ?:
0903551
-			crtc->state;
0903551
-
0903551
-		if (cstate->active)
0903551
-			intel_state->wm_config.num_pipes_active++;
0903551
-	}
0903551
-	drm_for_each_legacy_plane(plane, dev) {
0903551
-		pstate = drm_atomic_get_existing_plane_state(state, plane) ?:
0903551
-			plane->state;
0903551
-
0903551
-		if (!to_intel_plane_state(pstate)->visible)
0903551
-			continue;
0903551
-
0903551
-		intel_state->wm_config.sprites_enabled = true;
0903551
-		if (pstate->crtc_w != pstate->src_w >> 16 ||
0903551
-		    pstate->crtc_h != pstate->src_h >> 16)
0903551
-			intel_state->wm_config.sprites_scaled = true;
0903551
-	}
0903551
 
0903551
 	/* Is there platform-specific watermark information to calculate? */
0903551
 	if (dev_priv->display.compute_global_watermarks)
ec226c2
@@ -13625,7 +13596,6 @@ static int intel_atomic_commit(struct drm_device *dev,
0903551
 	}
0903551
 
0903551
 	drm_atomic_helper_swap_state(dev, state);
ec226c2
-	dev_priv->wm.config = intel_state->wm_config;
0903551
 	dev_priv->wm.distrust_bios_wm = false;
0903551
 	dev_priv->wm.skl_results = intel_state->wm_results;
ec226c2
 	intel_shared_dpll_commit(state);
ec226c2
@@ -15405,7 +15375,6 @@ retry:
0903551
 	}
0903551
 
0903551
 	/* Write calculated watermark values back */
0903551
-	to_i915(dev)->wm.config = to_intel_atomic_state(state)->wm_config;
0903551
 	for_each_crtc_in_state(state, crtc, cstate, i) {
0903551
 		struct intel_crtc_state *cs = to_intel_crtc_state(cstate);
0903551
 
0903551
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
ec226c2
index ab0be7a..8d73c20 100644
0903551
--- a/drivers/gpu/drm/i915/intel_drv.h
0903551
+++ b/drivers/gpu/drm/i915/intel_drv.h
ec226c2
@@ -305,7 +305,6 @@ struct intel_atomic_state {
0903551
 	unsigned int min_pixclk[I915_MAX_PIPES];
0903551
 
0903551
 	struct intel_shared_dpll_config shared_dpll[I915_NUM_PLLS];
0903551
-	struct intel_wm_config wm_config;
0903551
 
ec226c2
 	/*
ec226c2
 	 * Current watermarks can't be trusted during hardware readout, so
0903551
-- 
0903551
2.7.4
0903551