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

Commit fc52d8a9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: add support to enable idle power collapse"

parents 4792b11a f6895979
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -407,6 +407,9 @@ Subnode properties:
					screen feature and has no relation with
					qcom,cont-splash-enabled entry present in
					panel configuration.
- qcom,mdss-idle-power-collapse-enabled: Boolean property that enables support
					for mdss power collapse in idle
					screen use cases with smart panels.

Example:
	mdss_mdp: qcom,mdss_mdp@fd900000 {
@@ -519,6 +522,7 @@ Example:
		qcom,mdss-prefill-post-scaler-buffer-pixels = <2048>;
		qcom,mdss-prefill-pingpong-buffer-pixels = <5120>;
		qcom,mdss-prefill-fbc-lines = <2>;
		qcom,mdss-idle-power-collapse-enabled;

		mdss_fb0: qcom,mdss_fb_primary {
			cell-index = <0>;
+2 −1
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ struct mdss_data_type {
	u8 has_wb_ad;
	u8 has_non_scalar_rgb;
	bool has_src_split;
	bool idle_pc_enabled;

	u32 rotator_ot_limit;
	u32 mdp_irq_mask;
@@ -209,7 +210,7 @@ struct mdss_data_type {
	struct mdss_prefill_data prefill_data;

	int handoff_pending;
	bool ulps;
	bool idle_pc;
	struct mdss_perf_tune perf_tune;
};
extern struct mdss_data_type *mdss_res;
+12 −10
Original line number Diff line number Diff line
@@ -2452,6 +2452,9 @@ static int mdss_mdp_parse_dt_misc(struct platform_device *pdev)

	mdata->has_src_split = of_property_read_bool(pdev->dev.of_node,
		 "qcom,mdss-has-source-split");
	mdata->idle_pc_enabled = of_property_read_bool(pdev->dev.of_node,
		 "qcom,mdss-idle-power-collapse-enabled");

	prop = of_find_property(pdev->dev.of_node, "batfet-supply", NULL);
	mdata->batfet_required = prop ? true : false;
	rc = of_property_read_u32(pdev->dev.of_node,
@@ -2771,7 +2774,7 @@ static void mdss_mdp_footswitch_ctrl(struct mdss_data_type *mdata, int on)
			ret = regulator_enable(mdata->fs);
			if (ret)
				pr_err("Footswitch failed to enable\n");
			if (!mdata->ulps) {
			if (!mdata->idle_pc) {
				mdss_mdp_cx_ctrl(mdata, true);
				mdss_mdp_batfet_ctrl(mdata, true);
			}
@@ -2782,7 +2785,7 @@ static void mdss_mdp_footswitch_ctrl(struct mdss_data_type *mdata, int on)
		mdss_iommu_dettach(mdata);
		if (mdata->fs_ena) {
			regulator_disable(mdata->fs);
			if (!mdata->ulps) {
			if (!mdata->idle_pc) {
				mdss_mdp_cx_ctrl(mdata, false);
				mdss_mdp_batfet_ctrl(mdata, false);
			}
@@ -2792,17 +2795,16 @@ static void mdss_mdp_footswitch_ctrl(struct mdss_data_type *mdata, int on)
}

/**
 * mdss_mdp_footswitch_ctrl_ulps() - MDSS GDSC control with ULPS feature
 * mdss_mdp_footswitch_ctrl_idle_pc() - MDSS GDSC control with idle power collapse
 * @on: 1 to turn on footswitch, 0 to turn off footswitch
 * @dev: framebuffer device node
 *
 * MDSS GDSC can be voted off during idle-screen usecase for MIPI DSI command
 * mode displays with Ultra-Low Power State (ULPS) feature enabled. Upon
 * subsequent frame update, MDSS GDSC needs to turned back on and hw state
 * needs to be restored. It returns error if footswitch control API
 * fails.
 * mode displays. Upon subsequent frame update, MDSS GDSC needs to turned back
 * on and hw state needs to be restored. It returns error if footswitch control
 * API fails.
 */
int mdss_mdp_footswitch_ctrl_ulps(int on, struct device *dev)
int mdss_mdp_footswitch_ctrl_idle_pc(int on, struct device *dev)
{
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
	int rc = 0;
@@ -2816,9 +2818,9 @@ int mdss_mdp_footswitch_ctrl_ulps(int on, struct device *dev)
			goto end;
		}
		mdss_hw_init(mdata);
		mdata->ulps = false;
		mdata->idle_pc = false;
	} else {
		mdata->ulps = true;
		mdata->idle_pc = true;
		pm_runtime_put_sync(dev);
	}

+1 −1
Original line number Diff line number Diff line
@@ -784,7 +784,7 @@ int mdss_mdp_pipe_program_pixel_extn(struct mdss_mdp_pipe *pipe);
int mdss_mdp_wb_set_secure(struct msm_fb_data_type *mfd, int enable);
int mdss_mdp_wb_get_secure(struct msm_fb_data_type *mfd, uint8_t *enable);
void mdss_mdp_ctl_restore(struct mdss_mdp_ctl *ctl);
int mdss_mdp_footswitch_ctrl_ulps(int on, struct device *dev);
int mdss_mdp_footswitch_ctrl_idle_pc(int on, struct device *dev);

#define mfd_to_mdp5_data(mfd) (mfd->mdp.private1)
#define mfd_to_mdata(mfd) (((struct mdss_overlay_private *)\
+6 −2
Original line number Diff line number Diff line
@@ -382,6 +382,7 @@ static void clk_ctrl_work(struct work_struct *work)
static void __mdss_mdp_cmd_ulps_work(struct work_struct *work)
{
	struct delayed_work *dw = to_delayed_work(work);
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
	struct mdss_mdp_cmd_ctx *ctx =
		container_of(dw, struct mdss_mdp_cmd_ctx, ulps_work);

@@ -406,8 +407,11 @@ static void __mdss_mdp_cmd_ulps_work(struct work_struct *work)
	if (!mdss_mdp_ctl_intf_event(ctx->ctl, MDSS_EVENT_DSI_ULPS_CTRL,
		(void *)1)) {
		ctx->ulps = true;
		if (mdata->idle_pc_enabled) {
			ctx->ctl->play_cnt = 0;
		mdss_mdp_footswitch_ctrl_ulps(0, &ctx->ctl->mfd->pdev->dev);
			mdss_mdp_footswitch_ctrl_idle_pc(0,
				&ctx->ctl->mfd->pdev->dev);
		}
	}
}

Loading