msm: kgsl: Set sysfs max clock for devices with no power scale policy

When the sysfs entry for max clock is updated, set it immediately for the
devices that has no power scale policy. This prevents the device from
running with undesired clock.

(cherry picked from commit 6ca8011b4feb30c29e8e6fb5b3571fd2314879e0)

Change-Id: I3a4d689d90036edc243fa97562a79394ace94c2a
CRs-fixed: 408963
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
Signed-off-by: Nathan Chan <e334cn@gmail.com>
msm: kgsl: Turn off the CP_DEBUG dynamic clock

The CP dynamic clock seems to be glitchy when the CP clocks are turned
back on after a power event. Turn off said dynamic clock control at
init time. The impact of leaving the dynamic clock control off is
negligible since the CP clock is only on when the CP is actually in
use.

CRs-fixed: 402119
CRs-fixed: 409253
CRs-fixed: 413224
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit ed201aa291dfe13629d8c6cfa1d6e6f229b0c3c2)

Conflicts:

	drivers/gpu/msm/adreno_ringbuffer.c

Change-Id: I97d82ab71def370c16d4a5504087467aba82e4bb
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Nathan Chan <e334cn@gmail.com>
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>

Conflicts:

	drivers/gpu/msm/adreno_ringbuffer.c
Change-Id: I6d338d7dca680f57f2c39ed5a14381b261bf8bce

Signed-off-by: Vikram Orre <vorre@codeaurora.org>
Signed-off-by: Nathan Chan <e334cn@gmail.com>
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: Rajesh Kemisetti <rajeshk@codeaurora.org>

Conflicts:

	drivers/gpu/msm/adreno_ringbuffer.c
Change-Id: Ie411be46fa166864073d35c50085a8f2506d0eb8

Signed-off-by: Vikram Orre <vorre@codeaurora.org>
Signed-off-by: Nathan Chan <e334cn@gmail.com>