[Intel-gfx] [PATCH 12/15] drm/i915/dsb: Early prepare of dsb context.

Animesh Manna animesh.manna at intel.com
Mon Jul 1 06:26:29 UTC 2019


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 at linux.intel.com>
Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Signed-off-by: Animesh Manna <animesh.manna at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 17 +++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h             |  2 ++
 2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index e55bd75528c1..6dea61689290 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13708,6 +13708,22 @@ static void skl_update_crtcs(struct drm_atomic_state *state)
 		icl_dbuf_slices_update(dev_priv, required_slices);
 }
 
+static void intel_prepare_dsb(struct drm_atomic_state *state)
+{
+	struct drm_crtc_state *crtc_state;
+	struct drm_crtc *crtc;
+	struct intel_crtc_state *config;
+	int i;
+
+	if (!state)
+		return;
+
+	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
+		config = to_intel_crtc_state(crtc_state);
+		config->dsb = intel_dsb_get(to_intel_crtc(crtc));
+	}
+}
+
 static void intel_atomic_helper_free_state(struct drm_i915_private *dev_priv)
 {
 	struct intel_atomic_state *state, *next;
@@ -14074,6 +14090,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 (intel_state->modeset) {
 		memcpy(dev_priv->min_cdclk, intel_state->min_cdclk,
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index a05a047d78af..bfea0e21de63 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -946,6 +946,8 @@ struct intel_crtc_state {
 
 	/* Forward Error correction State */
 	bool fec_enable;
+
+	struct intel_dsb *dsb;
 };
 
 struct intel_crtc {
-- 
2.21.0



More information about the Intel-gfx mailing list