Revert "Revert "ion: ion mini upgrade""

This reverts commit 9b622c0bcc2cf6a105dfcf72f32c3cf146294e03.
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: Reduce the number of RBBM register reads.

Check if WPTR and RPTR are equal before checking the
RBBM register status. This will decrease the excessive
register reads.

Change-Id: I108764138315670a83a1ab423ff29310c98f5a81
Signed-off-by: Vikram Orre <vorre@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.

Change-Id: Iedf49977adbb0e61a9b71bbe23acc81f2a75162d
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
msm: kgsl: Restore the value of RB_BC_CONTROL on context
 switch

On 8x25Q, when GPU footswitch is turned off during TCXO shutdown, the
RB_BC_CONTROL register value is lost which causes GPU hang after coming
out of TCXO shutdown. Now the value of RB_BC_CONTROL is preserved properly
during context save and restore.

Change-Id: I20fe3cb2565e306a589765460339990ec149fd01
CRs-fixed: 441134
Signed-off-by: Vinay Roy <vroy@codeaurora.org>
msm: kgsl: Calculate busy interval considering GPU freq as float

GPU freq could be non-integral value and treating it as an integer
to calculate GPU busy insterval leads to higher busy interval
and more often we see negative idle stats. This change caculates
busy interval by treating gpu freq to the correct precision.

Change-Id: Ic54130803d7a0436b4ba31b09915eb7165d16590
CRs-fixed: 454972
Signed-off-by: Vinay Roy <vroy@codeaurora.org>