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 <quic_jmadiset@quicinc.com>
This commit is contained in:
Jayaprakash Madisetty
2022-04-14 22:55:34 +05:30
committad av Gerrit - the friendly Code Review server
förälder bb9ced8cb4
incheckning 60053c51bc

Visa fil

@@ -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);