msm: gpu: merge algorithm improvements from hammerhead.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>

Conflicts:
	drivers/gpu/msm/kgsl_pwrscale_trustzone.c

Change-Id: I32bd92eb3a9bbc6f0c5dddd8ce42ff161964a7bf
msm: kgsl: small calculation change.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: kgsl: no need to cast long because jiffies and window_time are already long.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: Add intermediate power levels

Make use of the two independent power domains to
add intermediate levels.  Attempt to just increase
the bus frequency before also raising the GPU
frequency.

Change-Id: Ie2109df001f96e36e03959288aa957d63c0ef4a7
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>

Conflicts:
	drivers/gpu/msm/kgsl_pwrctrl.c
	drivers/gpu/msm/kgsl_pwrctrl.h
msm: kgsl: set active pwrlevel to init pwrlevel after power collapse

Between kgsl_open and kgsl_release calls active pwrlevel could be
set to anything based on the content. However after a power collapse
always power up the GPU and set the clock to init level.

Change-Id: Ic2858218afa9c1047864ab8551b3495b7d752952
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: kgsl: change the load calculation equation & fix a couple of bugs, one of 'em was keeping the GPU on 320MHz if the GPU was not sleeping.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:
	drivers/gpu/msm/kgsl_pwrscale_trustzone.c

Change-Id: I13a98605ed72bcb7f96caf080d8bda0d90fb1b61
msm: kgsl: don't forcefully ramp down on sleep if there's still load higher than down_threshold.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: remove the sample_time_ms and let the governor run its idle_check freely like Qualcomm intends. I was seeing some frames being lost because the sample_time_ms was too big.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: remove obsolete code.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>