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

Commit 97554c5d authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Read snapshot registers in the target specific functions



Read the common GPU status registers in the target specific snapshot
functions rather than using adreno_readreg() to read them from the
generic code.

Change-Id: Ic0dedbad17f8744827fda3ce5a035f3bc913ea3f
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent a72f365a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -355,6 +355,16 @@ void a3xx_snapshot(struct adreno_device *adreno_dev,
	/* Disable Clock gating temporarily for the debug bus to work */
	kgsl_regwrite(device, A3XX_RBBM_CLOCK_CTL, 0x0);

	/* Save some CP information that the generic snapshot uses */
	kgsl_regread(device, A3XX_CP_IB1_BASE, &reg);
	snapshot->ib1base = (u64) reg;

	kgsl_regread(device, A3XX_CP_IB2_BASE, &reg);
	snapshot->ib2base = (u64) reg;

	kgsl_regread(device, A3XX_CP_IB1_BUFSZ, &snapshot->ib1size);
	kgsl_regread(device, A3XX_CP_IB2_BUFSZ, &snapshot->ib2size);

	SNAPSHOT_REGISTERS(device, snapshot, a3xx_registers);

	_snapshot_hlsq_regs(device, snapshot);
+16 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 */

#include "adreno.h"
@@ -892,13 +892,27 @@ void a5xx_snapshot(struct adreno_device *adreno_dev,
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	unsigned int i;
	u32 roq, meq;
	u32 roq, meq, hi, lo;
	struct adreno_ringbuffer *rb;
	struct registers regs;

	/* Disable Clock gating temporarily for the debug bus to work */
	a5xx_hwcg_set(adreno_dev, false);

	/* Save some CP information that the generic snapshot uses */
	kgsl_regread(device, A5XX_CP_IB1_BASE, &lo);
	kgsl_regread(device, A5XX_CP_IB1_BASE_HI, &hi);

	snapshot->ib1base = (((u64) hi) << 32) | lo;

	kgsl_regread(device, A5XX_CP_IB2_BASE, &lo);
	kgsl_regread(device, A5XX_CP_IB2_BASE_HI, &hi);

	snapshot->ib2base = (((u64) hi) << 32) | lo;

	kgsl_regread(device, A5XX_CP_IB1_BUFSZ, &snapshot->ib1size);
	kgsl_regread(device, A5XX_CP_IB2_BUFSZ, &snapshot->ib2size);

	/* Dump the registers which get affected by crash dumper trigger */
	kgsl_snapshot_add_section(device, KGSL_SNAPSHOT_SECTION_REGS,
		snapshot, a5xx_snapshot_pre_crashdump_regs, NULL);
+14 −0
Original line number Diff line number Diff line
@@ -1782,6 +1782,7 @@ void a6xx_snapshot(struct adreno_device *adreno_dev,
	struct adreno_ringbuffer *rb;
	bool sptprac_on;
	unsigned int i, roq_size;
	u32 hi, lo;

	/* GMU TCM data dumped through AHB */
	gmu_core_dev_snapshot(device, snapshot);
@@ -1830,6 +1831,19 @@ void a6xx_snapshot(struct adreno_device *adreno_dev,
	if (!gmu_core_dev_gx_is_on(device))
		return;

	kgsl_regread(device, A6XX_CP_IB1_BASE, &lo);
	kgsl_regread(device, A6XX_CP_IB1_BASE_HI, &hi);

	snapshot->ib1base = (((u64) hi) << 32) | lo;

	kgsl_regread(device, A6XX_CP_IB2_BASE, &lo);
	kgsl_regread(device, A6XX_CP_IB2_BASE_HI, &hi);

	snapshot->ib2base = (((u64) hi) << 32) | lo;

	kgsl_regread(device, A6XX_CP_IB1_REM_SIZE, &snapshot->ib1size);
	kgsl_regread(device, A6XX_CP_IB2_REM_SIZE, &snapshot->ib2size);

	/* Assert the isStatic bit before triggering snapshot */
	if (adreno_is_a660(adreno_dev))
		kgsl_regwrite(device, A6XX_RBBM_SNAPSHOT_STATUS, 0x1);
+0 −11
Original line number Diff line number Diff line
@@ -837,17 +837,6 @@ void adreno_snapshot(struct kgsl_device *device, struct kgsl_snapshot *snapshot,
	setup_fault_process(device, snapshot,
			context ? context->proc_priv : NULL);

	if (gmu_core_dev_gx_is_on(device)) {
		adreno_readreg64(adreno_dev, ADRENO_REG_CP_IB1_BASE,
				ADRENO_REG_CP_IB1_BASE_HI, &snapshot->ib1base);
		adreno_readreg(adreno_dev, ADRENO_REG_CP_IB1_BUFSZ,
				&snapshot->ib1size);
		adreno_readreg64(adreno_dev, ADRENO_REG_CP_IB2_BASE,
				ADRENO_REG_CP_IB2_BASE_HI, &snapshot->ib2base);
		adreno_readreg(adreno_dev, ADRENO_REG_CP_IB2_BUFSZ,
				&snapshot->ib2size);
	}

	snapshot->ib1dumped = false;
	snapshot->ib2dumped = false;