mm: add vzalloc() and vzalloc_node() helpers

Add vzalloc() and vzalloc_node() to encapsulate the
vmalloc-then-memset-zero operation.

Use __GFP_ZERO to zero fill the allocated memory.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Acked-by: Greg Ungerer <gerg@snapgear.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
msm_fb: display: Use spinlock instead of mutex in vsync timer handler

Use spinlock instead of mutex in vsync timer handler to avoid sleeping
from timer context through mutex locks

Change-Id: I302e2d966c9167c5fc1b0c7586b8047e8cb700cb
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
video: msm: Block histogram requests with powered down panel

This causes MSMFB_HISTOGRAM ioctls to return an error when they are called
after the panel has entered a powered down state.

CRs-Fixed: 310429
Change-Id: I39c768c62a37ca83df2db2309230971cb6492bab
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm_fb: Make buffers aligned to 4K page boundary

This change makes the frame buffers aligned to the page
boundary. Improves GPU performance since accessing the
frame buffer from page boundary is faster.

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

Conflicts:

	arch/arm/mach-msm/board-msm7627a-display.c

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

Conflicts:

	arch/arm/mach-msm/board-8930-display.c
	arch/arm/mach-msm/board-8960-display.c
	arch/arm/mach-msm/board-msm7x27a.c
	arch/arm/mach-msm/board-msm8x60.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp_dma_dsi_video.c
msm_fb: Clean up of frame buffer 4KB alignment changes

Remove redundant code from the 4 KB alignment patch
and reduce the overhead of calculation of the hole
size by using bitwise operators in its calculation.

CRs-fixed: 325134
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 0473d05091f0df4d85e4f6a162f55a9af8d3307b)

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

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp_dma_dsi_video.c
msm_fb: Fix error in y-offset check logic in FB driver

After 4 KB alignment changes, the frame from 3rd buffer doesn't
get updated since during PUT_VSCREEN_INFO ioctl, the driver
returns -1 to userspace due to error in logic because the hole
size is not considered in calculating the logic for validity of
the y-offset. Change fixes this error.

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

Change-Id: Ifccfa25a37fe0f8d86bf5b822d9affe7fa41203a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: Clean up the fix for error in y-offset check in FB driver

There is a failure observed in yres_virtual offset check and every
third frame gets skipped without an error message. Due to this high
fps is noticed in the test applications. Correct the yres_virtual
offset check.

CRs-fixed: 325134
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 2bd101d5bed1729b317114456360605e86289c15)

Change-Id: I35af570df2d6d2609562203f30f3caa1506b9b1d
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: display: commit BLT to mdp register during video kickoff

BLT (writeback mode) need to be committed to mdp register
before kickoff. Normally, UI kickoff will follow immediatly
after BLT enabled/disabled. However sometimes video overlay
play happen before UI's pan display after BLT enabled/disabled.
In this case, video kickoff need to commit BLT to mdp register too.

Change-Id: I7b085f516f869009e7fc4b443f7858a61fce5ba3
Signed-off-by: kuogee hsieh <khsieh@codeaurora.org>
msm_fb: display: set mdp perf_level to low level after playing video

This bug fix sets mdp clk rate back to the rate for UI after playing
video to save power.

Change-Id: I73a0db158536b27a4a50d25b7737db4327210b8f
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit 23fa9e7a958be09f9d6743cea026a4f56b84a48f)

Conflicts:

	drivers/video/msm/mdp4_overlay.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm_fb: display: remove mdp_lut_enable call to avoid hang issue

Change-Id: Id9c26a8f9fc8b24dad08dde03cc0aa36d955aa97
video: msm_fb: Increase display timeout to 2 seconds

One second time out for no frame update, as in current implementation,
does not allow CABL to reach minimum backlight level possible because
histograms dont get generated after one second. So increase time out
period to two seconds which seem to be sufficient for complete black to
complete white and vice versa transitions.

CRs-Fixed: 370804
(cherry picked from commit 1bb4edf9242b0397975636a4442318713a53b5e6)

Change-Id: I0712924d669abcb820654cd6ca5f7da37bed57e6
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm_fb: display: Add mutex during display turn off

There is a possibility that suspend operation trigger during
a display update. Add mutex to serialize suspend and display update
operations

Change-Id: I52dea1bd718e8c54d894ae3830e86105f951efab
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: acpuclock: Fix error path in multicore targets

Several acpuclock drivers have inherited the same error path bug in
acpuclk_set_rate(). If an invalid cpu is passed as an argument to
these functions, they should return immediately instead of jumping to
the 'out' label, which attempts to unlock a mutex which has never
been acquired.

Change-Id: I47b9709605673a5200caf73a2f2a5086fde63efe
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Update headers to allow the use of kernel headers

Change-Id: Ib8304c3b27ea90e45e35edf97cee81e1d1ca52b8