msm: kgsl: Try to run soft reset on all targets that support it

Run soft reset on all targets that define a soft_reset function hook.
If the target defines jump table offsets then we can run through a
faster reset sequence, otherwise default to the slower full reset
path.  In any event, both these options are much faster than the
hard reset path that toggles the regulators.

CRs-Fixed: 519855
Change-Id: I0ff1ea61dbe46afe08e04b2292949cf631514d99
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index 2a3d799..9f13bc2 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -2206,8 +2206,7 @@
 	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
 	int ret;
 
-	/* If the jump table index is 0 soft reset is not supported */
-	if ((!adreno_dev->pm4_jt_idx) || (!adreno_dev->gpudev->soft_reset)) {
+	if (!adreno_dev->gpudev->soft_reset) {
 		dev_WARN_ONCE(device->dev, 1, "Soft reset not supported");
 		return -EINVAL;
 	}
@@ -2238,10 +2237,14 @@
 	device->ftbl->irqctrl(device, adreno_dev->intr_mask);
 
 	/*
-	 * Restart the ringbuffer - we can go down the warm start path because
-	 * power was never yanked
+	 * If we have offsets for the jump tables we can try to do a warm start,
+	 * otherwise do a full ringbuffer restart
 	 */
-	ret = adreno_ringbuffer_warm_start(&adreno_dev->ringbuffer);
+	if (adreno_dev->pm4_jt_idx)
+		ret = adreno_ringbuffer_warm_start(&adreno_dev->ringbuffer);
+	else
+		ret = adreno_ringbuffer_start(&adreno_dev->ringbuffer);
+
 	if (ret)
 		return ret;