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

Commit 26c3c0aa authored by Ingrid Gallardo's avatar Ingrid Gallardo Committed by Krishna Manikandan
Browse files

msm: mdss: update check bw check for ab/ib



Update the bandwidth check for those cases where only
ab changes and ib is greater than ab. The current
logic takes the max of both and since ib is max, the
vote will not kick-in. This change is intended to
solve this problem.

Change-Id: Icbd6d9aa5221784bc1c88ae1965c944503ac78dc
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 783427f7
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -2263,8 +2263,8 @@ static bool __mdss_mdp_compare_bw(
		__calc_bus_ib_quota(mdata, new_perf, is_nrt, new_perf->bw_ctl);
	u64 old_ib =
		__calc_bus_ib_quota(mdata, old_perf, is_nrt, old_perf->bw_ctl);
	u64 max_new_bw = max(new_perf->bw_ctl, new_ib);
	u64 max_old_bw = max(old_perf->bw_ctl, old_ib);
	u64 new_ab = new_perf->bw_ctl;
	u64 old_ab = old_perf->bw_ctl;
	bool update_bw = false;

	/*
@@ -2276,16 +2276,18 @@ static bool __mdss_mdp_compare_bw(
	 * 3. end of writeback/rotator session - last chance to
	 *		non-realtime remove vote.
	 */
	if ((params_changed && ((max_new_bw > max_old_bw) || /* ab and ib bw */
	if ((params_changed &&
			(((new_ib > old_ib) || (new_ab > old_ab)) ||
			(new_perf->bw_writeback > old_perf->bw_writeback))) ||
			(!params_changed && ((max_new_bw < max_old_bw) ||
			(!params_changed &&
			(((new_ib < old_ib) || (new_ab < old_ab)) ||
			(new_perf->bw_writeback < old_perf->bw_writeback))) ||
			(stop_req && is_nrt))
		update_bw = true;

	trace_mdp_compare_bw(new_perf->bw_ctl, new_ib, new_perf->bw_writeback,
		max_new_bw, old_perf->bw_ctl, old_ib, old_perf->bw_writeback,
		max_old_bw, params_changed, update_bw);
		old_perf->bw_ctl, old_ib, old_perf->bw_writeback,
		params_changed, update_bw);

	return update_bw;
}
+8 −12
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -297,22 +297,20 @@ TRACE_EVENT(mdp_perf_update_bus,

TRACE_EVENT(mdp_compare_bw,
	TP_PROTO(unsigned long long new_ab, unsigned long long new_ib,
		unsigned long long new_wb, unsigned long long new_max,
		unsigned long long new_wb,
		unsigned long long old_ab, unsigned long long old_ib,
		unsigned long long old_wb, unsigned long long old_max,
		unsigned long long old_wb,
		u32 params_changed, bool update_bw),
	TP_ARGS(new_ab, new_ib, new_wb, new_max,
					old_ab, old_ib, old_wb, old_max,
	TP_ARGS(new_ab, new_ib, new_wb,
					old_ab, old_ib, old_wb,
					params_changed, update_bw),
	TP_STRUCT__entry(
			__field(u64, new_ab)
			__field(u64, new_ib)
			__field(u64, new_wb)
			__field(u64, new_max)
			__field(u64, old_ab)
			__field(u64, old_ib)
			__field(u64, old_wb)
			__field(u64, old_max)
			__field(u32, params_changed)
			__field(bool, update_bw)
	),
@@ -320,18 +318,16 @@ TRACE_EVENT(mdp_compare_bw,
			__entry->new_ab = new_ab;
			__entry->new_ib = new_ib;
			__entry->new_wb = new_wb;
			__entry->new_max = new_max;
			__entry->old_ab = old_ab;
			__entry->old_ib = old_ib;
			__entry->old_wb = old_wb;
			__entry->old_max = old_max;
			__entry->params_changed = params_changed;
			__entry->update_bw = update_bw;
	),
	TP_printk("[ab,ib,wb,max] new[%llu, %llu, %llu, %llu] old[%llu, %llu, %llu, %llu] parm:%d ret:%d",
	TP_printk("[ab,ib,wb]new[%llu,%llu,%llu]old[%llu,%llu,%llu]chgd:%d %d",
		__entry->new_ab, __entry->new_ib, __entry->new_wb,
		__entry->new_max, __entry->old_ab, __entry->old_ib,
		__entry->old_wb, __entry->old_max, __entry->params_changed,
		__entry->old_ab, __entry->old_ib,
		__entry->old_wb, __entry->params_changed,
		__entry->update_bw)
);