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

Commit 6f178983 authored by Anurag Singh's avatar Anurag Singh Committed by Aravind Venkateswaran
Browse files

msm: mdss: restore mdss register when clocks are turned on



When MDSS idle power collapse feature is enabled, MDSS GDSC can be
turned off for idle screen usecases. As a result, whenever MDSS
GDSC is turned back on, all MDSS registers need to be restored.
Current implementation restores this as part of bus bandwidth control
API which is only called whenever interface clocks are turned on.
However, the correct approach is to restore the hardware state whenever
any new register programming needs to be done. Therefore, move the
call to restore MDSS state from the bus bandwidth control function over
to the MDSS clock control function.

Change-Id: I85c934b8050b217253be98d9630ef922e76b6216
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
parent 408d933c
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -862,7 +862,6 @@ void mdss_bus_bandwidth_ctrl(int enable)
			pm_runtime_put(&mdata->pdev->dev);
		} else {
			pm_runtime_get_sync(&mdata->pdev->dev);
			mdss_mdp_idle_pc_restore();
			msm_bus_scale_client_update_request(
				mdata->bus_hdl, mdata->curr_bw_uc_idx);
		}
@@ -914,6 +913,9 @@ void mdss_mdp_clk_ctrl(int enable)
	}

	mutex_unlock(&mdp_clk_lock);

	if (enable && changed)
		mdss_mdp_idle_pc_restore();
}

static inline int mdss_mdp_irq_clk_register(struct mdss_data_type *mdata,
@@ -1161,13 +1163,20 @@ static void mdss_hw_rev_init(struct mdss_data_type *mdata)
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
}

/**
 * mdss_hw_init() - Initialize MDSS target specific register settings
 * @mdata: MDP private data
 *
 * Initialize basic MDSS hardware settings based on the board specific
 * parameters. This function does not explicitly turn on the MDP clocks
 * and so it must be called with the MDP clocks already enabled.
 */
int mdss_hw_init(struct mdss_data_type *mdata)
{
	int i, j;
	char *offset;
	struct mdss_mdp_pipe *vig;

	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
	mdss_hw_rev_init(mdata);

	/* disable hw underrun recovery */
@@ -1209,7 +1218,6 @@ int mdss_hw_init(struct mdss_data_type *mdata)
		for (i = 0; i < mdata->nvig_pipes; i++)
			mdss_mdp_hscl_init(&vig[i]);

	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
	pr_debug("MDP hw init done\n");

	return 0;
+4 −1
Original line number Diff line number Diff line
@@ -1189,6 +1189,8 @@ int mdss_mdp_overlay_start(struct msm_fb_data_type *mfd)

	pr_debug("starting fb%d overlay\n", mfd->index);

	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);

	/*
	 * If idle pc feature is not enabled, then get a reference to the
	 * runtime device which will be released when overlay is turned off
@@ -1215,7 +1217,7 @@ int mdss_mdp_overlay_start(struct msm_fb_data_type *mfd)
			rc = mdss_iommu_ctrl(1);
			if (IS_ERR_VALUE(rc)) {
				pr_err("iommu attach failed rc=%d\n", rc);
				return rc;
				goto end;
			}
			mdss_hw_init(mdss_res);
			mdss_iommu_ctrl(0);
@@ -1246,6 +1248,7 @@ ctl_error:
	atomic_dec(&mdp5_data->mdata->active_intf_cnt);
	mdp5_data->ctl = NULL;
end:
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
	return rc;
}