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 <veeras@codeaurora.org>
This commit is contained in:
Veera Sundaram Sankaran
2021-06-24 10:07:20 -07:00
parent 30d5ac5184
commit eeb66b8516
2 changed files with 18 additions and 19 deletions

View File

@@ -1442,7 +1442,7 @@ static void _sde_encoder_phys_wb_reset_state(
} }
static int _sde_encoder_phys_wb_wait_for_commit_done( 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); struct sde_encoder_phys_wb *wb_enc = to_sde_encoder_phys_wb(phys_enc);
u32 event = 0; 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, SDE_EVT32(DRMID(phys_enc->parent), WBID(wb_enc), phys_enc->in_clone_mode,
atomic_read(&phys_enc->pending_retire_fence_cnt), 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)) (atomic_read(&phys_enc->pending_retire_fence_cnt) <= 1))
goto skip_wait; goto skip_wait;
@@ -1515,30 +1515,28 @@ skip_wait:
* sde_encoder_phys_wb_wait_for_commit_done - wait until request is committed * sde_encoder_phys_wb_wait_for_commit_done - wait until request is committed
* @phys_enc: Pointer to physical encoder * @phys_enc: Pointer to physical encoder
*/ */
static int sde_encoder_phys_wb_wait_for_commit_done( static int sde_encoder_phys_wb_wait_for_commit_done(struct sde_encoder_phys *phys_enc)
struct sde_encoder_phys *phys_enc)
{ {
int rc; return _sde_encoder_phys_wb_wait_for_commit_done(phys_enc, false);
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;
} }
static int sde_encoder_phys_wb_wait_for_tx_complete( static int sde_encoder_phys_wb_wait_for_tx_complete(
struct sde_encoder_phys *phys_enc) struct sde_encoder_phys *phys_enc)
{ {
int rc;
if (!atomic_read(&phys_enc->pending_retire_fence_cnt)) if (!atomic_read(&phys_enc->pending_retire_fence_cnt))
return 0; 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;
} }
/** /**

View File

@@ -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. * mode panels. This may be a no-op for command mode panels.
*/ */
SDE_EVT32_VERBOSE(DRMID(crtc)); 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) { if (ret && ret != -EWOULDBLOCK) {
SDE_ERROR("wait for commit done returned %d\n", ret); SDE_ERROR("wait for commit done returned %d\n", ret);
sde_crtc_request_frame_reset(crtc, encoder); sde_crtc_request_frame_reset(crtc, encoder);