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