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

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

msm: kgsl: Correct the bandwidth vote translation



The numbers stored in ib_votes will be multipled by
1024 * 1024 to be translated into a bandwidth request.
That is the value they need to be divided by with the
result rounded down before storage.

Change-Id: Ib171d2bbf58911cbf0423d3b1365d3917abe5f19
Signed-off-by: default avatarLucille Sylvester <lsylvest@codeaurora.org>
parent e796a1f6
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -1364,14 +1364,10 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
		if (vector->dst == MSM_BUS_SLAVE_EBI_CH0 &&
				vector->ib != 0) {
			if (i < KGSL_MAX_BUSLEVELS)
				/*
				 * Want to convert bytes to Mbytes,
				 * but msm_bus_of.c uses a strange macro
				 *  #define KBTOB(a) (a * 1000ULL)
				 * thats why 1024*1000, not 1024*1024
				 */
				/* Convert bytes to Mbytes. */
				ib_votes[i] =
					DIV_ROUND_UP_ULL(vector->ib, 1024000);
					DIV_ROUND_UP_ULL(vector->ib, 1048576)
					- 1;

			for (k = 0; k < n; k++)
				if (vector->ib == pwr->bus_ib[k]) {