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

Commit dd2286bf authored by Lucille Sylvester's avatar Lucille Sylvester
Browse files

msm: kgsl: Add a dynamic AB bandwidth vote



The vbif_bw governor should vote for AB tracking a
bus usage counter.  Vote for the previous bus usage
in the next itteration.

Change-Id: I613187646a261aed733ea5f1c0e413deac3a437c
Signed-off-by: default avatarLucille Sylvester <lsylvest@codeaurora.org>
parent 4fa91be7
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -53,6 +53,12 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
	int act_level;
	int norm_cycles;
	int gpu_percent;
	/*
	 * Normalized AB should at max usage be the gpu_bimc frequency in MHz.
	 * Start with a reasonable value and let the system push it up to max.
	 */
	static int norm_ab_max = 300;
	int norm_ab;

	stats.private_data = &b;

@@ -97,6 +103,15 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
			bus_profile->flag = DEVFREQ_FLAG_SLOW_HINT;
	}

	/* Re-calculate the AB percentage for a new IB vote */
	if (bus_profile->flag) {
		norm_ab =  (unsigned int)priv->bus.ram_time /
			(unsigned int) priv->bus.total_time;
		if (norm_ab > norm_ab_max)
			norm_ab_max = norm_ab;
		bus_profile->percent_ab = (100 * norm_ab) / norm_ab_max;
	}

	priv->bus.total_time = 0;
	priv->bus.gpu_time = 0;
	priv->bus.ram_time = 0;