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

Commit c0d04ba2 authored by Suman Tatiraju's avatar Suman Tatiraju
Browse files

msm: kgsl: set the correct max_state



Max_state from the driver should be set to the number of power
levels. The devfreq governor then checks the frequencies from
0 to max_state -1.

Change-Id: I79a6da698ff8bcb2840774ccc5d792b7ddbf126b
Signed-off-by: default avatarSuman Tatiraju <sumant@codeaurora.org>
parent 3dda8f02
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq,
	if (val) {
		level += val;
		level = max(level, 0);
		level = min_t(int, level, devfreq->profile->max_state);
		level = min_t(int, level, devfreq->profile->max_state - 1);
		goto clear;
	}

+5 −1
Original line number Diff line number Diff line
@@ -447,7 +447,11 @@ int kgsl_pwrscale_init(struct device *dev, const char *governor)
	for (i = 0; i < (pwr->num_pwrlevels - 1); i++)
		pwrscale->freq_table[out++] = pwr->pwrlevels[i].gpu_freq;

	profile->max_state = pwr->num_pwrlevels - 2;
	/*
	 * Max_state is the number of valid power levels.
	 * The valid power levels range from 0 - (max_state - 1)
	 */
	profile->max_state = pwr->num_pwrlevels - 1;
	/* link storage array to the devfreq profile pointer */
	profile->freq_table = pwrscale->freq_table;