7d2c2f2
From f28225dda2a2bf1e2d96bbe44b45d43a7d5071d3 Mon Sep 17 00:00:00 2001
7d2c2f2
From: Matt Roper <matthew.d.roper@intel.com>
7d2c2f2
Date: Thu, 12 May 2016 07:05:59 -0700
7d2c2f2
Subject: [PATCH 05/17] drm/i915/gen9: Store plane minimum blocks in CRTC wm
7d2c2f2
 state (v2)
7d2c2f2
7d2c2f2
This will eventually allow us to re-use old values without
7d2c2f2
re-calculating them for unchanged planes (which also helps us avoid
7d2c2f2
re-grabbing extra plane states).
7d2c2f2
7d2c2f2
v2:
7d2c2f2
 -  Drop unnecessary memset's; they were meant for a later patch (which
7d2c2f2
    got reworked anyway to not need them, but were mis-rebased into this
7d2c2f2
    one.  (Maarten)
7d2c2f2
7d2c2f2
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
7d2c2f2
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
7d2c2f2
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
7d2c2f2
Link: http://patchwork.freedesktop.org/patch/msgid/1463061971-19638-6-git-send-email-matthew.d.roper@intel.com
7d2c2f2
---
7d2c2f2
 drivers/gpu/drm/i915/intel_drv.h | 4 ++++
7d2c2f2
 drivers/gpu/drm/i915/intel_pm.c  | 4 ++--
7d2c2f2
 2 files changed, 6 insertions(+), 2 deletions(-)
7d2c2f2
7d2c2f2
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
7d2c2f2
index 6a95696..9308cff 100644
7d2c2f2
--- a/drivers/gpu/drm/i915/intel_drv.h
7d2c2f2
+++ b/drivers/gpu/drm/i915/intel_drv.h
7d2c2f2
@@ -431,6 +431,10 @@ struct intel_crtc_wm_state {
7d2c2f2
 			/* cached plane data rate */
7d2c2f2
 			unsigned plane_data_rate[I915_MAX_PLANES];
7d2c2f2
 			unsigned plane_y_data_rate[I915_MAX_PLANES];
7d2c2f2
+
7d2c2f2
+			/* minimum block allocation */
7d2c2f2
+			uint16_t minimum_blocks[I915_MAX_PLANES];
7d2c2f2
+			uint16_t minimum_y_blocks[I915_MAX_PLANES];
7d2c2f2
 		} skl;
7d2c2f2
 	};
7d2c2f2
 
7d2c2f2
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
7d2c2f2
index 5104ba7..6c7a048 100644
7d2c2f2
--- a/drivers/gpu/drm/i915/intel_pm.c
7d2c2f2
+++ b/drivers/gpu/drm/i915/intel_pm.c
7d2c2f2
@@ -3067,8 +3067,8 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
7d2c2f2
 	enum pipe pipe = intel_crtc->pipe;
7d2c2f2
 	struct skl_ddb_entry *alloc = &ddb->pipe[pipe];
7d2c2f2
 	uint16_t alloc_size, start, cursor_blocks;
7d2c2f2
-	uint16_t minimum[I915_MAX_PLANES];
7d2c2f2
-	uint16_t y_minimum[I915_MAX_PLANES];
7d2c2f2
+	uint16_t *minimum = cstate->wm.skl.minimum_blocks;
7d2c2f2
+	uint16_t *y_minimum = cstate->wm.skl.minimum_y_blocks;
7d2c2f2
 	unsigned int total_data_rate;
7d2c2f2
 
7d2c2f2
 	skl_ddb_get_pipe_allocation_limits(dev, cstate, config, alloc);
7d2c2f2
-- 
7d2c2f2
2.7.4
7d2c2f2