disp: msm: sde: wait for a vsync on suspend

The current scenario is as follows commit N with autorefresh
enabled and frame starts processing. On suspend commit N+1,
during virt_disable software resets CTL path after autorefresh
config is disabled. Since in hardware frame is still processing
sw reset is causing fifo underflow. This change waits for
vsync so that current autorefresh frame transaction completes
before issuing a CTL_SW_RESET.

Change-Id: Ib0662837e54b14cea6ab835a1093a2f048c473be
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
Signed-off-by: Akash Gajjar <quic_agajjar@quicinc.com>
Этот коммит содержится в:
Mahadevan
2022-12-08 20:57:41 +05:30
коммит произвёл Akash Gajjar
родитель 123a785ddf
Коммит 497405aaf1
3 изменённых файлов: 40 добавлений и 1 удалений

Просмотреть файл

@@ -1619,6 +1619,27 @@ static void sde_encoder_control_te(struct sde_encoder_virt *sde_enc, bool enable
}
}
static void _sde_encoder_wait_for_vsync_on_autorefresh_busy(struct sde_encoder_phys *phys_enc)
{
u32 autorefresh_status;
int ret = 0;
if (!phys_enc || !phys_enc->hw_intf || !phys_enc->hw_intf->ops.get_autorefresh_status) {
SDE_ERROR("invalid params\n");
return;
}
autorefresh_status = phys_enc->hw_intf->ops.get_autorefresh_status(phys_enc->hw_intf);
if (autorefresh_status) {
ret = sde_encoder_wait_for_event(phys_enc->parent, MSM_ENC_VBLANK);
if (ret) {
autorefresh_status = phys_enc->hw_intf->ops.get_autorefresh_status(
phys_enc->hw_intf);
SDE_ERROR("wait for vblank timed out, autorefresh_status:%d\n",
autorefresh_status);
}
}
}
int sde_encoder_helper_switch_vsync(struct drm_encoder *drm_enc,
bool watchdog_te)
@@ -3694,8 +3715,10 @@ static void sde_encoder_virt_disable(struct drm_encoder *drm_enc)
for (i = 0; i < sde_enc->num_phys_encs; i++) {
struct sde_encoder_phys *phys = sde_enc->phys_encs[i];
if (phys && phys->ops.disable_autorefresh)
if (phys && phys->ops.disable_autorefresh) {
phys->ops.disable_autorefresh(phys);
_sde_encoder_wait_for_vsync_on_autorefresh_busy(phys);
}
}
/* wait for idle */