msm: display: dsi command mode vsync time generation

In each vsync cycle there will be two vsync interrupts
generated, need ignore the wrong one to provide the correct vsync
timestamp.

CRs-fixed: 452269
Change-Id: Ic13eea77d15eb46f4879f818d346425c63efe41a
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
msm_fb: display: wait4vsync before set suspend flag

Since wait4vsync checks suspend flag, wait4vsync needs to
be executed before suspend flag set to enforce wait happen.
Also, when timing generator is turned off, wait4vsync can
not be used anymore since the last vsync may have passed
before wait4vsync called. This patch fixed commit_comp
timeout cause fence timeout happen on hdmi plug and unplug
cases.

CRs-fixed: 449027
Change-Id: I0f5520538bb290643a648c937296b6bc097fe051
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/mdp4_overlay_lcdc.c
msm_fb: display: change the location of wakeup timer call

There are two pathes (pan display and overlay commit) to commit
display buffer, so change the location of cpu timer wakup call to the
common pipe_commit function to make sure cpu get waked up around
vsync.

Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Change-Id: Idbe6049d740a7e17a6a90e28566f7a9c74e348f2
Revert "mdp: dtv: Fix pipe staging, again"

This reverts commit 4c9552ebef9b4e39b38f2b0d962e32e00342c57e.

Conflicts:
	drivers/video/msm/mdp4_overlay_dtv.c

Change-Id: Id7ba6e9a20730966c51bb14754d42fc579b62b16

Conflicts:
	drivers/video/msm/mdp4_overlay_dtv.c
msm: display: vsync usage in turning off dsi video

Add timeout to waiting for vsync so that it can come out
when vsync interrupt is not working.
Need not wait for vsync after timing engine is off.

Change-Id: Ib989e435405613d891024ba15144723730454e34
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c
msm: mdp: Use a waitqueue for vsync notifications

Use a waitqueue instead of completions and make sure the vsync
show event always returns the timestamp except when it is
interrupted. This simplifies the vsync wait mechanism both here
and in userspace and avoids any unnecessary locking.

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c

Change-Id: Ib52ea416c51f2edd923224e7819662cdb77507b7

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
msm: display: Make the video vsync timeout interruptible

Prevent hanging when putting the panel in standby

Change-Id: I29ca2ef8bb9fac9d49d8d32c11fa26d66b2339a6