From 60053c51bc2eb3d5d9bc5a47cd4cf257df3f45ac Mon Sep 17 00:00:00 2001 From: Jayaprakash Madisetty Date: Thu, 14 Apr 2022 22:55:34 +0530 Subject: [PATCH] disp: msm: sde: avoid PM suspend/resume if display has splash enabled With speculative retire fence, the first commit from HAL depends on crtc power_on event instead of retire fence signal to unblock the wait completion. Hence avoid triggering PM suspend/resume if any of the displays have continuous splash enabled. This will avoid any state changes in drm_atomic_state and will be inline with HAL expectation. Change-Id: I97360e3815651eefdd7e2c1494fa6e882df883b5 Signed-off-by: Jayaprakash Madisetty --- msm/sde/sde_kms.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/msm/sde/sde_kms.c b/msm/sde/sde_kms.c index a082eef4..e176b1aa 100644 --- a/msm/sde/sde_kms.c +++ b/msm/sde/sde_kms.c @@ -3994,10 +3994,17 @@ static int sde_kms_pm_suspend(struct device *dev) /* disable hot-plug polling */ drm_kms_helper_poll_disable(ddev); - /* if a display stuck in CS trigger a null commit to complete handoff */ + /* if any built-in display is stuck in CS, skip PM suspend entry to + * avoid driver SW state changes. With speculative fence enabled, HAL depends + * on power_on notification for the first commit to exit the Wait completion + * instead of retire fence signal. + */ drm_for_each_encoder(enc, ddev) { - if (sde_encoder_in_cont_splash(enc) && enc->crtc) - _sde_kms_null_commit(ddev, enc); + if (sde_encoder_in_cont_splash(enc) && enc->crtc) { + SDE_DEBUG("skip PM suspend, splash is enabled on enc:%d\n", DRMID(enc)); + SDE_EVT32(DRMID(enc), SDE_EVTLOG_FUNC_EXIT); + return -EINVAL; + } } /* acquire modeset lock(s) */ @@ -4128,6 +4135,7 @@ static int sde_kms_pm_resume(struct device *dev) { struct drm_device *ddev; struct sde_kms *sde_kms; + struct drm_encoder *enc; struct drm_modeset_acquire_ctx ctx; int ret, i; @@ -4141,6 +4149,14 @@ static int sde_kms_pm_resume(struct device *dev) sde_kms = to_sde_kms(ddev_to_msm_kms(ddev)); SDE_EVT32(sde_kms->suspend_state != NULL); + /* if a display is in cont splash early exit */ + drm_for_each_encoder(enc, ddev) { + if (sde_encoder_in_cont_splash(enc) && enc->crtc) { + SDE_DEBUG("skip PM resume entry splash is enabled on enc:%d\n", DRMID(enc)); + SDE_EVT32(DRMID(enc), SDE_EVTLOG_FUNC_EXIT); + return -EINVAL; + } + } if (sde_kms->suspend_state) drm_mode_config_reset(ddev);