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

Commit 5430b543 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

drm/msm/sde: update bw vote for ib change also



Current core perf logic updates the bandwidth only
when ab vote changes. It should update the vote when
ib also changes. This change also updates the bw vote
update removal logic from power handle module. Let client
handle all the requirement for updating ab/ib vote
based on different scenarios.

Change-Id: I55bc88cf0f662c4a9a2994b7281c8d400ab5322a
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 5915565f
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -438,13 +438,15 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,
	if (_sde_core_perf_crtc_is_power_on(crtc) && !stop_req) {
		/*
		 * cases for bus bandwidth update.
		 * 1. new bandwidth vote or writeback output vote
		 *    are higher than current vote for update request.
		 * 2. new bandwidth vote or writeback output vote are
		 *    lower than current vote at end of commit or stop.
		 * 1. new bandwidth vote - "ab or ib vote" is higher
		 *    than current vote for update request.
		 * 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 > old->bw_ctl))) ||
		    (!params_changed && ((new->bw_ctl < old->bw_ctl)))) {
		if ((params_changed && ((new->bw_ctl > old->bw_ctl) ||
			  (new->max_per_pipe_ib > old->max_per_pipe_ib))) ||
		    (!params_changed && ((new->bw_ctl < old->bw_ctl) ||
			  (new->max_per_pipe_ib < old->max_per_pipe_ib)))) {
			SDE_DEBUG("crtc=%d p=%d new_bw=%llu,old_bw=%llu\n",
				crtc->base.id, params_changed, new->bw_ctl,
				old->bw_ctl);
@@ -458,7 +460,8 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,
				get_sde_rsc_current_state(SDE_RSC_INDEX) ==
							    SDE_RSC_CMD_STATE) {
			/* update new bandwdith in all cases */
			if (params_changed && new->bw_ctl != old->bw_ctl) {
			if (params_changed && ((new->bw_ctl != old->bw_ctl) ||
			      (new->max_per_pipe_ib != old->max_per_pipe_ib))) {
				old->bw_ctl = new->bw_ctl;
				old->max_per_pipe_ib = new->max_per_pipe_ib;
				update_bus = 1;
+0 −15
Original line number Diff line number Diff line
@@ -368,7 +368,6 @@ static int _sde_power_data_bus_set_quota(
		u32 nrt_axi_port_cnt = pdbus->nrt_axi_port_cnt;
		u32 total_axi_port_cnt = pdbus->axi_port_cnt;
		u32 rt_axi_port_cnt = total_axi_port_cnt - nrt_axi_port_cnt;
		int match_cnt = 0;

		if (!bw_table || !total_axi_port_cnt ||
		    total_axi_port_cnt > MAX_AXI_PORT_COUNT) {
@@ -408,20 +407,6 @@ static int _sde_power_data_bus_set_quota(
			}
		}

		for (i = 0; i < total_axi_port_cnt; i++) {
			vect = &bw_table->usecase
				[pdbus->curr_bw_uc_idx].vectors[i];
			/* avoid performing updates for small changes */
			if ((ab_quota[i] == vect->ab) &&
				(ib_quota[i] == vect->ib))
				match_cnt++;
		}

		if (match_cnt == total_axi_port_cnt) {
			pr_debug("skip BW vote\n");
			return 0;
		}

		new_uc_idx = (pdbus->curr_bw_uc_idx %
			(bw_table->num_usecases - 1)) + 1;