[Intel-gfx] [PATCH 13/15] drm/i915/dsb: Cleanup of DSB context.

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


DSB context destroyed using intel_dsb_put() in cleanup function.

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 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 6dea61689290..7c2dabc46d1f 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13724,6 +13724,22 @@ static void intel_prepare_dsb(struct drm_atomic_state *state)
 	}
 }
 
+static void intel_cleanup_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);
+		intel_dsb_put(config->dsb);
+	}
+}
+
 static void intel_atomic_helper_free_state(struct drm_i915_private *dev_priv)
 {
 	struct intel_atomic_state *state, *next;
@@ -13772,6 +13788,7 @@ static void intel_atomic_cleanup_work(struct work_struct *work)
 		container_of(work, struct drm_atomic_state, commit_work);
 	struct drm_i915_private *i915 = to_i915(state->dev);
 
+	intel_cleanup_dsb(state);
 	drm_atomic_helper_cleanup_planes(&i915->drm, state);
 	drm_atomic_helper_commit_cleanup_done(state);
 	drm_atomic_state_put(state);
-- 
2.21.0



More information about the Intel-gfx mailing list