msm: kgsl: Change the fence to ALLOW to prepare for SLUMBER

After telling the GMU to prepare for SLUMBER, put the
fence in ALLOW mode. This prevents a situation where
the fence is in BLOCK or DROP mode but the GMU is not
available to change the mode back to ALLOW. This should
also be done when taking snapshots or handling RBBM
IRQs.

Also change gx_is_on() to not check the FENCE register.
When taking a snapshot, all that matters is that the
GX domain is powered on. If the fence is not in ALLOW
mode, we can just set it to ALLOW manually to read
the desired registers.

CRs-Fixed: 2085877
Change-Id: If72cbc8f1602dc718521f4c8bed6a02b782866bf
Signed-off-by: Kyle Piefer <kpiefer@codeaurora.org>
diff --git a/drivers/gpu/msm/adreno_a6xx_snapshot.c b/drivers/gpu/msm/adreno_a6xx_snapshot.c
index 755fc7f..b1106ac 100644
--- a/drivers/gpu/msm/adreno_a6xx_snapshot.c
+++ b/drivers/gpu/msm/adreno_a6xx_snapshot.c
@@ -1577,6 +1577,12 @@
 	bool sptprac_on;
 	unsigned int i;
 
+	/* Make sure the fence is in ALLOW mode so registers can be read */
+	kgsl_regwrite(device, A6XX_GMU_AO_AHB_FENCE_CTRL, 0);
+
+	/* GMU TCM data dumped through AHB */
+	a6xx_snapshot_gmu(adreno_dev, snapshot);
+
 	sptprac_on = gpudev->sptprac_is_on(adreno_dev);
 
 	/* Return if the GX is off */