msm_fb: display: enable pixel repeat on VG pipe only for alpha upscaling

VG pipe doesn't support pixel repeat/drop to avoid alpha channel drop
during downscaling. Keep pixel repeat only for upscaling.

Change-Id: Id400d0f823bc0054a94330600d5085778a65b936
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm_fb: display: allocate mdp writeback memory

The writeback buffer is already reserved on the board side. This
allocation separate writeback buffer from framebuffer.

Change-Id: I312be3e0dfcf4c5b611cd06cd68d2baae7e2add8
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: board: reserve mdp writeback memory

The memory allocation happens on the display mdp driver side. This
separation of writeback buffers from the frame buffer is mainly for
content security.

Change-Id: I404b5f8db01dd5ed940916d7d46a8ace2d295e3a
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: Add backlight with first pan display after resume

Add backlight call with first pan display after resume operation
of framebuffer driver

CRs-Fixed: 323682
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ic27c2c9fe37b622bbd9ab5933ca45626decd53ae
msm_fb:display: Enable Layermixer2 for nv12 writeback

enabling the layermixer2 for new MDP hardware so that it can be
used to writeback the output in nv12 format for wi-fi display usecase

Change-Id: I70322e722d8382102077db2d94a9320c2f2bb175
Signed-off-by: Rajesh Sastrula <vrajesh@codeaurora.org>
msm_fb:display: Enable Layermixer2 for nv12 writeback

enabling the layermixer2 for new MDP hardware so that it can be
used to writeback the output in nv12 format for wi-fi display usecase

Change-Id: I70322e722d8382102077db2d94a9320c2f2bb175
Signed-off-by: Rajesh Sastrula <vrajesh@codeaurora.org>
msmfb: display: clean up of the writeback buffer variables

clean up of the writeback variables to change the write back
allocation for ion support

Change-Id: I4999e43cb2f7111853e9c4a17852b2d5a351204e
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
msm-fb: display: ION based allocation for writeback buffers

ION based allocation is added for the writeback support
for content security.

Change-Id: Iaa7ec07a7cbc05c818af6f26a2c42c8c36b9bcb5
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
[P350] Updated defconfig

Change-Id: I0786c61b4692f397438df4a41b27fa03d6a0596e
msm: clean up of the writeback variables in the board

clean up of the writeback variables for ion support

Change-Id: Ic710e35645eb3a91b9cc571b4d320db53c07d34a
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
msm: ion heap support for the mdp driver

heap id is added to mdp driver pdata as driver needs to allocate
the memory from different heap based on the msm target

Change-Id: I60d163b663f56933fc0360cc6fa48edf2d0bb3c7
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
video:msm: Adding stub for MSMFB_MDP_PP ioctls

Basic handling of invalid copy_from_user and op from an invalid range.

Change-Id: I788b28d3804e7312ee18310011c75d11287c4c6c
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msmfb: display: fix the issue with overlay wait api

calling overlay wait api asynchronous to the other overlay apis
results in race condition in protection flags. this case is
observed with HDMI true mirroring feature. it modifies the
protection logic to fix the race condition

Change-Id: Ib933055a395c2fc743f018aee96090defde33d37
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
msm_fb: display: fix mdp clk rate settings

If the video resolution is changed from higher to lower, mdp clk rate
cannot be changed before overlay_play. Otherwise, underrun may happen
because of a lower mdp clk rate for current higher resolution
frames. On the other hand, if the res is changed from lower to higher,
mdp clk rate must be changed before overlay_play to avoid underrun.

CRs-fixed: 327811
Change-Id: Ieac4d2e1644e5687e3506b37799c56e19a17b991
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: wfd: Adds writeback start/stop functionality.

Removes register/unregister calls and replaces them
with start/stop. No need to pre-register the buffers
anymore.

Change-Id: I2f12c3a5791252ad09032cc628d93fb1dc50fee0
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
msm_fb: display: fix underrun seen for some YV12 format input

Underruns seen on display because source rectangle width is
aligned to 16 before being passed to MDP. Only ystride should be
aligned, source rectangle should be passed as received.

CRs-Fixed: 329453
Change-Id: Ibb71ad316023d21ebad4c5db37fdc5e5c8acb02b
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
video: msm: Adding CSC configuration for DMA P

This enables the ability for the MSMFB_MDP_PP ioctl to configure the DMA P
CSC registers.

Change-Id: I1e18646decdd26641592bbc2a2dc0a4aa74e5f8a
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
kernel.h: add pr_warn for symmetry to dev_warn, netdev_warn

The current logging macros are
pr_<level>, dev_<level>, netdev_<level>, and netif_<level>.
pr_ uses warning, the other use warn.

Standardize these logging macros a bit more by adding pr_warn and
pr_warn_ratelimited.

Right now, there are:

$ for level in emerg alert crit err warn warning notice info ; do \
    for prefix in pr dev netdev netif ; do \
      echo -n "${prefix}_${level}:	`git grep -w "${prefix}_${level}" | wc -l`	" ; \
    done ; \
    echo ; \
  done
pr_emerg: 	45	dev_emerg: 	4	netdev_emerg: 	1	netif_emerg: 	4
pr_alert: 	24	dev_alert: 	36	netdev_alert: 	1	netif_alert: 	6
pr_crit: 	24	dev_crit: 	22	netdev_crit: 	1	netif_crit: 	4
pr_err:  	2013	dev_err: 	8467	netdev_err: 	267	netif_err: 	240
pr_warn: 	0	dev_warn: 	1818	netdev_warn: 	126	netif_warn: 	23
pr_warning: 	773	dev_warning: 	0	netdev_warning:	0	netif_warning: 	0
pr_notice: 	148	dev_notice: 	111	netdev_notice: 	9	netif_notice: 	3
pr_info: 	1717	dev_info: 	3007	netdev_info: 	101	netif_info: 	85

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
msm_fb: display: Add external display PM suspend support

Remove PM suspend registration from HDMI driver and add it in
MSM framebuffer driver

Change-Id: I696ffd23d066b765a6a7f23287ed88ce53afb7c5
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb : Check validity of histogram bin collection

When CABL is disabled from UI, wait for completion gets killed.
Histogram bin collection is invalid in this case. Add checks
to handle this scenario.

CRs-fixed: 331527
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 0bd4827)

Change-Id: I9a9ff110d1b97b206bbd899271ac6c52e13f6657
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>