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

Commit c76a5c6f authored by Rajesh Kemisetti's avatar Rajesh Kemisetti
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 300d866b
Loading
Loading
Loading
Loading
+24 −7
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/msm-bus.h>
#include <linux/msm-bus.h>
@@ -908,17 +908,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
	 * 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
	 * 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
	 * 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.
	 * figure how often this really happens.
	 */
	 */


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

		entry = kgsl_sharedmem_find(snapshot->process,
				snapshot->ib1base);
		if (entry == NULL) {
			dev_err(device->dev,
				"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(device, snapshot->process,
			kgsl_snapshot_push_object(device, snapshot->process,
			snapshot->ib1base, snapshot->ib1size);
				snapshot->ib1base, ibsize >> 2);
			dev_err(device->dev,
			dev_err(device->dev,
			"CP_IB1_BASE not found in the ringbuffer.Dumping %x dwords of the buffer\n",
				"CP_IB1_BASE is not found in the ringbuffer. Dumping %llx dwords of the buffer\n",
			snapshot->ib1size);
				ibsize >> 2);
		}
	}
	}


	/*
	/*