gpu: ion: Add dummy msm_ion header file

The msm specific parts of ion.h are being moved into a new header
file. For now, add a dummy header file to get clients transitioned
over.

Change-Id: Iac039678e1c3f15d87e67aa667f7e9883ca16669
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

Conflicts:

	include/linux/Kbuild
sync: driver commits

- Revert "base: sync: signal a sync pt when not adding to the
active_list"
- sync: Fix error paths
- sync: add tracepoint support
- sync: refactor sync debug printing
- sync: use proper barriers when waiting indefinitely
- sync: update new fence status with sync_fence_signal_pt
- sync: dump sync state of fence errors
- sync: protect unlocked access to fence status
- base: sync: signal a sync pt when not adding to the active_list
- sync: improve timeout dumps
- sync: use correct signed type when handling SYNC_IOC_WAIT
- sync: dump sync state to console on timeout
- sync: clean up compiler warnings
- sync: fix erase-o in sync_fence_wait
- sync: change wait timeout to mirror poll semantics
- sync: add reference counting to timelines
- sync: add internal refcounting to fences
- sync: optimize fence merges
- sync: reorder sync_fence_release
- sync: export sync API symbols
- sync: allow async waits to be canceled

Change-Id: Id65ecdd395782d487773bdf7baa3ed681a72b729
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
Adding support for trace events for sync point driver

Change-Id: Icdbe176f1c651e6a0805ef63b9b7f143ab06a350
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
video: msm: wfd: Add turbo mode support

Add support for userspace to push the video core clock to maximum
supported by hardware.

Change-Id: I47295d0fc67d32302312600a90359be23e3fc2c2
CRs-Fixed: 361108
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
video: msm: Add user-defined backlight scaling

Add method for scaling backlight based off of a user provided ratio and
minimum level for the scaling to be applied.

Change-Id: I494bdd4545e9e02602faa01bed820120cd96298f
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit f0fd8e7323ea0f60539918528a4cfa1edb39b828)
diag: Fix problem with stopping of logging data

On-Device Logging at very high logging rates can cause
a race condition where the buffers reading in data from
the smd channel are filled with data and are not having
their data logged to userspace.  Detect this condition
and restart the logging process.

CRs-Fixed: 382128
Change-Id: I3bb4cfae1bd72d2575c32e800973fac558beae7c
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
(cherry picked from commit 743a11e7821c5118e1dc0eb035b1efb94fccb994)
mmc: msm_sdcc: Print data line status in case of errors

The MCI_TEST_INPUT register of the SDC controller depicts the status
of the data lines (if pulled down or not). Print its state in cases of
errors to isolate any device specific issues.

CRs-fixed: 392889
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
(cherry picked from commit 74bff7cf272ebebc04de8e99a216c32519df52fa)

Change-Id: I7bc93958025d62f05922d53ad4ad08c19df9dab5
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: adsp: qdsp5: Allow MOD_READY event in ENABLING state

JPEGTASK is receiving MOD_READY event after it is disabled
which is not expected. When JPEGTASK enable fails with
ETIMEDOUT error, this module is disabled immediately.
But MOD_READY event for this module is sent by RPC to
Apps ADSP Driver even after it is disabled. Ignore this
event incase module state is not in ENABLING state.

CRs-fixed: 395420
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
(cherry picked from commit d8aa19223074d2470a9f4b12a472ea74a82138c0)

Change-Id: I7bd851403bd6422692da756d60427321ca3794c6
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: vidc: suppress non-fatal error messages.

These messages are non-fatal and appear frequently
during video session. Hence suppressing them.

CRs-fixed: 389408
Signed-off-by: Arun Menon <menon@codeaurora.org>
(cherry picked from commit 24631e349a3f306cc3b06fb411d5fb1f7ac8f0ae)

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_utils.c

Change-Id: Ifb874912ac79c863ed8fc531272d3822d8aebebe
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: kgsl: Do bounds checking on user supplied GPU addresses

Add bounds checking to kgsl_sharedmem_find_region to ensure that GPU
addresses supplied by the user via KGSL_IOCTL_SHAREMEM_FREE and
KGSL_IOCTL_CFF_SYNCMEM are within a valid range for the MMU scheme of
choice.

CRs-fixed: 380296
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit e22e21d93260cee3aff0dff7247635d9624c8aa5)

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit 64faf92b2159ae2505ba35f88df15d9c287d2fe6)

Conflicts:

	drivers/gpu/msm/kgsl_mmu.h

Change-Id: I043038d96a4f6f48e4f3391a9ebbccff1afce334
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm:vidc: add support for pause in eos state

This commit will add support for pause command in
eos state along with run state of the video driver.

(cherry picked from commit da817ebe8a4dea682b2cc9beaa582e0f0f0f0112)

Change-Id: Ia75c7ee43fb13cab5898ded69459469ddec4be54
CRs-fixed: 387562
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: video: wfd: Add error handling while wfd open.

- Error handling is not performed when memory allocation failed.
- Reset wfd driver status to false.

Change-Id: Ied77ca1a607c007f5b182e81915f92c9ebc60fee
CRs-fixed: 383712
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
vidc: Handle EOS with Codec config buffer.

Change will handle codec config buffer with EOS.
Video driver will make sure that the codec config buffer with
EOS will be requeued in case of reconfig and non-reconfig paths.

(cherry picked from commit 43b203869814fe5f0ddcb265a8f859aebdaa652f)

Change-Id: I424df5628aaededcbd65c36d369410909e46c515
CRs-fixed: 399347
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: usb: Tune USB PHY squelch threshold settings

Currently, USB PHY squelch threshold settings(SQRXTUNE) is having
the power on reset value(0x3), due to which enumeration failures
are observed, if amplitude of the USB signal received is less than
threshold. Fix this issue by updating the SQRXTUNE value using
OVERRIDE B register from 3 to 6.

Change-Id: Ib04165bb295c65b6c068a17bba6392611cc1a6d6
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
msm: vidc: Reset data corrupt flag for non-H264 decoder

Core does not set display correctness flag on decoder
output buffers for non H264 video codec. With this change,
we reset the data corrupt flag for non-H264 codec.

CRs-fixed: 397599
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
(cherry picked from commit fde67e239d8ac3a1e983b7d82d0c37af47464138)

Change-Id: I8247e9dff7a66b9538b102df158dfe1bca0d937c
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Bluetooth: Add sockopts for LE Connection Params

Various LE profiles require very specific LE parameters for
both establishing and maintaining LE connections to remote
peripherals. These LE only parameters are encapsulated into
a single sockopts structure, and may be passed from user space.

CRs-fixed: 335971 387146
Signed-off-by: Brian Gix <bgix@codeaurora.org>
(cherry picked from commit a94b6122f4f7a44dc1d6e6a5dfd2533cad7a3abf)

Change-Id: Iaa2e6a8b371a5463d335d5ea30fd96493a1688b6
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Bluetooth: Fix for supervision timeout must be 6X connection interval

Added a new function to verify whether the LE Connection Update
parameters are valid instaed of verifying all the LE Connection
parameters since only update parameters are set in the Connection
Update Request.

CRs-Fixed: 387146
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
(cherry picked from commit 95319af0612d58788279748f586cc57221c3443e)

Change-Id: I3b803235150fc2b4508977d766b0f309a74de0c0
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: audio: qdsp6v2: Fix WMV stream resume issue

- Suspend phone while WMV clip playback is going on.
Resume it, clip fails to play.
- At resume of WMV clip, Pause is issued initially
to driver. But there is a bug in pause API which is
not returning appropriate result. OMX component when
starts playback, it now issues resume to driver and
driver is setting DSP to run state even before ENC_DEC
params are set.
- Fix pause code to return error value if driver is not
enabled. This will avoid driver in sending CMD_RUN
before ENC_DEC command.

CRs-Fixed: 394756
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
(cherry picked from commit 92ad28cd56803b451ae4bde72bfd20021c769649)

Change-Id: I8435fa5fe21f8d01802fbef70e0994584382b460
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: vidc: Enable turbo mode based on client request.

- video core is bumped up to turbo mode, if more performance
  level required from multiple clients.

- Enable turbo mode atleast one of client set turbo mode.

Change-Id: I579715b85e857ad194810c06a361448b775e470e
CRs-Fixed: 385454
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
msm: kgsl: Detect and avoid malformed ioctl codes

Because we were using _IO_NR, one could construct a malformed ioctl
code that would avoid allocating memory yet go to a function that
expected that memory. Still use _IO_NR to index the array of ioctls,
but check that the full values match before jumping to the helper
function.

CRs-fixed: 385592
Change-Id: Ic0dedbaded469035bd0a2bb0f20fecb2a3045ca5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit 1e76f61bb001b93795a227f8f808104b6c10b048)