msm: kgsl: convert timestamp_cmp logic to use unsigned logic

The meaning of timestamps becomes difficult to understand when
converting between unsigned and signed values. Values that
were seperated by 0x80000000 also returned inconsistent
results.

CRs-Fixed: 355752

Conflicts:

	drivers/gpu/msm/kgsl.h

Change-Id: I5d5d1ad64ef120da8769d72ac69dde37f8f5c6ae
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:

	drivers/gpu/msm/kgsl.h

Conflicts:
	drivers/gpu/msm/kgsl.h
msm_fb: HDMI: Do not add HDCP reauth timer during probe

Currently all HDMI/HDCP timers are initialized in the driver's
probe function with a maximum possible expiration value. However,
the 32-bit jiffies value is initialized in the kernel so as to
wrap 5 minutes after boot. This results in the HDCP timer being
fired 5 minutes after boot even though reauthentication is not
necessary. This change fixes this issue by not starting the HDCP
reauth timer during probe. The timer is only started when an
authentication failure is detected from an existing valid HDCP
session.

CRs-Fixed: 352080
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
(cherry picked from commit ca15287e50fe00dd6526fdc166cb526298099fb2)

Change-Id: Ia3e240c3c0c32b6ef9fa2c58e48a5cadb64791b8
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
(cherry picked from commit b44b96003a28d22433731b7d53db57cc5641a052)
base: genlock: remove BIT macro usage

The BIT macro is not defined for !_KERNEL_ resulting in compile errors.

CRs-fixed: 356263
Change-Id: Ib2acd913033fccca63716d6585a51707c72debf0
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
video: msm: wfd: Don't signal HDMIDaemon to mirror on FB1

Remove obsolete code that signalled HDMIDaemon to mirror the
display on FB1.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
CRs-Fixed: 352830
(cherry picked from commit 4102d704243cf0ff297cdbe8d5b731da4c0bb9d5)

Change-Id: I07fabb754a49fe398813e864067f96c66a47f489
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: vidc: Metadata memory release issue.

Metadata memory is not freed when there is
memory allocation failure in ddl open. Fixed
this issue by freeing the metadata memory.

CRs-Fixed: 353109
Change-Id: I3f6fd93498aea0ce78092bd3a28cf08625b0ca77
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
(cherry picked from commit af296715bd5db6c38997d1171d079331c8650287)
(cherry picked from commit 572e147402717bb0c77ecc807659d05a617e370f)
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/logo.c
	drivers/video/msm/msm_fb.c
msm: board-8960: Disable idle standalone PC

On 8960, standalone PC could be enabled by mpdecision if it isn't
enabled by the init scripts. Disable standalone power collapse mode by
removing the table entries in rpm resources and cpuidle.

Change-Id: I8dda27e5f1c2093ff3f769e9d790165e92e01ff5
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
(cherry picked from commit d1d288e3fc7c896695ee75149994a3999bffa0d6)

Conflicts:
	arch/arm/mach-msm/board-8960.c
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_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:
	arch/arm/mach-msm/board-8930-display.c
	arch/arm/mach-msm/board-8960-display.c
	arch/arm/mach-msm/board-msm7x27a.c
	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
Cherry-pick d07ece96fe85ca8ac5106e394c86484ae8ac157a from
https://github.com/CyanogenMod/android_kernel_samsung_d2

Change-Id: Id7e8cce3034b31e33ab1d26c5c0428f11705b9be

Conflicts:
	drivers/gpu/msm/adreno.c
	drivers/gpu/msm/adreno_a2xx.c
	drivers/gpu/msm/adreno_a3xx.c
	drivers/gpu/msm/adreno_ringbuffer.c
	drivers/gpu/msm/kgsl.c
	drivers/gpu/msm/kgsl_gpummu.c
	drivers/gpu/msm/kgsl_iommu.c
	drivers/gpu/msm/kgsl_pwrscale.h
3.0.21/LGE additions needed to previous cherry-pick

Change-Id: I2e16fbbda3f102b68c0b88e09f732ce0c9f82126

Conflicts:
	drivers/gpu/msm/adreno_ringbuffer.c
3.0.21/LGE additions needed to previous cherry-pick

Change-Id: I2e16fbbda3f102b68c0b88e09f732ce0c9f82126

Conflicts:
	include/generated/compile.h