Revert "msm: kgsl: Hold the pm_qos vote at all times when
 ACTIVE"

This reverts commit 66ad4c0ed14ecbe0fbbd24b5bdcd5ca984ea7386.

Change-Id: I1c70a8d5a76544abe89484576917f2dd8142342a
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>
Revert "msm: kgsl: Update pagetable on context destruction
 for A20x"

This reverts commit f0d1c9b79e05972816b92bd43b29e98f764826ea.

Reverting this change since it corrupts Bin Base Offset between
two draws of a Binning pass, resulting in GPU hang.

Change-Id: I4a3fdc9d3180b96ba617753855c7d789f2c0f5e3
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>