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/kgsl_snapshot.c b/drivers/gpu/msm/kgsl_snapshot.c
index c24576d..553dc60 100644
--- a/drivers/gpu/msm/kgsl_snapshot.c
+++ b/drivers/gpu/msm/kgsl_snapshot.c
@@ -28,6 +28,7 @@
unsigned int gpuaddr;
unsigned int ptbase;
unsigned int size;
+ unsigned int offset;
int type;
struct kgsl_mem_entry *entry;
struct list_head node;
@@ -229,7 +230,7 @@
* then offset the source pointer
*/
- offset = obj->gpuaddr - obj->entry->memdesc.gpuaddr;
+ offset = obj->offset;
/*
* Then adjust it to account for the offset for the output
@@ -348,6 +349,7 @@
obj->gpuaddr = gpuaddr;
obj->ptbase = ptbase;
obj->size = size;
+ obj->offset = offset;
list_add(&obj->node, &device->snapshot_obj_list);