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

Commit 60bacc2a authored by Carl Vanderlip's avatar Carl Vanderlip Committed by Ping Li
Browse files

msm: mdss: Fix assertive display HW range checks



Fix off by one error leading to log spam. 'nad_cfgs' is the upper bound of
the zero-indexed mixer/AD/dspp pipe enumeration.

Change-Id: I963d175aad23a8eb621772d6c9bd06676fa2e27e
Signed-off-by: default avatarCarl Vanderlip <carlv@codeaurora.org>
Signed-off-by: default avatarPing Li <quicpingli@codeaurora.org>
parent f75c756e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1688,7 +1688,7 @@ int mdss_mdp_pp_setup_locked(struct mdss_mdp_ctl *ctl)
	if (mdata->nad_cfgs == 0)
		valid_mixers = false;
	for (i = 0; i < mixer_cnt && valid_mixers; i++) {
		if (mixer_id[i] > mdata->nad_cfgs)
		if (mixer_id[i] >= mdata->nad_cfgs)
			valid_mixers = false;
	}
	if (valid_mixers && (mixer_cnt <= mdata->nmax_concurrent_ad_hw)) {
@@ -4544,7 +4544,7 @@ static void pp_ad_calc_worker(struct work_struct *work)
	ctl = mfd_to_ctl(ad->mfd);
	mdata = mfd_to_mdata(ad->mfd);

	if (!mdata || ad->calc_hw_num > mdata->nad_cfgs) {
	if (!mdata || ad->calc_hw_num >= mdata->nad_cfgs) {
		mutex_unlock(&ad->lock);
		return;
	}