msm: kgsl: Improve GPU snapshot design

If GPU recovers from fault, KGSL shall continue doing GPU snapshot
in case GPU/GMU faults again. If GPU fault cannot be recovered,
stop taking new GPU snapshot. Keep the snapshot of last
unrecoverable snapshot for post-mortem debugging.

Change-Id: I988a7ee8f8b01dbf57bc4751708c5cf33bea835e
Signed-off-by: George Shen <sqiao@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl_device.h b/drivers/gpu/msm/kgsl_device.h
index 0ab775a..6fca1e15 100644
--- a/drivers/gpu/msm/kgsl_device.h
+++ b/drivers/gpu/msm/kgsl_device.h
@@ -498,6 +498,7 @@ struct kgsl_device_private {
  * @sysfs_read: Count of current reads via sysfs
  * @first_read: True until the snapshot read is started
  * @gmu_fault: Snapshot collected when GMU fault happened
+ * @recovered: True if GPU was recovered after previous snapshot
  */
 struct kgsl_snapshot {
 	uint64_t ib1base;
@@ -521,6 +522,7 @@ struct kgsl_snapshot {
 	unsigned int sysfs_read;
 	bool first_read;
 	bool gmu_fault;
+	bool recovered;
 };
 
 /**