msm: vidc: squashed codeaurora commits

msm: camera: isp: Use proportional UB slicing and 7 WM
The proportional slicing is used for determining Unified Buffer sizes
for each write master. This allows more efficiend use of UBs and
avoiding overflows.
Also this removes the need to set maximum number of write masters to
less than all available.

Change-Id: I774220268c96275b84d5fe265d68669b9fda4294
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>

msm: camera: Get max vfe clk rate
Add support to query max vfe clk rate. This max rate shall be used
by mm-qcamera-daemon user space driver to populate its capabilities
and to assign vfe resources based on request.

Change-Id: Ib65b73424d725e2d3e50e2ce2030d2f1b09e7514
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>

msm-camera: Adding lock and unlock methods for ISP subdev

Added lock mechanism to lock hardware update
when a sof is received, and ignore any other sof
which is received between the update process

Change-Id: If2013a566be0c45a48bf180aa6e16bd5f03cff3c
Signed-off-by: Megha Tak <mtak@codeaurora.org>

msm: isp: Fix stats mask upon VFE reset.
When streamoff is issued, a HARD reset is done for VFE. This
causes the stats register to be reset to zero. It needs to be
properly initialized with the last used mask upon init.

Change-Id: I5e2fcab0358e63272f40458862f4cf6a7d3bb4bc
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>

msm: camera: Fix long overflow on the pix clk
Using unsigned long to avoid overflow because
pix clk frequencies might cause long overflow.
Fix this by using unsigned long instead of long.

Change-Id: Iaf184de26d8ae689efa297096be9f01db84faded
Signed-off-by: Peter Liu <pingchie@codeaurora.org>

msm-camera: Avoid adding top up to calulated ab/ib for single stream.
Avoiding topup for ab/ib for single stream

Change-Id: Ie6fb6716ea1b30604d801936bea3da5a96d8a6fc
Signed-off-by: Chandan Gera <cgera@codeaurora.org>

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>

msm-camera: Enable proportional slicing of unified buffer
To enable proportional slicing

Change-Id: I8a21c8808085f527b9536edc51ccdcfa1de4e179
Signed-off-by: Mohit Setia <msetia@codeaurora.org>

camera: isp: create debug fs entry to log vfe overflows
Added entry in fs to log occurence of overflow from vfe

CRs-Fixed: 661343

Change-Id: Id398d11aaa84fca4ea63ea523c78c564c7eb6999
Signed-off-by: Katta Santhisindhu <kattas@codeaurora.org>

ARM: dts: msm: Add new property to specify OCMEM size
OCMEM is required by video hardware to deliver optimal
performance mostly at higher resolutions/fps. For targets
which have low specifications, OCMEM is not needed or not
needed as much as for higher targets. This change adds the
property to dtsi file to specify the size of OCMEM.

Change-Id: I65ae271bc73d302975957727a95461c7388727f6
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

msm: vidc: Add entry to scale buses for True 4k @ 24 fps
We weren't asking for enough bandwidth for 4k (3840x2160) @ 30 fps
sessions because we were missing an entry for True 4k @ 24 fps (which
requires less bandwith).  Now sessions of the former type are mapped to
the right ab-ib values.

Also get rid of some unused macros in msm_vidc_common.c

Change-Id: I40d3f8d079ffba586d96e8042b40bb0648ba7ae2
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>