Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01c6a0bb authored by Rajesh Kemisetti's avatar Rajesh Kemisetti Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Dump maximum possible IB1 size in snapshot



Currently adreno_snapshot() tries to dump remaining IB1 size
if the active IB1 base address is not present in ringbuffer
which is not enough to debug GPU hang.

So, try to calculate the maximum possible size that it can
dump from IB1 base address and add it to snapshot dump.

Change-Id: I029fb8cddab7999001a2934ce49cb5ff884c21bf
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent 5b94b8e5
Loading
Loading
Loading
Loading
+24 −7
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -933,17 +933,34 @@ void adreno_snapshot(struct kgsl_device *device, struct kgsl_snapshot *snapshot,
	 * The problem is that IB size from the register is the unprocessed size
	 * of the buffer not the original size, so if we didn't catch this
	 * buffer being directly used in the RB, then we might not be able to
	 * dump the whole thing. Print a warning message so we can try to
	 * dump the whole thing. Try to dump the maximum possible size from the
	 * IB1 base address till the end of memdesc size so that we dont miss
	 * what we are interested in. Print a warning message so we can try to
	 * figure how often this really happens.
	 */

	if (-ENOENT == find_object(snapshot->ib1base, snapshot->process) &&
			snapshot->ib1size) {
		kgsl_snapshot_push_object(snapshot->process, snapshot->ib1base,
				snapshot->ib1size);
		struct kgsl_mem_entry *entry;
		u64 ibsize;

		entry = kgsl_sharedmem_find(snapshot->process,
				snapshot->ib1base);
		if (entry == NULL) {
			KGSL_CORE_ERR(
				"Can't find a memory entry containing IB1BASE %16llx\n",
				snapshot->ib1base);
		} else {
			ibsize = entry->memdesc.size -
				(snapshot->ib1base - entry->memdesc.gpuaddr);
			kgsl_mem_entry_put(entry);

			kgsl_snapshot_push_object(snapshot->process,
				snapshot->ib1base, ibsize >> 2);
			KGSL_CORE_ERR(
		"CP_IB1_BASE not found in the ringbuffer.Dumping %x dwords of the buffer.\n",
		snapshot->ib1size);
				"CP_IB1_BASE is not found in the ringbuffer. Dumping %llx dwords of the buffer\n",
				ibsize >> 2);
		}
	}

	/*