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

Commit 4481d17d authored by Jayant Shekhar's avatar Jayant Shekhar Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Correct max threshold bandwidth selection logic



Max threshold Bandwidth selection logic should be independent of
number of entries in max bandwidth limit DT property. Correct the
logic to make it independent.

Change-Id: I6510ad7095560b25bbada7c63c44ae88a6d955f1
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent ac6766f8
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1405,15 +1405,13 @@ static int mdss_mdp_set_threshold_max_bandwidth(struct mdss_mdp_ctl *ctl)
	pr_debug("final mode = %d, bw_mode_bitmap = %d\n", mode,
			ctl->mdata->bw_mode_bitmap);

	/* Select BW mode with smallest limit */
	while (mode) {
		if (mode & BIT(0)) {
	/* Return minimum bandwidth limit */
	for (i = 0; i < ctl->mdata->max_bw_settings_cnt; i++) {
		if (max_bw_settings[i].mdss_max_bw_mode & mode) {
			threshold = max_bw_settings[i].mdss_max_bw_val;
			if (threshold < max)
				max = threshold;
		}
		mode >>= 1;
		i++;
	}

	return max;