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

Commit 5c7ba6da authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Add a dynamic AB bandwidth vote"

parents 860aa3c7 dd2286bf
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;