[7/9] drm/i915/dsb: Wait for DSB to idle after disabling it
diff mbox series

Message ID 20200129182034.26138-7-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • [1/9] drm/i915/dsb: Replace HAS_DSB check with dsb->cmd_buf check
Related show

Commit Message

Ville Syrjälä Jan. 29, 2020, 6:20 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

In case DSB was busy before we started it we try to disable it.
Let's try to wait for it to become idle.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dsb.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
index 53759bf7a451..45acfd91ee74 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.c
+++ b/drivers/gpu/drm/i915/display/intel_dsb.c
@@ -300,4 +300,7 @@  void intel_dsb_commit(struct intel_dsb *dsb)
 	dsb->free_pos = 0;
 	dsb->ins_start_offset = 0;
 	intel_de_write(dev_priv, DSB_CTRL(pipe, dsb->id), 0);
+
+	if (wait_for(!is_dsb_busy(dsb), 1))
+		DRM_ERROR("Timed out waiting for DSB idle.\n");
 }