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

Submitted by Animesh Manna on Aug. 12, 2019, 8:06 a.m.

Details

Message ID 20190812080655.27535-13-animesh.manna@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX - Try Bot

Not browsing as part of any series.

Commit Message

Animesh Manna Aug. 12, 2019, 8:06 a.m.
DSB context destroyed using intel_dsb_put() in cleanup function.

Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 7ad0bc93d644..cdf5a4488dab 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13859,6 +13859,22 @@  static void intel_prepare_dsb(struct intel_atomic_state *state)
 		config->dsb = intel_dsb_get(crtc);
 }
 
+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;
@@ -13910,6 +13926,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);