From bfcd87de91642410ecd2d22a4e29593cae05ec9a Mon Sep 17 00:00:00 2001 From: Akash Gajjar Date: Tue, 4 Jul 2023 14:38:26 +0530 Subject: [PATCH] disp: msm: sde: avoid returning vsync count for cwb encoder In CWB use case along with suspend commit, the function drm_crtc_funcs.get_vblank_counter returns a zero vsync count value. This causes blocking of drm_crtc_funcs.disable_vblank, leading to a wait for vsync timeout while disabling the encoder. hence clear a cwb encoder mask in encoder disable and set it while performing mode set. Change-Id: Ic994aa0a86faf48e2b25955cf6fe12166fe9d328 Signed-off-by: Akash Gajjar --- msm/sde/sde_encoder.c | 1 + msm/sde/sde_encoder_phys_wb.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index e490b654ac..75d65a0110 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -3123,6 +3123,7 @@ static void sde_encoder_virt_mode_set(struct drm_encoder *drm_enc, sde_crtc_state->cached_cwb_enc_mask); sde_crtc_state->cwb_enc_mask = sde_crtc_state->cached_cwb_enc_mask; sde_encoder_set_clone_mode(drm_enc, crtc_state); + sde_crtc->cached_encoder_mask |= drm_encoder_mask(drm_enc); } /* reserve dynamic resources now, indicating non test-only */ diff --git a/msm/sde/sde_encoder_phys_wb.c b/msm/sde/sde_encoder_phys_wb.c index d37c748121..cd92f17dd2 100644 --- a/msm/sde/sde_encoder_phys_wb.c +++ b/msm/sde/sde_encoder_phys_wb.c @@ -2063,6 +2063,8 @@ static bool _sde_encoder_phys_wb_is_idle(struct sde_encoder_phys *phys_enc) static void _sde_encoder_phys_wb_reset_state(struct sde_encoder_phys *phys_enc) { struct sde_encoder_phys_wb *wb_enc = to_sde_encoder_phys_wb(phys_enc); + struct sde_encoder_virt *sde_enc = to_sde_encoder_virt(phys_enc->parent); + struct sde_crtc *sde_crtc; phys_enc->enable_state = SDE_ENC_DISABLED; @@ -2074,6 +2076,10 @@ static void _sde_encoder_phys_wb_reset_state(struct sde_encoder_phys *phys_enc) wb_enc->wb_aspace = NULL; } + sde_crtc = to_sde_crtc(sde_enc->crtc); + if (sde_crtc) + sde_crtc->cached_encoder_mask &= ~drm_encoder_mask(phys_enc->parent); + wb_enc->crtc = NULL; phys_enc->hw_cdm = NULL; phys_enc->hw_ctl = NULL;