Эх сурвалжийг харах

disp: msm: sde: wait for tx-done during cwb disable

Currently, cwb disable path issues a cleanup flush & waits for the
commit-done. Wait for the tx-done to ensure the transfer is complete.

Change-Id: I509711c157f1d6646646ad96ed140d6bc76d2dba
Signed-off-by: Veera Sundaram Sankaran <[email protected]>
Veera Sundaram Sankaran 4 жил өмнө
parent
commit
eeb66b8516

+ 16 - 18
msm/sde/sde_encoder_phys_wb.c

@@ -1442,7 +1442,7 @@ static void _sde_encoder_phys_wb_reset_state(
 }
 
 static int _sde_encoder_phys_wb_wait_for_commit_done(
-		struct sde_encoder_phys *phys_enc, bool is_disable)
+		struct sde_encoder_phys *phys_enc, bool force_wait)
 {
 	struct sde_encoder_phys_wb *wb_enc = to_sde_encoder_phys_wb(phys_enc);
 	u32 event = 0;
@@ -1457,9 +1457,9 @@ static int _sde_encoder_phys_wb_wait_for_commit_done(
 
 	SDE_EVT32(DRMID(phys_enc->parent), WBID(wb_enc), phys_enc->in_clone_mode,
 			atomic_read(&phys_enc->pending_retire_fence_cnt),
-			!!wb_enc->wb_fb, is_disable);
+			!!wb_enc->wb_fb, force_wait);
 
-	if (!is_disable && phys_enc->in_clone_mode &&
+	if (!force_wait && phys_enc->in_clone_mode &&
 			(atomic_read(&phys_enc->pending_retire_fence_cnt) <= 1))
 		goto skip_wait;
 
@@ -1515,30 +1515,28 @@ skip_wait:
  * sde_encoder_phys_wb_wait_for_commit_done - wait until request is committed
  * @phys_enc:	Pointer to physical encoder
  */
-static int sde_encoder_phys_wb_wait_for_commit_done(
-		struct sde_encoder_phys *phys_enc)
+static int sde_encoder_phys_wb_wait_for_commit_done(struct sde_encoder_phys *phys_enc)
 {
-	int rc;
-
-	if (phys_enc->enable_state == SDE_ENC_DISABLING &&
-			phys_enc->in_clone_mode) {
-		rc = _sde_encoder_phys_wb_wait_for_commit_done(phys_enc, true);
-		_sde_encoder_phys_wb_reset_state(phys_enc);
-		sde_encoder_phys_wb_irq_ctrl(phys_enc, false);
-	} else {
-		rc = _sde_encoder_phys_wb_wait_for_commit_done(phys_enc, false);
-	}
-
-	return rc;
+	return _sde_encoder_phys_wb_wait_for_commit_done(phys_enc, false);
 }
 
 static int sde_encoder_phys_wb_wait_for_tx_complete(
 		struct sde_encoder_phys *phys_enc)
 {
+	int rc;
+
 	if (!atomic_read(&phys_enc->pending_retire_fence_cnt))
 		return 0;
 
-	return _sde_encoder_phys_wb_wait_for_commit_done(phys_enc, true);
+	rc = _sde_encoder_phys_wb_wait_for_commit_done(phys_enc, true);
+
+	/* cleanup for cwb disable case */
+	if ((phys_enc->enable_state == SDE_ENC_DISABLING) && phys_enc->in_clone_mode) {
+		_sde_encoder_phys_wb_reset_state(phys_enc);
+		sde_encoder_phys_wb_irq_ctrl(phys_enc, false);
+	}
+
+	return rc;
 }
 
 /**

+ 2 - 1
msm/sde/sde_kms.c

@@ -1582,7 +1582,8 @@ static void sde_kms_wait_for_commit_done(struct msm_kms *kms,
 		 * mode panels. This may be a no-op for command mode panels.
 		 */
 		SDE_EVT32_VERBOSE(DRMID(crtc));
-		ret = sde_encoder_wait_for_event(encoder, MSM_ENC_COMMIT_DONE);
+		ret = sde_encoder_wait_for_event(encoder, cwb_disabling ?
+						MSM_ENC_TX_COMPLETE : MSM_ENC_COMMIT_DONE);
 		if (ret && ret != -EWOULDBLOCK) {
 			SDE_ERROR("wait for commit done returned %d\n", ret);
 			sde_crtc_request_frame_reset(crtc, encoder);