Before pm_suspend is called when there is a vsync enable event
from sf and disabling is not done pm_suspend will fail.
Following are the commit states when a pm_suspend is called:
1. Normal Active Commit - When an active commit is going on
and pm_suspend is called then forcefully do a disable
commit. This will make sure in encoder virt_disable
wait for vsync disable is exited only after vsync is
disabled.
2. Suspend Commit - When suspend commit is going on
the wait for vblank disable in encoder virt_disable will
make sure the pending vsync event from sf is already
triggered.
3. Doze mode - When in doze mode in pm_suspend we will
forcefully do a commit to change to doze suspend.
In this case, we will make sure that the commit is
completed and rc_idle is kicked in. There is a chance
disabling of vblank irq is not done in this case.
4. Doze Suspend mode- This is same as Doze Mode where
vblank irq may not be disabled.
To resolve the issue in Case3 and 4 wait for a vblank irq is added
which will queue the vblank disable work to event_thread and make
sure the queued work is completed by doing a kthread_flush.
Change-Id: I8f9969c3865f7396d6e87819d65c7b16be73ad39
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>