msm: board: Set the correct 2D core clock frequency in 7x30

The 2D clock was synchronously tied to the AXI bus in frequency on
the 7x30 platform. So its was never set before. Now, with the
updated clock APIs, this made the clock to be enabled before it is
prepared. This change ensures the clock is prepared before it is
enabled.

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

Change-Id: Ibdf36c6b8202fb52425110d94de867b46f28a738
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: kgsl: Make use of the new clock APIs.

Use the split clock APIs to do low latency actions (enable/disable)
frequently.  Use the high latency functions (prepare/unprepare)
sparingly to help performance.

CRs-fixed: 351696
Change-Id: Iaf9ed2117a1647e38be8658c60a365d377c968a4
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
msm: kgsl: Ensure correct enable sequence for 2D core clock

Calling clk_set_rate() for both AXI & 2D core clocks without putting
them in async mode causes 2D core hang. Since AXI & 2D core clocks
are in sync mode, ensure that clk_set_rate() is called only for AXI
& 2D core clock is enabled only after it is prepared.

Change-Id: I4634e2342d62ce16ad7afc748b10b0573fbfd913
CRs-fixed: 385393
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
msm: kgsl: Add TLB flush for each submit in case of 8x25/7x2xa

Add TLB flush for each submit to prevent target freeze
in case of 8x25/7x27a/7x25a targets.

CRs-fixed: 379991
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
(cherry picked from commit 22a06d18c6eb100419616ddf7a2c4ac403420a9e)

Change-Id: I7c34660128c791c9329b41246af39879625d64d3
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: kgsl: Increase REG_RBBM_CNTL value to 0xFFFF for A200

Increase number of clocks that RBBM will wait before de-asserting
the Register Clock Active signal. This fixes kernel panics during
stability tests on multiple devices

Change-Id: I50ad69f28b50444e88239c2332bd5756db1ae089
CRs-fixed: 372793
Signed-off-by: Rammohan Basavaraju <rammoh@codeaurora.org>
msm: kgsl: use correct 2d ringbuffer offset in resume

The 2d timestamp is used as an index into the ringbuffer.
Now that z180_dev->current_timestamp is preserved across
resume, make sure that ADDR_VGV3_NEXTADDR is set to the
gpu address that corresponds to the current timestamp.

CRs-Fixed: 347025
Change-Id: Ib7dc4579943ab24e04279ede1555539ec21adabd
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: Use the correct units for ADRENO_IDLE_TIMEOUT

In a few spots the ADRENO_IDLE_TIMEOUT value (measured in milliseconds)
was used directly for jiffy calculations resulting in timeouts that were
1000/HZ times longer than they should have been.  Use msecs_to_jiffies
for these situations.

CRs-Fixed: 448226
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit 0bcdb735fb0ffa524638ab75acf76d3ddfe38616)

Change-Id: Ic2cd7eaf949d5c69c803fd109f206629de56ef9f
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>