msm: kgsl: Run GPU fault tolerance at max clock

GPU fault tolerance should take minimal time,
set the GPU clock to max freqency to acheive this.
When we set GPU clock to max freqency we vote for
high CPU clock and bus bandwidth.

Change-Id: I98a3f7c24f0939c08f9b12257817d17414e3f128
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index 678a1b3..4f460ed 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -2000,6 +2000,8 @@
 	int result = -ETIMEDOUT;
 	struct adreno_ft_data ft_data;
 	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
+	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
+	unsigned int curr_pwrlevel;
 
 	if (device->state == KGSL_STATE_HUNG)
 		goto done;
@@ -2014,6 +2016,10 @@
 		INIT_COMPLETION(device->ft_gate);
 		/* Detected a hang */
 
+		/* Run fault tolerance at max power level */
+		curr_pwrlevel = pwr->active_pwrlevel;
+		kgsl_pwrctrl_pwrlevel_change(device, pwr->max_pwrlevel);
+
 		/* Get the fault tolerance data as soon as hang is detected */
 		result = adreno_setup_ft_data(device, &ft_data);
 
@@ -2042,6 +2048,9 @@
 			adreno_destroy_ft_data(&ft_data);
 		}
 
+		/* restore power level */
+		kgsl_pwrctrl_pwrlevel_change(device, curr_pwrlevel);
+
 		if (result) {
 			kgsl_pwrctrl_set_state(device, KGSL_STATE_HUNG);
 		} else {