msm: kgsl: Enable protected mode for A3XX

Enable protected register mode for A3XX with these commits from
msm-3.10:

msm: kgsl: Enable protected register mode for A3XX
msm: kgsl: Print the register that causes a protected mode error
msm: kgsl: Unprotect the VBIF performance counters

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.h
	drivers/gpu/msm/adreno_a3xx.c

Change-Id: Idfdc67e63422a4b55e59303c11ac8e376ab523e4
msm: kgsl: Protect SMMU registers from being written by the GPU

Put the SMMU register range in protected mode to shield them from
IB1/IB2 writes from userspace.

Change-Id: I499e66abfb81b45e43542d43db141f0f08461378
CRs-Fixed: 599971
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Mark the IOMMU setstate memory as read only

Mark the IOMMU setstate memory as read only in the pagetable.

Change-Id: Id427be448549ffcd737bbc39aec7ace5a0417b8e
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Protect CP_STATE_DEBUG_INDEX

Put CP_STATE_DEBUG_INDEX and CP_STATE_DEBUG_DATA under protection
to keep it from being written from an IB1. Doing so however opens
up a subtle "feature" in the microcode: memory read opcodes turn off
protected mode in the microcode to do the read and then turns it
back on regardless of the initial state. This is a problem if the
memory read happens while protected mode is turned off and then we
try to access a protected register which then complains and goes boom.

To account for this irregularity explicitly turn back off protected
mode in all the places where we know this will be a problem.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.c

Change-Id: I497122e5e848998d8ee76c7b3687c15515237baf
msm: display: Add pipe type selection in overlay request

Allow user to specify the type when requesting an overlay pipe.
If field is set the pipe type indication in the flags will be
ignored.
Change-Id: Iee51d24b96c7a2a987dc70a439342e6548dfc8fa
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
ASoC: DPCM: Remove redundant code introduced during framework update

There is redundant code introduced during ALSA DPCM update to add
support for compressed audio, which calls the soc_pcm_prepare()
twice. Update to remove the reduandant code.

Change-Id: I5b3b7bc005816141537434be47ec743c7c02b274
CRs-fixed: 672001
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
ASoC: compr: timestamp fix for non-gapless mode

Cache last known playback timestamp before resetting the
in use session in preparation for possible re-use of the
same session.

Change-Id: Id422f5654960818c159f9f07d5af3c497192bae2
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
qpnp-vibrator: just return the voltage, not all the pretty stuff

* makes handling it userspace much easier

Change-Id: I6173577a70c2bb89ab8ee4d5079be6457310a00c
hall_sensor: add a uevent switch for the cover

* We'll use this for the custom DotView case app
* Also make sure to set the initial value after registering the switch

Change-Id: Ib6668f6628b82949a57a25487bfcf261d35f5d07
lib/lzo: Rename lzo1x_decompress.c to lzo1x_decompress_safe.c

commit b6bec26cea948148a9420e7a0ac337f925de49e7 upstream.

Rename the source file to match the function name and thereby
also make room for a possible future even slightly faster
"non-safe" decompressor version.

Change-Id: I55a4033c42030d1d14e4367f4d40d39932f07097
Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/lzo: Update LZO compression to current upstream version

commit 8b975bd3f9089f8ee5d7bbfd798537b992bbc7e7 upstream.

This commit updates the kernel LZO code to the current upsteam version
which features a significant speed improvement - benchmarking the Calgary
and Silesia test corpora typically shows a doubled performance in
both compression and decompression on modern i386/x86_64/powerpc machines.

Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Conflicts:
	include/linux/lzo.h

Change-Id: I0d7bb3ce324e06d31525b75a6d2c1549385fd7ff
lzo: properly check for overruns

commit 206a81c18401c0cde6e579164f752c4b147324ce upstream.

The lzo decompressor can, if given some really crazy data, possibly
overrun some variable types.  Modify the checking logic to properly
detect overruns before they happen.

Change-Id: I913144cd93ae6520603ed736fc196c2086b7e8fe
Reported-by: "Don A. Bailey" <donb@securitymouse.com>
Tested-by: "Don A. Bailey" <donb@securitymouse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>