msm: kgsl: Simplify logic for VBIF registers across A3XX cores

VBIF registers are set dependent on what A3XX GPU core is present.
Set the registers from a table that is explicitly tied to each of
the A3XX GPU cores.  This will prevent side effects across cores
when changing a specific cores VBIF data.
This change  doesnt support A330 cores.

(cherry picked from commit 05d2c433571a7318759a1a6bd3666334a20f88b1)

Change-Id: I0984a2de563cb95fbcefc01520133a6f6909bcf4
Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
Signed-off-by: Rajeev kulkarni <krajeev@codeaurora.org>
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Jessica Gonzalez <jgaona@codeaurora.org>
msm: kgsl: Fix the address translation ranges for GPU IOMMU

Set the address translation to happen via ttbr0 for GPU IOMMU till
address 0x80000000 instead of 0x40000000. Also, adjust the size of
virtual pool so that it does not allocate an address greater
than 0x80000000.

CRs-fixed: 401364
Change-Id: I268dda47e82e80a7ee0a72a835c7777be8b6f7f5
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: cpufreq: fix a race between hotplug and cpufreq

When msm_cpufreq_target() is called without holding the policy
semaphore, there is a rare chance that the cpu gets hotplugged in
the acpuclk_set_rate. The probability of this issue increases
when cross-calling is used or using interactive governor which
tries to set all cpu frequencies from a single thread.

Add a hotplug notifier and set the device_suspended flag holding
the suspend mutex, when cpu is going down. This mutex is always
held when frequency changes are done.

Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
(cherry picked from commit 56f5a6de7f2ab48ed0538da727ad52673fb801a2)

Change-Id: I17537a41eb37260339744a18660a545b2c89fef6
Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
msm: kgsl: Always reset global ts_cmp_enable on GPU interrupts

Always rest the ts_cmp_enable when an interrupt is received
from the GPU.  This keeps legacy code that is not using
per context timestamps correctly updated.  No effect is
seen with mainline code using per context timestamps.

(cherry picked from commit 95b0011ae56577e84d2912ae7d600ae62c08c2e4)

CRs-fixed: 418172
Change-Id: I7f29086d4885571bdb165c0e759dc6ffc40b554f
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
msm: kgsl: Remove extra interrupts when setting MMU state

The interrupts added to the ringbuffer on PTFLUSH and TLBUPDATE
were causing a major increase in the number of interrupts from the GPU.
This was leading to increase in power and loss of performance. Add a check
to turn off IOMMU clocks when going to SLEEP.

Change-Id: I41617dd3b7b3f7d9622523f2a1407b912dbd989e
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>