vidc: move platform resource parsing out of v4l2

Keep v4l2 code cleaner by moving parsing logic to separate file.

Change-Id: I65999400ad4391caa396a2bdcc8494db1727bed9
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Eric Ho <yinlokh@codeaurora.org>
msm: vidc: Add support for Constrained High Profile

This commit allows encoder clients to choose Constrained High
profile when encoding.

Change-Id: I0860367022bcdfab7d1a410b985f1a95fc6361cc
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: add check for supported video session

Check if video session load can be handled by f/w
after session_init_done state and before moving to
load_resources state. This will ensure fallback of
unsupported video session to software codec library.

Change-Id: Ib8856a519a23c8bcab951c0e014dc5f454859efe
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Fix for fuzz issues in firmware

Firmware is reporting session error for etb/ftb
due to incorrect packet sizes being sent. Fix this
by modifying the size of zero lenth array elements
in etb/ftb packets to one.

Change-Id: I2127290b9bd7f62e524d19f2fee42691d26e6d0a
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
ASoC: msm: Avoid multiple release of ocmem memory

Add check to avoid multiple release of same OCMEM buffer,
by checking if the buffer is already freed before. This
is to avoid any system crash due to multiple release of
same buffer.

Change-Id: I527b1e9d502538818d2a15a614b693611c3a6cd9
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
msm: ocmem: Handle shrinking of memory after passive evictions

During a passive eviction, the information of the client
which triggered the eviction is not stored in the request
structure of the evicted client. This is needed during the
shrink operation of the evicted client.

Store the eviction data of the request being evicted in the
request structure to handle the shrink operation.

Change-Id: Ie03573d0c488801a6e436babccf6b84bd777fb3e
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
gpu: ion: Secure buffers at allocation time

Currently, buffers allocated as secure must be explicitly secured
with a lock call. Considering all buffers from secured heaps are now
always secured and will never be mapped in the non-secure world,
this extra lock call is redundant. Lock the buffer at allocation
time instead of requiring clients to do so explicitly. Reference
counting will ensure correctness until clients remove the lock/unlock
calls.

Change-Id: I1593b6ec651b13b22171997606c915b8f51a05fd
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
gpu: ion: Don't flush secure buffers

Secure buffers have very tight restrictions about mapping into
the non secure world. The buffers are always allocated as uncached
such that there should never be a reason to have a CPU side
non-secure mapping once the buffer is allocated. Some clients may
share the same code path for secure and non-secure transactions.
Unfortunately these clients either cannot or will not distiguish
between secure and non-secure buffers, meaning they will unconditionally
try to flush the buffers. This may lead to bad things. Until clients
manage to properly distinguish between secure and non-secure buffers,
add a check in the cache flushing code to not flush if the buffer is
secure.

Change-Id: Idb0d791a8b74367e0ce0b533f980caedc23044b3
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: vidc: Handle SSR event in q6 hfi

APR send SSR events through callback and these
events have to handled properly in Q6 HFI. This
change translates SSR events to SYS_ERROR HFI event.

Change-Id: I82fe850d2df4ab1721755507c6d74d7b32a09b90
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Sachin Shah <sachins@codeaurora.org>
msm: vidc: add check for bus scaling

Ensure the bus vector index calculated as
per macroblock load falls within the range
specified in the device dtsi file.

Change-Id: If972583932f26b76f10bf2e184f8050552b857cb
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
ASoC: msm: handle write done events in pause state

If a write done event is received when the compress driver
is in paused state, treat it as an underrun.

Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: Eric Laurent <elaurent@google.com>
ASoC: msm: Fix potential spin lock recursion in compress driver

1. compr_event_handler() in this driver is called from interrupt context. This
   function uses spin_lock_irq() and spin_unlock_irq().
2. Calling spin_unlock_irq() from interrupt handler will enable the interrupts
   and could result another interrupt while we are still in an interrupt
   handler.

Replace spin_lock_irq() with spin_lock() and spind_unlock_irq() with
spin_unlock() in the compr_event_handler() function.

Replace spin_lock_irq() with spin_lock_irqsave() and spin_unlock_irq() with
spin_unlock_irqrestore() in rest of file.

Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Revert ""msm: vidc: Use aligned width and height while calculating load""

- Total core load is exceeding due to considering aligned dimensions.
- Session load should be calculated from  actual height & width.

This reverts commit 5004a84a2c1b9a04cfdefb83d9b818f6c299d8b7.

Change-Id: I10e3bf543caf972287a77045b0b2adc746ac7352
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
CRs-Fixed: 491664

Conflicts:

	drivers/media/platform/msm/vidc/msm_vidc_common.c

Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
msm: vidc: disable h/w load calculation for thumbnail

Thumbnail decode load should not be considered while
calculating the overall h/w load. This is needed
especially on devices with limited h/w capability.
Without this change, we can see thumbnail decode
failing if two thumbnail sessions start in parallel
and h/w capability is exceeded.

CRs-fixed: 504248
Change-Id: Icdceddc5c15cd5beac391fe15dac9d60e5eb35bb
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
ASoc: qdsp6: Add support for post processing on low latency path

Current implementation does not send audio calibration data to
DSP if the playback goes throug low latency path. This results
poor quality audio on Speaker if it needs tuning.
Update ADM and RTAC drivers to send audio calibration data
to DSP and update properly in the QACT tool.

Bug: 11077919

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
arm/dt: msm8974: Double the "ab" values for VIDC DDR bandwidth request

As per the recommendation by performance team, update the
"ab" values for DDR BW requests. This change fixes the
display under-runs seen during video playback.

Change-Id: I521cfa50d3ecf2dc3b57ca0207ba3ccd2b7b28f2
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>