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

Commit a710cace 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: Dynamically change writeback path OT"

parents 25ea1182 af77e5e7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -275,6 +275,12 @@ Optional properties:
				   sw_reset register bitmap. Number of offsets
				   defined should match the number of offsets
				   defined in property: qcom,mdss-pipe-dma-off
- qcom,mdss-rotator-ot-limit:	This integer value indicates maximum number of pending
				writes that can be allowed from rotator client. Default
				value is 16 which is the maximum. This value can be
				used to reduce the pending writes limit dynamically
				and can be tuned to match performance requirements
				depending upon system state.

Fudge Factors:			Fudge factors are used to boost demand for
				resources like bus bandswidth, clk rate etc. to
@@ -395,6 +401,7 @@ Example:
						<2 6 7>;
		qcom,mdss-smp-data = <22 4096>;
		qcom,mdss-rot-block-size = <64>;
		qcom,mdss-rotator-ot-limit = <2>;
		qcom,mdss-smp-mb-per-pipe = <2>;
		qcom,mdss-pref-prim-intf = "dsi";
		qcom,mdss-has-bwc;
+1 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ struct mdss_data_type {
	u8 has_wfd_blk;
	u8 has_wb_ad;

	u32 rotator_ot_limit;
	u32 mdp_irq_mask;
	u32 mdp_hist_irq_mask;

+4 −0
Original line number Diff line number Diff line
@@ -2246,6 +2246,10 @@ static int mdss_mdp_parse_dt_misc(struct platform_device *pdev)
		&data);
	mdata->rot_block_size = (!rc ? data : 128);

	rc = of_property_read_u32(pdev->dev.of_node,
		"qcom,mdss-rotator-ot-limit", &data);
	mdata->rotator_ot_limit = (!rc ? data : 0);

	mdata->has_bwc = of_property_read_bool(pdev->dev.of_node,
					       "qcom,mdss-has-bwc");
	mdata->has_decimation = of_property_read_bool(pdev->dev.of_node,
+26 −1
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
 * Hence, set the bits 29:26 in format register, as zero.
 */
#define BWC_FMT_MASK	0xC3FFFFFF
#define VBIF_WR_LIM_CONF    0xC0
#define MDSS_DEFAULT_OT_SETTING    0x10

enum mdss_mdp_writeback_type {
	MDSS_MDP_WRITEBACK_TYPE_ROTATOR,
@@ -40,6 +42,9 @@ struct mdss_mdp_writeback_ctx {
	u32 intr_type;
	u32 intf_num;

	u32 xin_id;
	u32 wr_lim;

	u32 opmode;
	struct mdss_mdp_format_params *dst_fmt;
	u16 width;
@@ -61,26 +66,31 @@ static struct mdss_mdp_writeback_ctx wb_ctx_list[MDSS_MDP_MAX_WRITEBACK] = {
		.type = MDSS_MDP_WRITEBACK_TYPE_ROTATOR,
		.intr_type = MDSS_MDP_IRQ_WB_ROT_COMP,
		.intf_num = 0,
		.xin_id = 3,
	},
	{
		.type = MDSS_MDP_WRITEBACK_TYPE_ROTATOR,
		.intr_type = MDSS_MDP_IRQ_WB_ROT_COMP,
		.intf_num = 1,
		.xin_id = 11,
	},
	{
		.type = MDSS_MDP_WRITEBACK_TYPE_LINE,
		.intr_type = MDSS_MDP_IRQ_WB_ROT_COMP,
		.intf_num = 0,
		.xin_id = 3,
	},
	{
		.type = MDSS_MDP_WRITEBACK_TYPE_LINE,
		.intr_type = MDSS_MDP_IRQ_WB_ROT_COMP,
		.intf_num = 1,
		.xin_id = 11,
	},
	{
		.type = MDSS_MDP_WRITEBACK_TYPE_WFD,
		.intr_type = MDSS_MDP_IRQ_WB_WFD,
		.intf_num = 0,
		.xin_id = 6,
	},
};

@@ -465,9 +475,12 @@ static int mdss_mdp_writeback_display(struct mdss_mdp_ctl *ctl, void *arg)
{
	struct mdss_mdp_writeback_ctx *ctx;
	struct mdss_mdp_writeback_arg *wb_args;
	u32 flush_bits;
	u32 flush_bits, val, off;
	int ret;

	if (!ctl || !ctl->mdata)
		return -ENODEV;

	ctx = (struct mdss_mdp_writeback_ctx *) ctl->priv_data;
	if (!ctx)
		return -ENODEV;
@@ -478,6 +491,18 @@ static int mdss_mdp_writeback_display(struct mdss_mdp_ctl *ctl, void *arg)
		return -EPERM;
	}

	if (ctl->mdata->rotator_ot_limit) {
		if (ctx->type == MDSS_MDP_WRITEBACK_TYPE_ROTATOR)
			ctx->wr_lim = ctl->mdata->rotator_ot_limit;
		else
			ctx->wr_lim = MDSS_DEFAULT_OT_SETTING;
		off = (ctx->xin_id % 4) * 8;
		val = readl_relaxed(ctl->mdata->vbif_base + VBIF_WR_LIM_CONF);
		val &= ~(0xFF << off);
		val |= (ctx->wr_lim) << off;
		writel_relaxed(val, ctl->mdata->vbif_base + VBIF_WR_LIM_CONF);
	}

	wb_args = (struct mdss_mdp_writeback_arg *) arg;
	if (!wb_args)
		return -ENOENT;