msm: camera: Add proper csid irq release

Whem CSID is released and reopened interrupts
need to be freed and requested to ensure
proper handling of CSID interrupt resource.

Change-Id: Ie74b509236c3b2192563ccbce77bea3ad2797b64
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
msm_fb: display: Fix color swap issues in MDP4 and Rotator drivers

Many of MDP input formats don't have correct unpack pattern, so image
displayed on screen is not in the actual format set. Also,Some rotator
output formats differ from input, these mappings used to be handled in
userspace, but to avoid issues this is now done in driver. For YCrCb planar
inputs chrominance order is dependent on rotator hardware version. Add
hardware check to swap Cb and Cr for 7x30 and 8x60 rotators.

CRs-fixed: 339114
CRs-fixed: 337040
Change-Id: I55691aa7c9d38e83e4fc63a162ffb23959ba30c1
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
(cherry picked from commit 012a8e79ebc3cd375f501a862e7b401b99c53054)
msm: Add support for 7x25AB MSM

7x25AB is new msm which can go upto 1GHz. Add required
cpu checks to add support for this new device.

Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/devices-msm7x27a.c
	arch/arm/mach-msm/pm2.c
	arch/arm/mach-msm/socinfo.c
	arch/arm/mach-msm/timer.c

(cherry picked from commit 05300603a73dc169de492cdd8fc2b2b24ab2a553)

Change-Id: Ic63a9a58db76de1cf9810ca0893839a7bf86a80d
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: cache_erp: Print hardware info on cache errors

Information such as current CPU voltage and frequency, PTE
fuses, MIDR, and PMIC voltage set point may be helpful when
debugging cache errors.

Change-Id: I94b6199eaba22db5e0411ee1d4af9f70024249c3
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: Bruce Levy <blevy@codeaurora.org>
ASOC: msm: Cache sample rate and channels when backend active.

While handling device switch between headset and stereo speaker
during Playback, the front end will be torn down
(after playing tone) while keeping the backend active.
During this time, hardware param will no longer be active.
Platform driver was using this invalid hardware parameters to
configure the matrix in the dsp with sample rate and channel.
Sometimes invalid sample rate being sent to DSP was causing
a crash in DSP. To overcome the issue, platform driver needs to
cache sample rate and channel information when backend
is active while front end is being torn down and setup
again. This cached information will be used to configure
the adm when front end is setup again.

CRs-fixed: 347115
Change-Id: If821fa828d4faa8897c78f07653e846a99611df1
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
vidc: upgrade video core clock rate based on time taken to decode a frame

Currently video clock rate is set based on the resolution
and fps of the given clip. But some clips have a high bit
rate for a given resolution which causes high decode time.
Changes were made to consider frame decode time and upgrade
the clock rate accordingly

CRs-fixed: 346580

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_utils.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_vidc.c
	drivers/video/msm/vidc/common/vcd/vcd.h
	drivers/video/msm/vidc/common/vcd/vcd_sub.c

Change-Id: Iec3a59b5ede6105a8784160a1068db32579fb20e
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
Merge "msm: cache_erp: Print hardware info on cache errors" into ics_chocolate
video: msm: wfd: Make logs clearer

The normal log printed after a successful stream_off is too scary.
Amended the log to be more accurate.

Change-Id: I0ee6cc2b15bf0cdfb77026ea5c6adece32a91ad7
CRs-Fixed: 358796
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit b3280be7a418e5a6923cacfae4079a9fc9bda376)
Merge "msm_fb: display: Fix color swap issues in MDP4 and Rotator drivers" into ics_chocolate
Merge "video: msm: wfd: Make logs clearer" into ics_chocolate
msm: camera: Adjust exposure setting

While changing between preview and snapshot modes, different
frame length line is configured. Coarse integration time may
become invalid for some frame length line values. Validate and
reconfigure coarse integration time while switching between
modes

CRs-fixed: 356564
Change-Id: I4b0f3b9525b11a3590610acb69434ad8a19f9552
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
base: genlock: allow synchronization with a single gralloc handle

In order to support synchronization in a process with a single
gralloc handle we require the ability to write lock a buffer
while it is already read locked by the same handle. This change
extends the concept of an exclusive write lock or recursive read
locks to a genlock handle (rather than the genlock lock).
Genlock cannot provide deadlock protection because the same
handle can be used simultaneously by a producer and consumer.
In practice an error will still be generated when the timeout
expires.

CRs-fixed: 356263

Signed-off-by: Jeff Boody <jboody@codeaurora.org>
(cherry picked from commit 6d9076fe46bcba71986a25cf357e71a4d83958c1)

Change-Id: I5d02591586023f4b622915522e2e038c16c9f2f2
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Revert "msm: acpuclock-8960: Enable Krait v1 workarounds on Krait v2"

This reverts commit 2c9fe8d57020f67044f740ffd854e0ab030f35a0.

Change-Id: Ic986f96809b1ac99f663cf58644b8fc12fae8d0a
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: acpuclock-8960: Confirm power-collapse before disabling CPU clocks

Hotplug may not always be configured to involve power-collapse of
the CPU. When it is not, the CPU must remain clocked. If an HFPLL
is still selected as the clock source of the removed CPU, do not
disable it as part of the CPU_DEAD hotplug notification unless
msm_pm_verify_cpu_pc() confirms that the CPU has been collapsed.

This code can be significantly simplified if support for Krait v1
processors is ever removed from the driver. Krait v2 and later
allow changing the CPU clock source from another CPU even after
the affected CPU is collapsed. This feature could be used to change
the collapsed CPU's source away from the HFPLLs to something that
is always on (ex. QSB).

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit 34c2d9628cb0fd471f43f92f04a6a9dc8df33129)

Conflicts:

	arch/arm/mach-msm/acpuclock-8960.c

Change-Id: I1ee2684359591000e6c756e497d14c8e2074916e
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Merge "msm: camera: Adjust exposure setting" into ics_chocolate
Merge "base: genlock: allow synchronization with a single gralloc handle" into ics_chocolate
msm_fb: hdmi: 3D configurations in HDMI

3D configurations using Generic0 packets need to be done
after enabling HDMI Control to take these configurations
into effect.

CRs-fixed: 349578
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit 514b1c651a33b7b73fb6f654d04355eac5ecb146)

Change-Id: Ib5dab4a8ce4e69690d1cd61640d05ce61fa68bfc
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
iommu: Fix flags passed to iommu map functions.

iommu map functions requires clients to specify whether
the mappings should be read only or read-write (write only
is not supported). Ensure clients specify the appropriate
flags when calling map functions.

Change-Id: If42b4b0367b4311aa36d3063979ef04af3a43fc6
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Remove extra iova free call

IOMMU virtual address (iova) is allocated locally in IOMMU mapping
functions per heap type. When an error happens the iova's are
freed in the same function as it was allocated. However, there
is an extra free call in the ion wrapper function that calls
these IOMMU mapping functions.

Remove the extra iova free call which can cause kernel panic.

Change-Id: Ic8978cf05202b29a42da7374e2c8c1e590b2d2a8
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Map everything into IOMMU with 64K pages.

Due to performance issues with 4K pages and the IOMMU we should use
64K pages. However, minimum allocation from ION is 4K so instead of
mapping on demand we need to map the full heap into the IOMMU when
the first request for mapping comes. Only unmap everything from the
IOMMU when the last buffer is freed.

CRs-fixed: 348606
Change-Id: Ic1793f5caaff2f69bf1fb7e8c8b3bd03378131b8
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>