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

Commit 8515005f authored by Lynus Vaz's avatar Lynus Vaz
Browse files

msm: kgsl: Dump the A6XX SQE firmware version in the snapshot



Add a debug section with the A6XX SQE firmware version while dumping
the snapshot.

Change-Id: I6fc6b5ec5a962536eadf5597a195aee9c55e16d4
Signed-off-by: default avatarLynus Vaz <lvaz@codeaurora.org>
parent 8f452229
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -1010,6 +1010,28 @@ static void a6xx_snapshot_gmu(struct kgsl_device *device,
			snapshot, a6xx_snapshot_dump_gmu_registers, &gmu_regs);
}

/* a6xx_snapshot_sqe() - Dump SQE data in snapshot */
static size_t a6xx_snapshot_sqe(struct kgsl_device *device, u8 *buf,
		size_t remain, void *priv)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct kgsl_snapshot_debug *header = (struct kgsl_snapshot_debug *)buf;
	unsigned int *data = (unsigned int *)(buf + sizeof(*header));
	struct adreno_firmware *fw = ADRENO_FW(adreno_dev, ADRENO_FW_SQE);

	if (remain < DEBUG_SECTION_SZ(1)) {
		SNAPSHOT_ERR_NOMEM(device, "SQE VERSION DEBUG");
		return 0;
	}

	/* Dump the SQE firmware version */
	header->type = SNAPSHOT_DEBUG_SQE_VERSION;
	header->size = 1;
	*data = fw->version;

	return DEBUG_SECTION_SZ(1);
}

static void _a6xx_do_crashdump(struct kgsl_device *device)
{
	unsigned long wait_time;
@@ -1099,6 +1121,10 @@ void a6xx_snapshot(struct adreno_device *adreno_dev,
		snapshot, adreno_snapshot_cp_roq,
		&snap_data->sect_sizes->roq);

	/* SQE Firmware */
	kgsl_snapshot_add_section(device, KGSL_SNAPSHOT_SECTION_DEBUG,
		snapshot, a6xx_snapshot_sqe, NULL);

	/* Mempool debug data */
	a6xx_snapshot_mempool(device, snapshot);

+1 −0
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ struct kgsl_snapshot_istore {
#define SNAPSHOT_DEBUG_CP_ROQ     10
#define SNAPSHOT_DEBUG_SHADER_MEMORY 11
#define SNAPSHOT_DEBUG_CP_MERCIU 12
#define SNAPSHOT_DEBUG_SQE_VERSION 14

struct kgsl_snapshot_debug {
	int type;    /* Type identifier for the attached tata */