msm: kgsl: Check for valid pointer before dereferencing

Check to make sure that there is a valid context pointer before
dereferencing it when adding commands to the ringbuffer.

Change-Id: Icf9824de8f62a28cdeeef4378246d9fb334d39fa
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm: kgsl: Always submit an interrupt request to the GPU

A context does not have to be present to send an internal dummy
command to the GPU.  Remove BUG() in this case and instead send
a NULL context which will still cause the interrupt to get submitted
to the GPU.

CRs-fixed: 392688
Change-Id: I66b6eebe899ab09e6615d08faddea7ea73de5c6d
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm_fb: display: Fix blend configuration for MDDI I/F

MDP4.0 blend operation registers are not double buffered and
take effect as soon as they are configured. Configuring these
registers at any place other than between dma and vsync produce
flickers as new blend values would get applied to previous
mixer configurations. Configure blend operation registers just
after dma is over, before vsync.

CRs-Fixed: 410029
Change-Id: I2d04b2edb1e6592ac192fd00d302d8941a56ad69
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
board-msm7x30: display: Increase the camera heap for 720p

There is not enough memory for 720p video play when played
on external interface. Hence increase camera heap by 1 frame
of 720p resolving the playback issue on external interface.

CRs-Fixed: 410088
Change-Id: I40eb108e6d03eb371ad63c03154eaab59760dd2b
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Merge "msm_fb: display: Fix blend configuration for MDDI I/F"
Merge "board-msm7x30: display: Increase the camera heap for 720p"
Merge "msm: kgsl: Check for valid pointer before dereferencing"
Merge "msm: kgsl: Always submit an interrupt request to the GPU"
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.

(cherry picked from commit 1b6843a3a56e60e73305c66369f8ad806353e22d)

Change-Id: Ic03c920883c7adf3184cb4d0f61177185c09b079
CRs-Fixed: 384026
Signed-off-by: Kinjal Bhavsar <kbhavsar@codeaurora.org>
Merge "msm_fb: display: Add timeout for waiting on update"
Revert "msm_fb: display: Add timeout for waiting on update"

This reverts commit ef20e6f80c114c05e72f21fee4e6c7fae8ed4fbe.

Change-Id: I8be59cf411491a822e9259e8cdee5233b1447779
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "Revert "msm_fb: display: Add timeout for waiting on update""
diag: Fix various issues with IOCTLs

DIAG kernel driver interacts with user space processes using
IOCTLS. Some issues, such as potential integer over/underflow,
incorrect buffer copy etc were identified in these functions.
This change fixes them.

Fix for the following CVE-
CVE#1 CVE-2012-4220
CVE#2 CVE-2012-4221

CRs-Fixed: 385352, 385349
Change-Id: Ie37dbda0acdc63fb440bd81d7f57c146f314b91a
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
msm:vidc: Amend error checks on ION API failures

This change will validate the ION API failures
to fix target freeze issues.

CRs-fixed: 412958
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
(cherry picked from commit 31bb7dc8e3a4d01262727349b30bb3007fd474bd)

Conflicts:

	drivers/video/msm/vidc/720p/ddl/vcd_ddl_utils.c
	drivers/video/msm/vidc/common/vcd/vcd_sub.c

Change-Id: I6d0dc8afef6ba1513c2ea29753f7df6b1a3d70e9
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "msm:vidc: Amend error checks on ION API failures"
Merge "diag: Fix various issues with IOCTLs"
msm_serial_hs_hwreg.h: Correcting the even parity and odd parity bits

Currently parity bits are defined to be used with UART_DM_MR2
register with PARITY_MODE Bit as below :
EVEN_PARTIY = 1 and ODD_PARITY = 2
With these values, UART functionality doesn't work after enabling parity.
Hence adding correct used PARITY_MODE bits value as
EVEN_PARITY = 2 and ODD_PARITY = 1
after confirming with UART hardware programming guide.

CRs-Fixed: 410377
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
(cherry picked from commit fd40e5f6313fbc74e8897927be1004faa5d9df08)

Change-Id: Ia7461d1983336b1d965498ede00001cc67c1d925
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Merge "msm_serial_hs_hwreg.h: Correcting the even parity and odd parity bits"
msm_fb: display: return fail if pipe still staged

Pipe is not un-staged from mixer when it is unset.
It expects a pan_display() to un-stage it out of mixer.
Return fail at overlay_set() if pipe was still stage
at mixer.

(cherry picked from commit 4fc9350b124ded06f90c43410c2c0b512681c0db)

Change-Id: I49f0ab340e1d3930fc8e279743e8749e6f0d5726
CRs-fixed: 399193, 393979
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Merge "msm_fb: display: return fail if pipe still staged"