From f77088a0409416976d43b01cf6ecba2553257e14 Mon Sep 17 00:00:00 2001 From: Yashwanth Date: Wed, 31 Mar 2021 16:45:33 +0530 Subject: [PATCH] disp: msm: sde: perform only soft reset during timeout scenarios During wait for commit done failure cases in the current code in video mode and command mode(posted start), global atomic state for current crtc state will be assigned NULL during state swap which will lead to crash while using drm_atomic_crtc_state_for_each_plane API. Also in such timeout cases, border color staging and kickoff being done without any vblank wait might lead to inconsistent state because of configuration overriding from the next commit. Since the timeout is observed at the end of commit cycle, only soft reset should be done here and remaining in the next commit cycle. Change-Id: I0d42dc27035f4f79394aeec347d797c99ed76e5f Signed-off-by: Yashwanth --- msm/sde/sde_crtc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 580ab53007f5..348bff1199ec 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -3636,8 +3636,11 @@ int sde_crtc_reset_hw(struct drm_crtc *crtc, struct drm_crtc_state *old_state, } } - /* Early out if simple ctl reset succeeded */ - if (i == sde_crtc->num_ctls) + /* + * Early out if simple ctl reset succeeded or reset is + * being performed after timeout + */ + if (i == sde_crtc->num_ctls || crtc->state == old_state) return 0; SDE_DEBUG("crtc%d: issuing hard reset\n", DRMID(crtc));