msm: camera: check buffer validity in isp buf mgr

When someone asks for buffer from isp_buf_mgr, check
if buffer is valid. This is done by verifying if it is
present in the list of buffers for this session.

This will potentially avoid few kinds of page faults.

Change-Id: I787a9503853706be65f1960779144d4b62925865
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
Signed-off-by: xdabbeb <xdabbeb@gmail.com>
msm: camera: Add defensive check in ISPIF driver

In case of error handling, call ispif release only if ispif handle
is valid. In case of mm-qcamara-daemon crash when camera is not open,
these handles are not valid. Hence it leads to kernel crash in ispif
release handler.

Change-Id: Ifb402b6907052594d12fcf9495694e6c5184af1b
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Signed-off-by: xdabbeb <xdabbeb@gmail.com>
msm-camera: Dividing unified buffer in proportion to the image size

Write masters writing large images require large latency buffers in
unified buffer whereas write masters writing smaller images don't,
Allocating latency buffer in proportion to image size will reduce
buf overflows

Change-Id: I54d3b4389eb616b9684d5b62caaed029c83299ab
Signed-off-by: Mohit Setia <msetia@codeaurora.org>
Signed-off-by: xdabbeb <xdabbeb@gmail.com>
msm-camera: Enable proportional slicing of unified buffer

To enable proportional slicing

Change-Id: I8a21c8808085f527b9536edc51ccdcfa1de4e179
Signed-off-by: Mohit Setia <msetia@codeaurora.org>
Signed-off-by: xdabbeb <xdabbeb@gmail.com>
msm: camera: exit camera incase axi gets timeout

AXI hits timeout while stopping due to sensor not streaming.
Simply returning error from here puts AXI and camif in still
running state whereas userspace proceeds with releasing the
buffers. This fix ensures we halt AXi and stop camif in sensor
not streaming case. Thus avoid page faults and a delay in
stopping camera.

Change-Id: I4159ac7b21d2a22a5684d7b4a614b0dfd8f06e46
Signed-off-by: Mohit Setia <msetia@codeaurora.org>
Signed-off-by: xdabbeb <xdabbeb@gmail.com>
msm: camera: Fix crash in ispif release

There is a BUG_ON in ispif release function for
ispif base address. but in case of just open and close
of ispif subdevice leads to ispif base NULL.

BUG_ON is removed and proper error is added in ispif
release function to fix the issue.

Change-Id: I0cc12d52aff9db0d9bb8844473f9bd6547270e27
CRs-Fixed: 642603
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: xdabbeb <xdabbeb@gmail.com>
msm: camera: Fix possible NULL pointer dereference.

The result of memory allocation in msm_isp_get_buf is not checked for
success before use. This can lead to NULL pointer dereference.

Change-Id: I83cb56bbcd5e7526bf57a6de1077a30f9a2b5349
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
Signed-off-by: xdabbeb <xdabbeb@gmail.com>
msm: camera: add turbo cpp clock case
msm: camera: OIS+ update

requires updated fw:

/system/media/bu24205_LGIT_rev16_1_2030_data1.bin
/system/media/bu24205_LGIT_rev16_1_2030_data1.bin
/system/media/bu24205_LGIT_rev16_1_2030_data1.bin

available here:

http://www.androidfilehost.com/?fid=23501681358542200
msm: cpp: Fix potential dereference of NULL pointer

manual apply of patch for VS980:
Change-Id: I8b36f3553292b41386e231f12867ff78f8e2379d
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>