msm_fb: display: disable pan display and memory access to fb1 and fb2

The native fb1 and fb2 framebuffer memory is not used and not
allocated on the board file. So on the driver side, pan display ioctl
or other operations on fb1 or fb2 framebuffer memory is checked and
invalidated.

(cherry picked from commit ca61dbb1d9f0d8fe2c4d5871d9934379708c1091)

Change-Id: Ie3e85e20f5675f9cfe02c4587f0fe119e8d57e76
CRs-fixed: 357242
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit 722c3f5d85f95a5f6bf6b94dfb39cc8813ceb572)

Conflicts:

	drivers/video/msm/msm_fb.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
(cherry picked from commit c5bbffec2019ad4f4f574f0719a1a98d4c7fa5f7)

Conflicts:

	drivers/video/msm/msm_fb.c
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.

Change-Id: I17879437dd7cbb9a1758d82321c6e68dbd88b9e0
CRs-Fixed: 325134
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>

Conflicts:

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

Conflicts:

	drivers/video/msm/mdp4_overlay_atv.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_lcdc.c
	drivers/video/msm/mdp_dma.c
	drivers/video/msm/mdp_dma_dsi_video.c
	drivers/video/msm/mdp_dma_lcdc.c
	drivers/video/msm/mdp_dma_tv.c
	drivers/video/msm/msm_fb.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.

Change-Id: I1706484249bf8e01b250e91fa87e00f6021d9a72
CRs-fixed: 325134
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: display: Enable timing generator during first update

During first display update through pan_display or overlay_play,
enable the timing generator for pull modes like LCDC, DSI Video
and DTV interfaces

Change-Id: I69ba1361586f0b461dcc50a7c6b96fa26347152c
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_video.c

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: Wait for external vsync before turning off DTV

Wait for external vsync interrupt before turning off the timing generator
for DTV display

CRs-Fixed: 341400
Change-Id: Ibd380f8e20a7ebb250669fcabf4233e9e526d22f
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dtv.c
msm_fb: display: Flush pipe registers before staging the pipe

Flush pipe registers before staging the pipe for the Mixer with
pull mode panel interfaces. This fixes the IOMMU page fault/underrun
caused by pipe fetching previously unmapped buffers due to missing flush
calls

CRs-Fixed: 356484
Change-Id: I6bc2e49746a7c3773708796bc1709c75a8afaa4b
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: remove mixer1 waiting4vsync when staging down the pipe

dtv_pipe is the base layer pipe for mixer1. Waiting for vsync when
staging down this pipe (it happens when we unplug HDMI cable) causes
mixer1 under run because at the vsync moment dtv_pipe is disconnected
to mixer1.

CRs-fixed: 349765, 355110
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit b2bdae8ee4262a4e1d8e8e7f9c91b80790bdff27)

Change-Id: Ifcc38e5c954c4e58a9328ea3c85a5a1baa5ad826
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit 8ff14bda4a8de3ab4c567c06d9eb283a996bb686)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
gpu: ion: Fix fragmentation message log condition

If an ion allocation fails because of memory fragmentation a debug
message should be printed. However, the logic that decides whether
the debug message should be printed or not is incorrect causing
the debug message to not be printed when it should.

CRs-fixed: 359593
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit 099501a01beda17a8b5be3ebc13d51791d96a269)

Change-Id: Ic91b9e97852b37461f4df503b2940714a344bdc2
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>

Conflicts:

	drivers/gpu/ion/ion_cp_heap.c
gpu: ion: Leave fmem in c-state until unsecured

When the last buffer is freed from a heap that uses fmem we call
into fmem to transition the memory from c-state to t-state. However,
if the heap has been secured for content protection transitioning
the memory from c-state to t-state could cause undefined behavior
in fmem.

Add checks to ensure that a secured heap will not transition to
t-state until heap is unsecured.

CRs-fixed: 359593
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit 20f3b6d7591986db8ff46a7f7e333b3c30db04e8)

Change-Id: I0d58b82bb119f4d621a3ddf1891dc477322ad532
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: rotator: Add secure session flag to rotator start data

Add flag for handling secure session to rotator data passed during
start ioctl call.

Change-Id: I58e2107dfc5c9956691a3defa7364fc220cfe079
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
usb: gadget: android: Reset next_string_id before enable

Reset next_string_id to 0 before enabling the gadget driver. Otherwise,
after a large number of enable/disable cycles, bind will fail
because we cannot allocate new string ids. String ids cannot be larger
than 254 per USB spec.

Change-Id: I44f5fece45008b7a0a18c025d4eb5ce842585c28
Signed-off-by: Benoit Goby <benoit@android.com>
usb: gadget: Fix usb string id allocation

Don't reset next_string_id every time the gadget is enabled, this makes
the next strings allocated overwrite strings allocated at probe time.
Instead, fix rndis not to allocate new string ids on every config bind.

Change-Id: Ied28ee416bb6f00c434c34176fe5b7f0dcb2b2d4
Signed-off-by: Benoit Goby <benoit@android.com>
USB: gadget: f_audio_source: New gadget driver for audio output

This driver presents a standard USB audio class interface to the host
and an ALSA PCM device to userspace

Signed-off-by: Mike Lockwood <lockwood@google.com>

Conflicts:

	drivers/usb/gadget/android.c

Change-Id: Ieecc3d33ef5ddd48702dd8f6be0bd5d820589d4c

Conflicts:

	drivers/usb/gadget/f_audio_source.c