msm: vidc: Set CODECCONFIG for buffers with sps/pps

The client needs a way to know if a buffer contains the sps/pps.  Hence
mark the v4l2 buffer with V4L2_QCOM_BUF_FLAG_CODECCONFIG.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit aa653ab90045dc61b9abc5862b84e862b8506543)

Change-Id: I6843dc437011bab7bba8816161fc7fcb5d0293fe
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: wfd: Clear out stale flags for output buffers

The V4L2 framework doesn't appear to be clearing out vendor specific
flags between each QBUF call.  Hence clear out all flags that we set
explicitly in the driver.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit 28796cbd48750c86adec5788f160d1bc1a5d0093)

Change-Id: I5bf91b2659e93bd179dc3cd9b851142948c98b93
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: vidc: Adds VUI timing info support for AVC encoding.

Poor video quality is observed as VUI fps information is not present in
the encoded bit stream. Add support for VUI timing info in video driver
and an additional V4L2 control to set from user space.

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

Conflicts:

	drivers/media/video/msm/wfd/enc-subdev.c
	drivers/media/video/msm/wfd/enc-subdev.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.h
	include/linux/videodev2.h

Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
msm: rmt_storage: Add support for reboot notifier

For graceful shutdown or reboot scenarios, RMT storage
sync must be completed successfuly before device shutdown.
So register with reboot notifier to initiate the RMT
storage force sync.

CRs-Fixed: 419695
Change-Id: I6d8783d2ad2b7112fd6e84d3a9dcf033cc804a8c
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
msm: rmt_storage: Do not initiate force sync in recovery mode

In recovery mode, RMT storage daemon does not exists to complete
force sync operation. To complete force sync, RMT storage daemon
and RPC channels are required. So do not initiate force sync
when daemon had not opened RMT storage device node.

CRs-Fixed: 434098
Change-Id: I2522b70fa84568c271467ae4edaa13f3dd3a3fe4
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
msm: rmt_storage: Do not unregister client if there are pending requests

As seen in a corner case where the MODEM initiates an efs_sync from FS
task and waits for the response from APPS. At the same time, APPS reboot
was triggered which causes remoteFS to send force_sync request to
MODEM. Now APPS polls for sync_status from MODEM. Since an efs_sync is
ongoing, there is no more dirty-data to write and MODEM sends success
response to APPS. This causes remoteFS on APPS to proceed with
unregistering the client while the ongoing efs_sync is not completed,
causing MODEM to dog timeout on FS task.

To avoid such cases, remoteFS should wait to check for any ongoing
requests prior to unregistering.

CRs-Fixed: 435986
Change-Id: Ia12263d17099bfc928ed9ae93114050b986e69cc
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
msm: audio: qdsp5: Allow postprocessing only from acdb if present

Audio postprocessing(audio pp) features enabled via acdb (Audio calibration
database) driver gets disabled by audio postprocessing driver during
open.
Fix this by allowing legacy audio pp feature enable from postprocessing
driver only if acdb support is not available. Acdb driver maintains wrong
state due to improper update of stream id which is used to maintain
number of active sessions. Due to this postprocessing features are
enabled even before audpp task is enabled in adsp.

(cherry picked from commit 4fa5ab02c63ad219008701f90d589f40fbdf5045)

Change-Id: I2bc74295e23492a03d24ff5331f728878ebe5012
CRs-Fixed: 409488
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
v4l2: Adds support for codec config

Adds support for codec config flag to be passed
to driver. This flag indicates that the buffer
associated contains codec specific data.

Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
(cherry picked from commit f4bd6a3fbdb5d70b7000cdceb811557876bb7953)

Change-Id: Iba4229da63a3da72e1409f9812f3093a0036a2c2
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
qdsp5: audio: Allow audio preprocessing only from acdb driver

audio pp(preprocessing) features enabled via acdb (Audio calibration
database) driver gets disabled by audio pcm encoder driver if audio
record enable acknowledgement comes after applying pp parameter
via acdb.

Fix this by allowing audio pp enable from pcm driver only
if acdb support is not available.

(cherry picked from commit 62093d7d23fd0c130699f3bc0f455f5b48e54ab7)

(cherry picked from commit ec8c00fe5dfb4d1464979381b843a349bc9def54)

Change-Id: I5e95193b9c349ffeddcc52042427a5c8a9c0e421
CRs-Fixed: 436891
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
ASoC: msm: Register restart api for underrun issue

Update LPA platform driver to register restart callback.
The implementation of the callback is to issue a pending buffer
written by the application to restart the session when the dequeue
process is stopped due to underrun issue.

The callback is triggered from ALSA core when the framework
detects that the renderer stopped pulling data but the application
is still writing data. It runs in atomic context.

Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
(cherry picked from commit 0a85bb88426e1c6165dd0504bd3629ba6d5b2a31)

Change-Id: I673c0a556b441793b6cf4616aaaa9075029b1b58
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
thermal: pm8xxx-tm: Improve temp alarm logging and notification filtering

Modify the kernel log message which is output when the PMIC
temperature alarm triggers so that the current (or estimated)
PMIC die temperature is shown regardless of ADC type.

Also change the log message printing and userspace notification
logic so that they only happen when the PMIC temp alarm stage
differs from what was previously seen.  This will reduce the
number of messages seen while the temperature fluctuates around
one of the thresholds.

Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
(cherry picked from commit 41de5bcb095317966e3092cccc31c2e2cb0d7ef5)

Change-Id: Id058c03fcd556595b29ac896078e144830c5903f
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
thermal: pm8xxx-tm: Use delayed_work task for temp alarm status reading

Use a delayed_work task to wait at least 40 ms in order for the
temp alarm status value to be updated after the TEMP_STAT IRQ
goes high.  Also remove IRQ enable and disable calls in the ISR
since the work item can only be enqueued once before it is run.

Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
(cherry picked from commit 48395b74ec1e8ce488160f1a9ed4a93c0a8ed46c)

Change-Id: I3a7cc601dbd77d71881219d154270e291bd02f17
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
Merge "thermal: pm8xxx-tm: Improve temp alarm logging and notification filtering"
Merge "thermal: pm8xxx-tm: Use delayed_work task for temp alarm status reading"
msm: kgsl: Ensure correct GPU patch ID is set

Correct the patch ID that is returned by newer versions of
the GPU hardware.  This ensures the correct firmware is used
for the GPU.

Signed-off-by: Anshuman Dani <adani@codeaurora.org>
(cherry picked from commit 85f921f80e44bb8e6d30ab17b789178a608ea47d)

Change-Id: I757cf5759d75f9b3eb63437c1d41e43dd6ec824f
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
Merge "msm: vidc: Set CODECCONFIG for buffers with sps/pps"
Merge "msm: wfd: Clear out stale flags for output buffers"
Merge "msm: vidc: Adds VUI timing info support for AVC encoding."
Merge "v4l2: Adds support for codec config"
Merge "qdsp5: audio: Allow audio preprocessing only from acdb driver"