msm_fb: display: add sysfs and clock control to smart panel

Both vsync enabled and disabled are controlled by framework
through ioctl. Driver reports vsync event to framework via
sysfs. Meanwhile, mdp related clocks are enabled by frame
work at vsync enabled request and disabled by driver if there
is no any display update within specifid vsync period.

Change-Id: Ice5be3a6db5930b95bdd2f718d9256bf73936e23
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_cmd.c
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>

Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm_fb: display: turn mdp clock on at pipe_commit

mdp clock is controlled by frame work. There has
possibility that mdp clock had been turned off while
frame update still happen. In this case update
thread may stuck at wait4vsync since there has no
mdp clcok to trigger vsync interrupt. This patch
will enable mdp clock at pipe commit when mdp clock
is tunred off so that frame update can be completed.

Change-Id: I2d31b9a4b6f0cb9dd36516a80931988e23e8a545
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_cmd.c

Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_cmd.c
msm_fb: display: Make sysfs read request interruptible

Change blocking sysfs read request to be interruptible and protect
vsync timestamp value to prevent corruption.

(cherry picked from commit 9da7f0167abb5a78e38bc3907786181845b04d58)

Change-Id: I816ebc1235f2efdb15fe3620d57cf8152d4734ed
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm_fb: display: Send current timestamp if vsync time not available

Send current kernel timestamp if vsyncs timestamp is zero. This
happens if the kernel hasnt yet received the vsync interrupt.

(cherry picked from commit baba51f9b7e861309f79af3cdefa33b0da0834f4)

Change-Id: I248d2939bb6c7f14bfe379f0f7e923ad1ebcd433
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb : Add timeout while waiting for vsync event

Avoid eternal wait for vsync event when client tries to
read the corresponding sysfs entry. This will avoid hangs when
client tries to read in corner cases where the Timing
Generator or the clock or IRQ gets disabled.

(cherry picked from commit c0ab36eaa7f3457e2137ede0fd5a89a493db9e20)

Change-Id: I2291c35f14397973d42dc3200cb43626699276bc
CRs-fixed: 406752
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Send current timestamp in case of timeout

On timeout while waiting for the vsync, send the current
timestamp to the userspace. This resolves the infinite
wait seen during the bootup.

Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Change-Id: I0d7b8750becfbb4e5c5e47b29ded6395627e8862