qdsp6v2: Squash fixes

msm: qdsp6v2: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: Id5921e369055d846b990380be6355ad464518a10
CRs-Fixed: 554301
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>

msm: audio: qdsp6v2: Fix for FBD TS inversion during AAC decoding

 -EOF flag of input buffer is not set properly.
 -set the flag of input buffer properly when meta info is enabled

Change-Id: I354fc16ad5bc8a9bcccdf150d1f138ce9744eeb0
CRs-Fixed: 431781
Signed-off-by: Preetam Singh Ranawat <apranawat@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_utils_aio.c

msm: audio: qdsp6v2: Fix seek issue in tunnel player

- Seeking to 0 position during tunnel playback, music stream
  jumps to incorrect postion.
- Initial buffer after seek to new position is corrupted as
  flush ioctl is not synchronous. Ioctl FLUSH is posting
  CMD_FLUSH to DSP, but WRITE_DONE to user space are posted
  even before it receives FLUSH ack from DSP.
- Fix is to wait for FLUSH ack from DSP, then post the
  WRITE_DONE events to user space, which will ensure FLUSH
  is completely handled.

CRs-Fixed: 425420
Change-Id: Ieca3353dba3a67af39a2967659034f073acf5277
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_utils_aio.c

ASoC: msm: qdsp6v2: Ignore unexpected events from dsp

If dsp responds with an unexpected event, audio driver
should ignore the response and continue. Change removes
the BUG_ON and handles error gracefully.

Change-Id: Ie7bbf1ea9b47630dae38e89887e53883f8f1dc12
CRs-fixed: 512784
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>

msm: audio: Fix for WMA seek issue

- Seeking during WMA playback results in no audio.
- Input and output port flush were not called during
  seek which resulted in no WRTE_DONE ack from DSP to
  AIO driver.
- Fix is to add input and output port flush during seek.

Change-Id: I61b7f72211e64bf437566bf48cc009631e918900
CRs-fixed: 453026
Signed-off-by: Amal Paul <amal@codeaurora.org>

msm: audio: Don't add memory map failed handle to memory map list

During cases where memory map is failed, before "region"
data structure is freed, we need to delete the region list
entry which is added to the begining of the list. Otherwise
this memory will be accessed in ion_remove when iterating
through the list to delete the nodes, which will lead to
device crash.

Change-Id: I002aff8d7d14dfc714adc55c3f21c25dc9f75797
CRs-fixed: 443453
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>

arm: msm: qdsp6v2: update to finite loop

The reason why the original code requires infinite loop
cannot be accounted for. However, it seems reasonable to
wait for 10 minutes.

Change-Id: I057f7ac8a83585abbc4ccd63a721df82f71ea045
Signed-off-by: Patrick Lai <plai@codeaurora.org>

msm: audio: qdsp6v2: Set end of frame flag to avoid aac multiseek issue

- During aac playback, multiple seek lead to target freeze.
- DSP starts decoding when internal buffer size maximum is
  reached, hence, if there are corrupted frames in that buffer,
  the entire set will not be decoded. This results in target freeze.
- Fix is to set the end of frame flag in the buffers that
  are sent to DSP for decoding.

Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
Change-Id: I0135c64e0ebf50bddddd08d73399f95db6409fbd

msm: qdsp6v2: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: I20e56ee32d3b9d1eecc4fa7761ff164a210fbbde
CRs-Fixed: 561611
CRs-Fixed: 561615
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/pcm_in.c

msm: audio: qdsp6v2: memeset msm_audio_stats to zero

memeset msm_audio_stats to zero before copying to user space.

Change-Id: I5f47bf85e36d46f726dddae68962a3d1cd06213b
CRs-fixed: 549307
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>

msm: audio: qdsp6v2: Zero the cfg stack var

Write zeroes into the stack variable cfg to ensure
no previously written stack data is sent to
user-space.

Change-Id: Ie571949e3613c9e5a916b23e1dc19605496d9dbf
CRs-Fixed: 551574
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/aac_in.c

msm: audio: qdsp6v2: Change acdb_mmap size variable to unsigned

The acdb_mmap fuction does a size calculation but
stores the result in an int which makes negitive
numbers possible. Changing the variable to unsigned
ensures that the size used is never out of bounds.

Change-Id: Iffd9c1440d2f28b703a77993fdbb3ccd18f30694
CRs-fixed: 548145
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>

msm: audio: qdsp6v2: Add size safety check to ACDB driver

Check that the size sent by userspace is not larger
then the internal amount allowed. This protects
against overflowing the stack due to an invalid size.

Change-Id: I8230fdb00a7b57d398929e8ab0eb6587476f3db1
CRs-fixed: 470222
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>

msm: audio: qdsp6v2: Add NULL checking for input parameters

Add checking for NULL. Two parameters shouldn't be NULL.

Change-Id: Ied9e9e6238f6498305844bf3a08370c7cf751fc7
Signed-off-by: Fred Oh <fred@codeaurora.org>

msm: audio: qdsp6v2: Enable soft volume/soft pause command

Add support for soft volume command and enable it to avoid
noise during volume change sequence.
Add support for soft pause command and enable it to avoid
noise during pause/resume change sequence.

CRs-Fixed: 425431
Change-Id: Ie10c73a0f35a191168f4306b1122102ed0f75ad0
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_utils_aio.c
Revert "pyramid: display: Update bus bandwidth from CM"

This reverts commit fc1835af6551e0ccbe2b9afb520f0c40dfa86e5a.
video: msm: Increase MDP clock multiplier

Raise the multiplier from 1.15 to 2 to fix the underrun.

taken from: http://review.cyanogenmod.org/#/c/32315/1
pyramid: display: Add back width & height parameters
msm_dss_io_8x60: Reduce delay when enabling mipi clk

This delay is too long, causing a long delay when waking the phone from sleep. mipi clk on msm8x60 is only very slightly lagging when enabling, so a delay of 1 is all that's really needed.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
kgsl: Fix GPU freq being set to the max by default (320MHz)

Credit to SebastianFM: https://github.com/SebastianFM/SebastianFM-kernel/commit/831882790c5f09a4c9cf008322777f9aaa65d45b#diff-a20c5be16a95b59d8023e63f9ffa6523R987
pyramid: display: Remove esc_byte_ratio

Signed-off-by: Sultanxda <sultanxda@gmail.com>
pyramid: display: Remove vsync params
Add weight and height parameters from HTC 8960