msm: audio : Enable LPA

audio: qdsp5v2: Switch audio drivers to ION
Change-Id: I5a757b606b3159b8fee77b66605343dd2385f3ec

Signed-off-by: Kalyani Polepeddy <kpolep@codeaurora.org>
msm_fb: display: Fix blend configuration for MDDI I/F

MDP4.0 blend operation registers are not double buffered and
take effect as soon as they are configured. Configuring these
registers at any place other than between dma and vsync produce
flickers as new blend values would get applied to previous
mixer configurations. Configure blend operation registers just
after dma is over, before vsync.

Change-Id: Id41d3836200ad181a77b24cf0270f36f53bc823a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "msm: audio : Enable LPA"
Merge "msm_fb: display: Fix blend configuration for MDDI I/F"
audio : Copyright correction.

Change-Id: Ibe0642dbb6397ce62d6784752393c0b057706163

Signed-off-by: Kalyani Polepeddy <kpolep@codeaurora.org>
Merge "audio : Copyright correction."
msm: kgsl: Remove the 32MB padding when checking for OOM

Allow the memory to allocate up to freeram bytes of memory in any
given GPU allocation.  Previously we had enforced a 32MB buffer
zone to try to keep the system alive, but that has turned out be
too much leeway and graphics applications were dying too soon.

(cherry picked from commit c69fc847aab7f9a66f76a031b6472b92697dc235)

Change-Id: I15f5d5b9e4808a94047a54867c69c23f8de912eb
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
Merge "msm: kgsl: Remove the 32MB padding when checking for OOM"
msm: kgsl: Define unique values for context flags

Use BIT to define all context related flags. This ensures
that these flags are unique and is easier to maintain. Also,
fix spelling of CTXT_FLAGS_BEING_DESTOYED to
CTXT_FLAGS_BEING_DESTROYED

Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit c9ec2661dc97c4fce3ee742daab141e63d87ec42)

Change-Id: Ie31dd1564f64115bf74fac2a15c875c82545ee5f
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Check for valid pointer before dereferencing

Check to make sure that there is a valid context pointer before
dereferencing it when adding commands to the ringbuffer.

Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
(cherry picked from commit edbe4037f3f01e9b21a5849380ebeaa306051fee)

Change-Id: I796faf478329dbcb483b8bdebb353675159423ca
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Add support to use timestamps from userspace for an issue

Use timestamp from userspace instead of incrementing context's last
issued timestamp. This allows userspace to defer submissions to KGSL.

Signed-off-by: Vijay Krishnamoorthy <adivarah@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
(cherry picked from commit e80c3463ed99d0e24f3fac837690e04a07723d33)

Change-Id: Ifa40e77e7407ae29c7ad892ab637490e16ea27a5
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Add a flag to context struct for bad timestamp waits

If the userspace calls the waittimestamp ioctl with an invalid
timestamp for a context then set a flag indicating that the ioctl
was called with an invalid ts. If the flag is set then do not
print error message about this ioctl being called with an invalid
timestamp. This is required to prevent the kernel log from
spamming with error messages and causing a watchdog.

CRs-fixed: 374586

Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
(cherry picked from commit 46ee1095077fb629d509944be508fe6da4d8e666)

Change-Id: If90d1d46635dfab09bbaa58e178a17741d13ff21
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Move the adreno WPTR poke logic to the hang detection

Sometimes a write to CP_WPTR fails to latch on A20x GPUs. In the past
we worked around this by writing to WPTR numerous times in the various
loops that waited for GPU activity.  Consolidate these disparate calls
by moving the poke into the hang detect function.  If the core is idle
but the RPTR != WPTR, then rewrite the WPTR and go back through the
loop again.

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

Change-Id: I8d39b488255d4475fc28813b48589d6f64a8a585
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Support user specified timeouts in adreno_waittimestamp

We have always allowed the user to specify a timeout in waittimestamp
but we never obeyed it.  Reorgaize the function to be less convoluted
and support a user specified timeout (or spin forever if 0 is passed).

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
(cherry picked from commit 92446a661cb633c188c946ae4a13d9ba628965b3)

Change-Id: Id44948f50cd448855b6b8eae07032d74952d4b5a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Issue conditional interrupts on internal submissions

Due to some mismatch in applying patches, one patch was overriding
the changes added  by commit bd5c9fcbf79d326817312138cf03298adf09df27.
This patch restores the changes.

Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
(cherry picked from commit d98d6562cb1da79adb998d8313741ccff37b0a20)

Change-Id: Id96c9e836d8c9b9870cd447160b3350f72b7d4e2
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Add CP_WAIT_FOR_IDLE packet before updating timestamp

HW workaround to resolve MMU pagefault caused by memory
freeing early before GPU completes it.

This is race condition where timestamp is getting updated
and the event handler runs before the GPU actually got done
with the timestamp, hence freeing the buffer early while GPU
still not completed with it.

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

Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
(cherry picked from commit 03c88f958a62e4bcea0640faef0766d6d10e787a)

Change-Id: Id4553255322a5e6eb729f1790fcc09d654da01e3
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
USB: msm72k_udc: set QMULT for ISO endpoints

Currently not setting QMULT for ISO endpoints. Set this
value to indicate to the USB controller the number
of transactions to be done in microframe.

Change-Id: I529e6624e592df54bafc9cef30f6b28eca050360
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
msm: kgsl: Add cache flush for A20x

Adding extra cache flush command to make sure that CP block
gets event from RB all the time to avoid race conditions because of
clock switches. this is to improve stability on 8x25 target.

Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
(cherry picked from commit f4537cf8dd50a78d78ab1664d623c9b6ecf3f240)

Conflicts:

	drivers/gpu/msm/adreno_ringbuffer.c

Change-Id: Ie08148847d33cd3e526e9bf23bf357a55b048e1b
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Log retired timestamps on device wake

Knowing the retired timestamp on wake-up is useful to debug hangs that
are caused due to clock instability. When we request for clock ON, the
clock may/may-not be turned ON, but we go ahead assuming it is ON. This
can be caught by printing the timestamp on wake. The timestamp we print,
can be compared against the timestamp in postmortem dump (assuming a
hang happens).

If there is a difference, we can say that GPU has run for sometime after
wake. So, we needn't suspect clocks.

If there is no difference, we can say that GPU has hung immediately after
wake. So, we can positively suspect the clocks.

Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
(cherry picked from commit d0348f1644a21ae73982f94c442bdf9f17584ebe)

Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
(cherry picked from commit 0184185f274762462738621282dc50815313339d)

Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
(cherry picked from commit 9e5af757c0902544113bba8ac5296d4a5f15aaf7)

Change-Id: I3c02b3a27486073a31b21bc0a49114d1a668ff1d
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "msm: kgsl: Define unique values for context flags"