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

Commit e0fdefea authored by Ingrid Gallardo's avatar Ingrid Gallardo Committed by Jayant Shekhar
Browse files

msm: mdss: release rotator bandwidth once rotator finished processing



Once rotator finished processing the data, the bandwidth for the
rotator can be removed from the bandwidth vote. This change remove
the rotator bandwidth from the vote after rotator completed the
transaction.

Change-Id: Ic79398006a1514c4b422e8b3aa7cafcb7fb3c002
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent 8425ac27
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ struct mdss_mdp_ctl {
	struct mdss_mdp_perf_params cur_perf;
	struct mdss_mdp_perf_params new_perf;
	u32 perf_transaction_status;
	bool perf_release_ctl_bw;

	struct mdss_data_type *mdata;
	struct msm_fb_data_type *mfd;
+23 −1
Original line number Diff line number Diff line
@@ -911,6 +911,17 @@ u32 mdss_mdp_ctl_perf_get_transaction_status(struct mdss_mdp_ctl *ctl)
	unsigned long flags;
	u32 transaction_status;

	if (!ctl)
		return PERF_STATUS_BUSY;

	/*
	 * If Rotator mode and bandwidth has been released; return STATUS_DONE
	 * so the bandwidth is re-calculated.
	 */
	if (ctl->mixer_left && ctl->mixer_left->rotator_mode &&
		!ctl->perf_release_ctl_bw)
			return PERF_STATUS_DONE;

	/*
	 * If Video Mode or not valid data to determine the status, return busy
	 * status, so the bandwidth cannot be freed by the caller
@@ -1027,6 +1038,14 @@ static int mdss_mdp_select_clk_lvl(struct mdss_mdp_ctl *ctl,
	return clk_rate;
}

static void mdss_mdp_perf_release_ctl_bw(struct mdss_mdp_ctl *ctl,
	struct mdss_mdp_perf_params *perf)
{
	/* Set to zero controller bandwidth. */
	memset(perf, 0, sizeof(*perf));
	ctl->perf_release_ctl_bw = false;
}

static void mdss_mdp_ctl_perf_update(struct mdss_mdp_ctl *ctl,
		int params_changed)
{
@@ -1051,7 +1070,9 @@ static void mdss_mdp_ctl_perf_update(struct mdss_mdp_ctl *ctl,
	is_bw_released = !mdss_mdp_ctl_perf_get_transaction_status(ctl);

	if (ctl->power_on) {
		if (is_bw_released || params_changed)
		if (ctl->perf_release_ctl_bw)
			mdss_mdp_perf_release_ctl_bw(ctl, new);
		else if (is_bw_released || params_changed)
			mdss_mdp_perf_calc_ctl(ctl, new);
		/*
		 * if params have just changed delay the update until
@@ -1616,6 +1637,7 @@ struct mdss_mdp_ctl *mdss_mdp_ctl_init(struct mdss_panel_data *pdata,
	ctl->mfd = mfd;
	ctl->panel_data = pdata;
	ctl->is_video_mode = false;
	ctl->perf_release_ctl_bw = false;

	switch (pdata->panel_info.type) {
	case EDP_PANEL:
+3 −0
Original line number Diff line number Diff line
@@ -466,6 +466,9 @@ static int mdss_mdp_wb_wait4comp(struct mdss_mdp_ctl *ctl, void *arg)

	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false); /* clock off */

	/* Set flag to release Controller Bandwidth */
	ctl->perf_release_ctl_bw = true;

	ctx->comp_cnt--;

	return rc;