msm: display: buf sync enhancement

Support wait for fence when flag is set

(cherry picked from commit 0745ebc4d82b4676da9b5ab8490824f6f9faa31b)

Change-Id: I2096103149874b3c7db90c38df59a1c767146994
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: allow fb open even in suspend state

resume might be coming later, allow fb open sucessfully, only
panel driver needs be delayed

(cherry picked from commit 89380aac14332dd3ff39a3f0904bfed117458abc)

Change-Id: Id24112f5bba7ba6290113987ebcc8ba6e4256419
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: Do not create release fence in suspend

When in suspend state, display operation will be stopped,
fence will not be signaled

(cherry picked from commit effec4d54954e67c91ba50eb228ecf56025d78ab)

Change-Id: Icbdd30995fa6662f28b003880c79d384d6f3b482
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: panel recovering from suspend

In suspend state, fb_open cannot turn on panel, need save this info
for resume.
In suspend state, blank setting needs be cached to be used at resuming.

(cherry picked from commit 9f7c82eaed91b9950d5ff5b1bbc77c6221a98afb)

Change-Id: I222f706774d0eed61a1cba6e8154ffd2337c2563
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: fb: make the pan task interruptible

(cherry picked from commit f35e93e2bbd636b25888d4283b17791b6f98fa78)

Change-Id: Ica9fea1b3523ba7c3e4e335ef9b0a54fbf1c8136
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: add more checking to ensure display is idle

Before execute operation on display, make sure it is complete idle
Because non-blocking display update has been introduced, need make sure
display update has finished in all entrances except the ones for
initialization.

(cherry picked from commit 43d62bf4b61cbaf52677126a4899ff8b489cdd76)

Change-Id: I18bee54c950404bea7ab89c9575c888e4c015935
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: add mutex for display driver entries

In some cases, display driver is called by multiple threads, this
will cause re-entrance problem. For example, one thread is
calling display commit, the other turns off the display. In order
to serialize the operation, mutex is added to most APIs.
Only the ones for initialization won't be added.

(cherry picked from commit 12c51684416bf5cc14d645fb741eea8d3d6627fa)

Change-Id: I84359d2e89930b61f5a0641b5e3078f9846c60ab
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: sync point handling in blanking

Release all fences when go to blank

(cherry picked from commit 2575a4aa634aec1c198dd8bc851c5a002dff2278)

Change-Id: I9d6a1f4ccd97b188497866b7f27cd9d3f84c94fc
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.c
updating ION headers to support JB_chocolate kernel and mr 1 HAL

(cherry picked from commit 9dd583b5dfafaf5077e72b89df3708b99c0cb679)

Change-Id: I92de796d0697f70db19a42fd0381782b0eac5f7e
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: matching MDP IOCTL numbers with userspace

(cherry picked from commit 923093ce7da6ca017ebe7e40cb8d812cedbc3066)

Change-Id: Icbcedc4c809ae61af2737b9919fe03b4efa58e46
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Protecting error condition if pipe alloc fails

(cherry picked from commit 4904a6e1f0ec57c0f1e240afc00314154317bc9c)

Change-Id: I4c41184fbbe2d40bdd36d40dd21d9a98adb2a76a
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Send vsync events using sysfs for MDP4 targets

Replace sending of vsync timestamp using uevents with sysfs entry
as uevent result in increase in power numbers due to broadcast in
nature. Also, for smart panel, wait4vsync is removed.

(cherry picked from commit 2f0b6c9746f1e7c343bb8c1287c54a75eabf32f1)

Change-Id: I80cf2ce719ed381c3f5e031a3abc02823eebb8db
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_video.c