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

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

msm: kgsl: convert pwrscale to use bus_mod



Use a bus specific speed flag rather than overloading
the least upper bound flag.

Change-Id: I343726e6e0d9885f39c343ed56c1667ab2008aee
Signed-off-by: default avatarLucille Sylvester <lsylvest@codeaurora.org>
parent 944cc1fe
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq,
	 */
	if ((stats.total_time == 0) ||
		(priv->bin.total_time < FLOOR)) {
		return 0;
		return 1;
	}

	level = devfreq_get_freq_level(devfreq, stats.current_frequency);
@@ -125,8 +125,10 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq,
	 * By setting freq as UINT_MAX we notify the kgsl target function
	 * to go up one power level without considering the freq value
	 */
	if (val < 0)
	if (val < 0) {
		*flag = DEVFREQ_FLAG_FAST_HINT;
		*freq = UINT_MAX;
	}

	return 0;
}
+5 −6
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags)
	struct kgsl_pwrctrl *pwr;
	int level = -1, i;
	unsigned long cur_freq;
	int lubflag = 0;
	int bus_mod = 0;

	if (device == NULL)
		return -ENODEV;
@@ -185,20 +185,19 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags)
	profile = &device->pwrscale.profile;
	pwr = &device->pwrctrl;

	if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND)
		lubflag = 1;
	if (flags & DEVFREQ_FLAG_FAST_HINT)
		bus_mod = 1;

	mutex_lock(&device->mutex);
	cur_freq = kgsl_pwrctrl_active_freq(pwr);

	if (*freq > cur_freq && pwr->active_pwrlevel > 0) {
		/*
		 * If LUB - Least Upper Bound - is requested
		 *                 - move up just one level,
		 * If FAST is requested, move up just one level,
		 * otherwise - move up until required freq or higher
		 */
		level = pwr->active_pwrlevel - 1;
		if (!lubflag)
		if (!bus_mod)
			while (*freq > pwr->pwrlevels[level].gpu_freq
					&& level > 0)
				level--;
+3 −0
Original line number Diff line number Diff line
@@ -52,6 +52,9 @@ struct devfreq_dev_status {
 */
#define DEVFREQ_FLAG_LEAST_UPPER_BOUND		0x1

#define DEVFREQ_FLAG_FAST_HINT	0x2
#define DEVFREQ_FLAG_SLOW_HINT	0x4

/**
 * struct devfreq_governor_data - mapping to per device governor data
 * @name:		The name of the governor.