vidc: Caching support for video encoder/decoder.

Added support for cache flushing when the ion
buffers are allocated in cached mode for encoder
and decoder.

Change-Id: I177bf20d0cf6dc33d74b487eddb674789749c279
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
msm_dcvs: Update interface to get updated timer on IDLE_EXIT

TZ DCVS algorithm is updated to give a new timer value on idle_exit
in order to catch smaller CPU bursts correctly. Also protect
against a timer race condition between IDLE_EXIT and CLOCK_FREQ_CHANGE
events.

(cherrypicked from commit id 76af983bbd08458eb74d7752c668c561bce2fd22)
Change-Id: I1ab414e9cd582c0eb8f86f0d87fa132d709da100
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
msm: camera: add fields to msm_stats_buf for cache operations.

Add a couple of fields to the msm_stats_buf structure
for cache coherence support on stats buffers from
user-space.

(cherry picked from commit 073e0cab00d6cf60279de167d8063c5e5f4b5715)

Change-Id: I4358bb9f8fff444d9879e351af29e47513d114ed
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
msm: v4l2: use new IOMMU mapping API.

The ion_phys API is being deprecated. Instead there
is a new set of API that does the same thing as ion_phys
if the system has no IOMMU enabled. Otherwise, it
returns an IOMMU device virtual address.

(cherry picked from commit 459429648e0dd7c9b2bbaffc63a4086614e4109e)

Change-Id: Id5a10d98dc95a0c48d33bbf7a1ef1a913fbbb7cc
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
msm: camera: handle mediaserver crash elegantly.

This change stops the VFE first, before unmapping the buffers
registered in the kernel in the scenario of a mediaserver
crash.

(cherry picked from commit f3ae3699dd3140c857835901b68d293fb0629f85)

Change-Id: I38a4e62b3adf12582b07084056975f74db56086b
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
vidc: Move metadata shared input mem to firmware heap.

Metadata shared input is used to communicate between
the video code and video driver, hence make this buffer
as uncached and allocate it from firmware heap.

(cherry picked from commit c6802266a867fbd1e8fd03ca87b28ea8c0561f3e)

Change-Id: Ib7e5383c530c71f27f313698ffd61cf0d0cafe2c
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
msm: iommu: Enable the IOMMU driver for 8960

Enable the IOMMU driver in the 8960 defconfigs.

(cherry picked from commit a346241a9b9cc6ef752e6cdfa0cd7f36e4016ec4)

Change-Id: I8e51dc4e109df31bb9b7c900f7920d3474943d03
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
gpu: ion: Add support for IOMMU in CP heap

ION clients allocating from a content protection
heap (cp heap) must be able to map the memory to
an IOMMU when IOMMU are being used.

Add callbacks to CP heap to support IOMMU mapping.

(cherry picked from commit 1c94f7be2d3fcd48978bd5276532beec184f5d74)

Change-Id: I81e726e98b8cc4b12fe8f4734c0da18a15968aee
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Do not allow cached IOMMU mappings.

Cached IOMMU mapping is not supported.

Add check for clients trying to map buffers
into IOMMU as cached and return error.

(cherry picked from commit 79e9ffa55afdf664990b2765de297f3d95e59612)

Change-Id: I92bde98a816afb2c3b231e91902b4443774c2b85
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: Disable use of the IOMMU

Originally, if CONFIG_MSM_IOMMU was enabled, clients were
expected to use the iommu for memory mapping. Currently,
it is necessary for CONFIG_MSM_IOMMU to be enabled without
having all clients ready to use the iommu. Kill support for
APIs to use the IOMMU and attaching to all domains until
clients are ready to actually use them.

(cherry picked from commit d561f347895358028851dfa52397899048747a6d)

Change-Id: Ic7189c713722bb00cb556a3a1b01df41372a321e
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
gpu: ion: Lower IOMMU heap priority

Video requires the IOMMU heap to be at a lower
priority so that video can try to allocate from
its MM carveout heap first and then if video needs
more memory and the MM heap is exhausted it will
automatically fall back on IOMMU heap.

Change the priority of the IOMMU heap so video
can fall back on IOMMU heap.

(cherry picked from commit 9e123f98ea133518adb5b1f4a53ccaa1c07cb568)

Change-Id: I696c292b0ad9d6b140247f32e2e22d72c5fd0000
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit 1c94ada9be7922d8770c92cd79217ebf005fbf27)
qseecom: Fix error log and add error checks

Add error checks for response returned for all scm_call()
Fix qsapps "name" logged during loading app

CRs-Fixed: 351945
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
(cherry picked from commit bb0bca134ba94aaf592542bdccd941ebf2a1b8ba)

Change-Id: I164995b14e435482d9f655c18287466f3313b214
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
qseecom: Add support for loading elf images

Add following IOCTLs
 - QSEECOM_IOCTL_LOAD_EXTERNAL_ELF_REQ
   sends QSEE command to load and elf image
 - QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ
   sends command to QSEE to unload an elf image

CRs-Fixed: 351945
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
(cherry picked from commit 5ab9d77b3a1168e79b77d5146f8ab9644ee7d502)

Change-Id: Id44c32a8e66af18b6df78fdac0afe0803d76f5bd
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: bam_dmux: Disable BAM DMUX upon modem timeout

If the modem times out, disable BAM DMUX regardless of
the subsystem restart configuration.

If subsystem restart is disabled, log an extra message
since BAM DMUX will not be able to recover.

Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit 90285e234912d8581a6dac40e8e5343bd35d5a8a)

Change-Id: Ic02329b4fb583740832c75f4534c2cfe0582185e
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
USB: u_serial: Don't allow UDC to append and send a zero length packet

Two zero length packets are sent by the target in the current scenario:
1. From the device controller driver (as the req->zero flag is set if
   it is the last packet).
2. From the u_serial driver when the length of the packet is zero while
   checking for the next packet in the list.

Hence removing the code for the case1, as the zero length packet is
sent via u_serial function driver.

CRs-Fixed: 350179
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
(cherry picked from commit 4098529688bfd441a5047a4017c222944a83b645)

Change-Id: Ibfcd4b21bb2eb40b1d2eae483ac104127ed3d930
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Merge "msm: bam_dmux: Disable BAM DMUX upon modem timeout" into ics_chocolate
Merge changes Id44c32a8,I164995b1 into ics_chocolate

* changes:
  qseecom: Add support for loading elf images
  qseecom: Fix error log and add error checks
Revert "ASoc: msm: Fix error checking"

This reverts commit 6b9e095c16edb9fccafa48a05c07d9250054fb55.

Change-Id: Ic51e78ffce9d78be970e9417856c292550c7949e
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Bluetooth: Fix Low energy Proximity path loss threshold alert

Fix sending alert from the proximity client when the
received RSSI of the remote device equals the threshold
set on the client.

CRs-fixed: 344936
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
(cherry picked from commit 5d332a48c7c4d23278106a8a252f2051aa935870)

Change-Id: I84295b6c41eafe34b07db8a4a8c47eef6baa887f
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: cpufreq: Release cpumask_var_t on all cases

Release cpufreq 'mask' variable when it fails to qualify for changing
cpu frequency.

CRs-fixed: 348827
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
(cherry picked from commit fdf788b79589280622f1fb7f761194234442d2ef)

Change-Id: I5d4c03c38d957ba84cac1cc140e509692b8fb1cc
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>