diff mbox series

[v2,13/15] drm/i915/dsb: Cleanup of DSB context.

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

Commit Message

Manna, Animesh Aug. 21, 2019, 6:32 a.m. UTC
DSB context destroyed using intel_dsb_put() in cleanup function.

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 | 16 ++++++++++++++++
 1 file changed, 16 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 c6a5f38bdc87..7415c4cb8eee 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13843,6 +13843,20 @@  static void intel_prepare_dsb(struct intel_atomic_state *state)
 		config->dsb = intel_dsb_get(crtc);
 }
 
+static void intel_cleanup_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) {
+		if (config->dsb) {
+			intel_dsb_put(config->dsb);
+			config->dsb = NULL;
+		}
+	}
+}
+
 static void intel_atomic_helper_free_state(struct drm_i915_private *dev_priv)
 {
 	struct intel_atomic_state *state, *next;
@@ -14061,6 +14075,8 @@  static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 
 	drm_atomic_helper_commit_hw_done(&state->base);
 
+	intel_cleanup_dsb(state);
+
 	if (state->modeset) {
 		/* As one of the primary mmio accessors, KMS has a high
 		 * likelihood of triggering bugs in unclaimed access. After we