msm: vidc: Check maximum width capability of Q6

Maximum width capability check is required to take
care of indefinite behavior when a clip having width
more than Q6 capability is played. Also, make the
capability check generic for Q6 and Venus.

CRs-fixed: 626642
Change-Id: Ic10be0ad4434019fea45e7a090b21ba5cf54d9a6
Signed-off-by: Ravi Kiran Vonteddu <rvontedd@codeaurora.org>
msm: vidc: fix a race condition in cluster construction

At start of video session, when the super cluster is
constructed, it refers to a global static variable.
If we have multiple instances running simultaneously,
there exists a race condition, causing the instance
to register wrong cluster. Later on when a control
gets set in encoder, if the control is not found in
the cluster, we hit a BUG_ON, crashing the device.

Change-Id: Ib4ee64d684d903bb4f22310a1b34619728405649
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: camera: Avoid memory corruption by changing order of enum

SET_POSITION is added above MOVE_FOCUS which makes kernel prone to
memory corruption as MOVE_FOCUS enum is changed. when CFG_POSITION
is not present and userspace calls MOVE_FOCUS kernel misinterprets
MOVE_FOCUS as SET_POSITION and thus copies user structure to wrong
structure and makes memory to corrupt.

Change-Id: I335ee28d9af6ec25b00262d71701e503a06e21c5
Signed-off-by: Lokesh Kumar Aakulu <lkumar@codeaurora.org>
ARM: dts: msm: add frequency to corner mappings for msm8226v2 and msm8926

Add frequency to corner mappings for turbo fuse corner frequencies in
1.2G and 1.4G speedbin tables which located at msm8226v2 and msm8926
clock-a7 device tree node.
1.2G/1.4G msm8226v2 and msm8926 parts can receive a dynamic quotient
adjustment to scale the CPR target quotient used for each corner, this
ensure these parts receive power saving when running at turbo
frequencies below the maximum possible turbo frequency.

CRs-Fixed: 597721
Change-Id: Ie5992361a79950614d9e2b04a6bfb373e26088a3
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Signed-off-by: Ke Liu <keliu@codeaurora.org>
qpnp-rtc: clear alarm register when rtc irq is disabled

The rtc alarm register should be cleared when the rtc irq is
disabled

Change-Id: I97a8bf989ff610093240a6b308a297702da6cb89
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
msm: mdss: add property to set from device tree the overlap BW fudge factor

Current calculations apply one fudge factor to the final bandwidth
regardless if this is a result from the overlap or prefill calculation.
With this change the final bandwidth can be tuned up to apply a different
fudge factor when the bandwidth depends on the overlap calculation.

CRs-Fixed: 635005
Change-Id: Iaa9718bda3264a47bf70a2facba0d23e4b2414f3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
msm: ultrasound: add support for aDSP Sub-System Restart

Add handling of RESET_EVENTS message from APR, which indicates
aDSP sub-system restart has begun.

Add a new internal state, USF_ADSP_RESTART_STATE, for this
scenario.

Change-Id: Ic1178f8fb4e659abc29947fac4079ba088e51447
Signed-off-by: Lior Barenboim <liorb@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>
arm: Allow remapping lowmem as 4K pages

Lowmem is currently mapped with sections (1MB/2MB) whenever
possible due to TLB performance boosts. Sections cannot easily
be changed at runtime however which makes implementing certain
features annoying. Add an option to map lowmem with 4K patches.
This is intended to be used as a debugging feature and should
NOT be used for performance testing.

Change-Id: I9612a99b8e05a022f5ba7e568f21307cf66b5667
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
mm: Mark free pages as read only

Drivers have a tendency to scribble on everything, including free
pages. Make life easier by marking free pages as read only when
on the buddy list and re-marking as read/write when allocating.

Change-Id: I978ed2921394919917307b9c99217fdc22f82c59
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
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>
msm: mdss: Acquire shared lock after getting frame on wfd

Currently there is a deadlock when wfd and rotation is done
simultaneously and trying to acquire the shared lock. To
prevent this, acquire shared lock after rotated frame is
ready for wfd.

Change-Id: I3865f02c345ddadd985ee35134454a789936a79a
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
ARM: dts: msm: Add NFC to msm8974pro-ab device tree

enable nfc on 8974-ab devices with pm8941.

Change-Id: I4165f52da25839dacf00232edde3ceac0d0adef1
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
ARM: dts: msm: revert the change for HSIC host controller

Due to this change might influence the WCN solution on APQ8074,
revert this change.

Change-Id: Id1feaf5af9e72823f7e0c27c6198c3ebe6eb3465
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
ARM: dts: msm: revert the change that disable WCN services

Due to WCN services will be disabled, and it might lead to problems
that WCN driver will not be able to load successfully on APQ8074,
revert this change.

Change-Id: Ia6baabc0885cf8f353ae9fa9f4dc9eeef2629b8c
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
ARM: dts: msm: revert the change settings of L19/L10

Due to this change might influence the WCN solution on APQ8074,
revert this change.

Change-Id: If08baa1faa576133ac62222967bed268de51a6bd
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
msm: ocmem: Call restore_sec_config() after every power collapse

As the QRIB is enabled, after every power collapse of ocmem, the
QRIB is reset to the maximum security state. Due to this the apps
processor cannot access the ocmem register space.

The restore_sec_config() scm call needs to be called before any
register is accessed after a power collapse to ensure that the
security configuration is restored. The clocks need to be turned
on before every call that is made into TZ to ensure that there
is no power collapse.

CRs-Fixed: 651324, 660089
Change-Id: Ieb6b635142057e219de29e811c93749f6500cec5
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: vidc: queue output-1 buffers to FW

While seeking, FW returns all the buffers to host.
In multi-stream usecase like downscaling, the o/p
buffers need to be re-queued back to FW.

Change-Id: I5ea8534c06b3e48dadd4d73ab4432a13687a99c1
CRs-Fixed: 631827
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
qseecom: Check the return value of "ion_phys"

Check for return value of "ion_phys" and handle
the error cases appropriately.

Change-Id: Ib4f24af24de2b2553ed91479f46b2f79e0be0446
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
qseecom: Replace kzalloc with ion_alloc

Allocate memory to common lib through kzalloc issues no page error due to
higher order memory requests. So allocate the memory from the heap specially
dedicated to QSEECOM.

Change-Id: Ice4a609d6791ce5adc84b9882231def31674f461
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>