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

Commit 0251af15 authored by Hareesh Gundu's avatar Hareesh Gundu
Browse files

kgsl: msm: Do not use missing A608 GMU power counters



The A608 GPU has a reduced set of power counters. Mark the
ones that are not present as broken so they cannot be used.

Change-Id: Idd987acf4b21e1f8d1999bd4673eb234464195af
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 1e465bc9
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2904,6 +2904,18 @@ static const struct adreno_reg_offsets a6xx_reg_offsets = {
	.offset_0 = ADRENO_REG_REGISTER_MAX,
};

static void a6xx_perfcounter_init(struct adreno_device *adreno_dev)
{
	/*
	 * A6XX_GMU_CX_GMU_POWER_COUNTER_XOCLK_4/5 is not present on A608.
	 * Mark them as broken so that they can't be used.
	 */
	if (adreno_is_a608(adreno_dev)) {
		a6xx_pwrcounters_gpmu[4].countable = KGSL_PERFCOUNTER_BROKEN;
		a6xx_pwrcounters_gpmu[5].countable = KGSL_PERFCOUNTER_BROKEN;
	}
}

static int a6xx_perfcounter_update(struct adreno_device *adreno_dev,
	struct adreno_perfcount_register *reg, bool update_reg)
{
@@ -3003,6 +3015,7 @@ struct adreno_gpudev adreno_a6xx_gpudev = {
	.preemption_context_destroy = a6xx_preemption_context_destroy,
	.sptprac_is_on = a6xx_sptprac_is_on,
	.ccu_invalidate = a6xx_ccu_invalidate,
	.perfcounter_init = a6xx_perfcounter_init,
	.perfcounter_update = a6xx_perfcounter_update,
	.coresight = {&a6xx_coresight, &a6xx_coresight_cx},
};