msm: kgsl: Fix snapshot dump for hangs involving legacy context switch

The IBs stored by legacy context switch are not stored as part of the
nominal mem_entry accounting that the rest of the process has.  As a
result we cannot freeze the legacy context switch IBs for dump.  Instead,
dump them into the snapshot as IB sections.  Also, store the offset for
the frozen objects to avoid trying to read the gpuaddr of the memdesc after
it had been freed.

Change-Id: Ic0dedbadda43a3025f938b31140d5be19c4706b2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/adreno.h b/drivers/gpu/msm/adreno.h
index 4885312..48e70c8 100644
--- a/drivers/gpu/msm/adreno.h
+++ b/drivers/gpu/msm/adreno.h
@@ -128,6 +128,9 @@
 uint8_t *adreno_convertaddr(struct kgsl_device *device,
 	unsigned int pt_base, unsigned int gpuaddr, unsigned int size);
 
+struct kgsl_memdesc *adreno_find_ctxtmem(struct kgsl_device *device,
+	unsigned int pt_base, unsigned int gpuaddr, unsigned int size);
+
 void *adreno_snapshot(struct kgsl_device *device, void *snapshot, int *remain,
 		int hang);