msm_fb: Display: Fix Dithering issue for rgb565 format

Using RGB888 as source format and rgb565 as destination pixel format,
will cause image corruption on the display. Fix this issue by
setting the destination format as RGB888 in MDP and DSI controller
pixel format as RGB565 for DSI specific panels.

CRs-Fixed: 377484
Change-Id: If58976ee9cd4825efb39437170e54796fa2213e0
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm_fb: display: Add timeout for waiting on update

Content Adaptive BackLight userspace algo waits on UPDATE_NOTIFY to
get the screen updates. When turning off CABL, this blocking ioctl
causes the CABL threads to wait until next screen update, which may
take indefinite time.

Add timeout value to the wait_for_completion call, to make ioctl
call blocking for at most timeout value.

CRs-Fixed: 384026
Signed-off-by: Kinjal Bhavsar <kbhavsar@codeaurora.org>
(cherry picked from commit 1b6843a3a56e60e73305c66369f8ad806353e22d)

Change-Id: Ie9609b96bc19d8ec7630a35dfc0da5c79a5615c1
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
Merge commit '74ac0b4' into cm-11.0
video: msm: Dynamically toggle histogram interrupt

Make histogram enable/disable functions also enable/disable the histogram
"interrupt enabled" bit on the MDP enabled interrupts register.

CRs-Fixed: 398556
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 1026832c51cbadeea9a717fa20fb42b6a7c5661f)

Change-Id: I5923189a2f82e2bfbed31ac9706d6fdc5f377406
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
video: msm: Defer histogram reset to workqueue

Currently, when an underrun occurs, a reset request is sent to the
histogram hardware. This has been observed to cause a hang in the histogram
collection cycle. The fix for this hang is to instead rely on the existing
checks for histogram validity in the histgram read worker. When the
underrun occurs, the histogram is invalidated, which in turn causes the
histogram read worker to reset the histogram collection when it attempts to
read its contents.

Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 2dd5234c094157bf77781b8646ac9ad114f819b0)

Change-Id: I68958cc8a4bc8e63fc95d58e0f48c6e195d71e86
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
msm_fb: Avoid memset of frame buffer during early suspend

At present, we have backlight disabled before frame buffer
early suspend and there is mechanism in place to enable backlight
only after first frame update after display resume. This makes sure
to avoid panel specific artifacts being visible. Hence,
remove memset of frame buffer during suspend. This change
reduces latencies during frame buffer's early suspend.

Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 96ebb53ba08a96c03c89349bc1110175b85cb8be)

Change-Id: I037552e6cb01e33f738b5f3062550d8c6f9f2e6b
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm_fb: Update backlight level on resume after first pan display

Use shared workqueue to delay the update of backlight after
a first valid frame is displayed on the panel. This avoids any
transients being displayed during resume.

CRs-fixed: 361002
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 8c13d2615b1c608f941137166efb649353cc0bdb)

Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
(cherry picked from commit 8a17f54f8d9e267b03b41df59bf210d56e16064a)

Change-Id: I641738dbe90bb3fb162d1c07d19ef587c071dd61
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>