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

Commit 17bac477 authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

drm/msm/sde: fix undervote due to wrong condition check



Current driver assumes that AB and IB votes scale
up and down at the same time, but in some corner
cases it is possible that the IB vote scales up
while the AB vote is going down; in those cases
driver must update the IB vote to account for the
upscaling, but should not update the AB vote until
the new HW configuration has taken effect.
Fix the above issue by separating the AB and IB
vote, so the driver can scale each value
independently.

Change-Id: I0dac17f7d70c825d529e624deb0f138584b721de
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 06e4dc68
Loading
Loading
Loading
Loading
+21 −8
Original line number Diff line number Diff line
@@ -552,19 +552,32 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,
			 * 2. new bandwidth vote - "ab or ib vote" is lower
			 *    than current vote at end of commit or stop.
			 */
			if ((params_changed && ((new->bw_ctl[i] >
						old->bw_ctl[i]) ||
				  (new->max_per_pipe_ib[i] >
						old->max_per_pipe_ib[i]))) ||
			    (!params_changed && ((new->bw_ctl[i] <
						old->bw_ctl[i]) ||
				  (new->max_per_pipe_ib[i] <
						old->max_per_pipe_ib[i])))) {

			if ((params_changed &&
				(new->bw_ctl[i] > old->bw_ctl[i])) ||
			    (!params_changed &&
				(new->bw_ctl[i] < old->bw_ctl[i]))) {

				SDE_DEBUG(
					"crtc=%d p=%d new_bw=%llu,old_bw=%llu\n",
					crtc->base.id, params_changed,
					new->bw_ctl[i], old->bw_ctl[i]);
				old->bw_ctl[i] = new->bw_ctl[i];
				update_bus |= BIT(i);
			}

			if ((params_changed &&
				(new->max_per_pipe_ib[i] >
				 old->max_per_pipe_ib[i])) ||
			    (!params_changed &&
				(new->max_per_pipe_ib[i] <
				old->max_per_pipe_ib[i]))) {

				SDE_DEBUG(
					"crtc=%d p=%d new_ib=%llu,old_ib=%llu\n",
					crtc->base.id, params_changed,
					new->max_per_pipe_ib[i],
					old->max_per_pipe_ib[i]);
				old->max_per_pipe_ib[i] =
						new->max_per_pipe_ib[i];
				update_bus |= BIT(i);