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

Commit 4d76f45c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Dump the A6XX registers properly using AHB"

parents 99f45780 96de8528
Loading
Loading
Loading
Loading
+29 −35
Original line number Diff line number Diff line
@@ -569,38 +569,33 @@ static struct reg_list {
	(((_a)[(2 * (_i)) + 1] - (_a)[2 * (_i)]) + 1)

static size_t a6xx_legacy_snapshot_registers(struct kgsl_device *device,
		u8 *buf, size_t remain)
		u8 *buf, size_t remain, struct reg_list *regs)
{
	unsigned int i;
	size_t used = 0;

	for (i = 0; i < ARRAY_SIZE(a6xx_reg_list); i++) {
		struct reg_list *regs = &a6xx_reg_list[i];
	struct kgsl_snapshot_registers snapshot_regs = {
		.regs = regs->regs,
		.count = regs->count,
	};

	if (regs->sel)
			kgsl_regwrite(device, regs->sel->host_reg,
				regs->sel->val);
		used += kgsl_snapshot_dump_registers(device, buf + used,
						remain - used, &snapshot_regs);
	}
	return used;
		kgsl_regwrite(device, regs->sel->host_reg, regs->sel->val);

	return kgsl_snapshot_dump_registers(device, buf, remain,
		&snapshot_regs);
}

static size_t a6xx_snapshot_registers(struct kgsl_device *device, u8 *buf,
		size_t remain, void *priv)
{
	struct kgsl_snapshot_regs *header = (struct kgsl_snapshot_regs *)buf;
	struct reg_list *regs = (struct reg_list *)priv;
	unsigned int *data = (unsigned int *)(buf + sizeof(*header));
	unsigned int *src = (unsigned int *)a6xx_crashdump_registers.hostptr;
	unsigned int i, j, k;
	unsigned int j, k;
	unsigned int count = 0;

	if (crash_dump_valid == false)
		return a6xx_legacy_snapshot_registers(device, buf, remain);
		return a6xx_legacy_snapshot_registers(device, buf, remain,
			regs);

	if (remain < sizeof(*header)) {
		SNAPSHOT_ERR_NOMEM(device, "REGISTERS");
@@ -609,9 +604,6 @@ static size_t a6xx_snapshot_registers(struct kgsl_device *device, u8 *buf,

	remain -= sizeof(*header);

	for (i = 0; i < ARRAY_SIZE(a6xx_reg_list); i++) {
		struct reg_list *regs = &a6xx_reg_list[i];

	for (j = 0; j < regs->count; j++) {
		unsigned int start = regs->regs[2 * j];
		unsigned int end = regs->regs[(2 * j) + 1];
@@ -628,7 +620,6 @@ static size_t a6xx_snapshot_registers(struct kgsl_device *device, u8 *buf,
			*data++ = *src++;
		}
	}
	}

out:
	header->count = count;
@@ -1580,6 +1571,7 @@ void a6xx_snapshot(struct adreno_device *adreno_dev,
	struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);
	struct adreno_snapshot_data *snap_data = gpudev->snapshot_data;
	bool sptprac_on;
	unsigned int i;

	sptprac_on = gpudev->sptprac_is_on(adreno_dev);

@@ -1600,8 +1592,10 @@ void a6xx_snapshot(struct adreno_device *adreno_dev,
	if (sptprac_on)
		_a6xx_do_crashdump(device);

	for (i = 0; i < ARRAY_SIZE(a6xx_reg_list); i++) {
		kgsl_snapshot_add_section(device, KGSL_SNAPSHOT_SECTION_REGS,
		snapshot, a6xx_snapshot_registers, NULL);
			snapshot, a6xx_snapshot_registers, &a6xx_reg_list[i]);
	}

	/* CP_SQE indexed registers */
	kgsl_snapshot_indexed_registers(device, snapshot,