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

Commit 16fffd7a authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: switch mdp context between active-only and active+sleep



This change modifies MDP vote to go to Active-Only in
an early stage when bandwidth is not needed and updates
the vote to Active+Sleep when bandwidth must be guaranteed.

Change-Id: I6ccb7a225f97416128518c990d881fa139ec1963
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 534e3f6f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -315,6 +315,7 @@ struct mdss_data_type {
	u32 nrt_axi_port_cnt;
	u32 bus_channels;
	u32 curr_bw_uc_idx;
	u32 ao_bw_uc_idx; /* active only idx */
	struct msm_bus_scale_pdata *bus_scale_table;
	u32 max_bw_low;
	u32 max_bw_high;
+15 −1
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ static int mdss_mdp_bus_scale_set_quota(u64 ab_quota_rt, u64 ab_quota_nrt,
		}
	}
	mdss_res->curr_bw_uc_idx = new_uc_idx;
	mdss_res->ao_bw_uc_idx = new_uc_idx;

	if ((mdss_res->bus_ref_cnt == 0) && mdss_res->curr_bw_uc_idx) {
		rc = 0;
@@ -832,9 +833,11 @@ void mdss_bus_bandwidth_ctrl(int enable)

	if (changed) {
		if (!enable) {
			if (!mdata->handoff_pending)
			if (!mdata->handoff_pending) {
				msm_bus_scale_client_update_request(
						mdata->bus_hdl, 0);
				mdata->ao_bw_uc_idx = 0;
			}
			pm_runtime_mark_last_busy(&mdata->pdev->dev);
			pm_runtime_put_autosuspend(&mdata->pdev->dev);
		} else {
@@ -879,8 +882,13 @@ void mdss_mdp_clk_ctrl(int enable)
	if (changed) {
		if (enable) {
			pm_runtime_get_sync(&mdata->pdev->dev);

			mdss_update_reg_bus_vote(mdata->reg_bus_clt,
				VOTE_INDEX_19_MHZ);

			/* Active+Sleep */
			msm_bus_scale_client_update_context(mdata->bus_hdl,
				false, mdata->curr_bw_uc_idx);
		}

		mdata->clk_ena = enable;
@@ -892,8 +900,14 @@ void mdss_mdp_clk_ctrl(int enable)
			mdss_mdp_clk_update(MDSS_CLK_MDP_VSYNC, enable);

		if (!enable) {

			/* Active-Only */
			msm_bus_scale_client_update_context(mdata->bus_hdl,
				true, mdata->ao_bw_uc_idx);

			mdss_update_reg_bus_vote(mdata->reg_bus_clt,
				VOTE_INDEX_DISABLE);

			pm_runtime_mark_last_busy(&mdata->pdev->dev);
			pm_runtime_put_autosuspend(&mdata->pdev->dev);
		}
+3 −0
Original line number Diff line number Diff line
@@ -485,6 +485,9 @@ int mdss_mdp_resource_control(struct mdss_mdp_ctl *ctl, u32 sw_event)
		 *	cancel as well.
		 */

		/* update the active only vote */
		mdata->ao_bw_uc_idx = mdata->curr_bw_uc_idx;

		/* Cancel GATE Work Item */
		if (cancel_work_sync(&ctx->gate_clk_work)) {
			pr_debug("%s gate work canceled\n", __func__);