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

Commit 3371b80a authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Do not return invalid power stats when the device is off



adreno_power_stats() was returning unitialized data when the device
state was not active. Leave early from the function if the device
is not active and return 0s instead.

Change-Id: Ic0dedbadf6201cadb4472327c4ce7f9d9d32b82d
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 93a52180
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -3234,12 +3234,16 @@ static void adreno_power_stats(struct kgsl_device *device,
	struct adreno_busy_data busy_data;

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

	/*
	 * Get the busy cycles counted since the counter was last reset.
	 * 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)

	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);

	stats->busy_time = adreno_ticks_to_us(busy_data.gpu_busy,