diff mbox series

[v2,12/15] drm/i915/dsb: Early prepare of dsb context.

Message ID 20190821063236.19705-13-animesh.manna@intel.com (mailing list archive)
State New, archived
Headers show
Series DSB enablement. | expand

Commit Message

Animesh Manna Aug. 21, 2019, 6:32 a.m. UTC
The dsb get call added part of the prepare so that we don't
have things that can fail in the commit proper.

The allocated dsb-context will be tracked under intel_crtc_state
instead of intel_crtc per atomic-commit.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c       | 11 +++++++++++
 drivers/gpu/drm/i915/display/intel_display_types.h |  2 ++
 2 files changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index b51d1ceb8739..c6a5f38bdc87 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13833,6 +13833,16 @@  static void skl_update_crtcs(struct intel_atomic_state *state)
 		icl_dbuf_slices_update(dev_priv, required_slices);
 }
 
+static void intel_prepare_dsb(struct intel_atomic_state *state)
+{
+	struct intel_crtc_state *config;
+	struct intel_crtc *crtc;
+	int i;
+
+	for_each_new_intel_crtc_in_state(state, crtc, config, i)
+		config->dsb = intel_dsb_get(crtc);
+}
+
 static void intel_atomic_helper_free_state(struct drm_i915_private *dev_priv)
 {
 	struct intel_atomic_state *state, *next;
@@ -14185,6 +14195,7 @@  static int intel_atomic_commit(struct drm_device *dev,
 	dev_priv->wm.distrust_bios_wm = false;
 	intel_shared_dpll_swap_state(state);
 	intel_atomic_track_fbs(state);
+	intel_prepare_dsb(state);
 
 	if (state->modeset) {
 		memcpy(dev_priv->min_cdclk, state->min_cdclk,
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index e62450a72dc2..0eee65b2eb1c 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -984,6 +984,8 @@  struct intel_crtc_state {
 
 	/* Forward Error correction State */
 	bool fec_enable;
+
+	struct intel_dsb *dsb;
 };
 
 struct intel_crtc {