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

Commit 76aedcac authored by Lucille Sylvester's avatar Lucille Sylvester Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Fix the busy counter initialization sequence



The busy counters should be cleared when the GPU finishes starting
up but before it begins processing.  At this point it is not yet
in ACTIVE state, but the counters should be read.  Allow this read
to go through and initialize the counter values.  If this does not
happen then the first returned counter value after SLUMBER will be
zeros.

Change-Id: I9292b536bc9dfd3c905efb152de8834a4029c8bd
Signed-off-by: default avatarLucille Sylvester <lsylvest@codeaurora.org>
parent b940677f
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -2722,6 +2722,13 @@ static inline s64 adreno_ticks_to_us(u32 ticks, u32 freq)
	return ticks / freq;
}

/**
 * adreno_power_stats() - Reads the counters needed for freq decisions
 * @device: Pointer to device whose counters are read
 * @stats: Pointer to stats set that needs updating
 * Power: The caller is expected to be in a clock enabled state as this
 * function does reg reads
 */
static void adreno_power_stats(struct kgsl_device *device,
				struct kgsl_power_stats *stats)
{
@@ -2732,14 +2739,6 @@ static void adreno_power_stats(struct kgsl_device *device,

	memset(stats, 0, sizeof(*stats));

	/*
	 * If we're not currently active, there shouldn't have been
	 * any cycles since the last time this function was called.
	 */

	if (device->state != KGSL_STATE_ACTIVE)
		return;

	/* Get the busy cycles counted since the counter was last reset */
	gpudev->busy_cycles(adreno_dev, &busy_data);