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

Commit 52a1ea5c authored by Ujwal Patel's avatar Ujwal Patel Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: add support to change border color through debugfs



During blending operation, bottom color is known as border color and it
is same size as mixer dimensions. Default color is black but it can be
configured to different color. This is very useful for debugging purpose.
Add support to program border-color through debugfs as per following
guidelines.

echo code > <debugfs>/mdp/bordercolor/colorN
where
    code: 12bit color value in decimal
    colorN: color0, color1, color2

Change-Id: Ia3e8791713f5aa309a95c867445995ced028dd8d
Signed-off-by: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent 778e9ce1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -415,6 +415,10 @@ struct mdss_data_type {
	struct mdss_max_bw_settings *max_bw_settings;
	u32 bw_mode_bitmap;
	u32 max_bw_settings_cnt;

	u32 bcolor0;
	u32 bcolor1;
	u32 bcolor2;
};
extern struct mdss_data_type *mdss_res;

+7 −0
Original line number Diff line number Diff line
@@ -1095,6 +1095,13 @@ int mdss_debugfs_init(struct mdss_data_type *mdata)
		goto err;
	}

	mdd->bordercolor = debugfs_create_dir("bordercolor", mdd->root);
	if (IS_ERR_OR_NULL(mdd->root)) {
		pr_err("debugfs_create_dir for mdp failed, error %ld\n",
		       PTR_ERR(mdd->root));
		goto err;
	}

	mdss_debugfs_perf_init(mdd, mdata);

	if (mdss_create_xlog_debug(mdd))
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ struct mdss_debug_base {
struct mdss_debug_data {
	struct dentry *root;
	struct dentry *perf;
	struct dentry *bordercolor;
	struct list_head base_list;
};

+10 −2
Original line number Diff line number Diff line
@@ -3647,15 +3647,23 @@ update_mixer:
		mixer_op_mode |= BIT(31);

	mdp_mixer_write(mixer, MDSS_MDP_REG_LM_OP_MODE, mixer_op_mode);

	mdp_mixer_write(mixer, MDSS_MDP_REG_LM_BORDER_COLOR_0,
		(mdata->bcolor0 & 0xFFF) | ((mdata->bcolor1 & 0xFFF) << 16));
	mdp_mixer_write(mixer, MDSS_MDP_REG_LM_BORDER_COLOR_1,
		mdata->bcolor2 & 0xFFF);

	off = __mdss_mdp_ctl_get_mixer_off(mixer);
	mdss_mdp_ctl_write(ctl, off, mixercfg);
	/* Program ctl layer extension bits */
	mdss_mdp_ctl_write(ctl, off + MDSS_MDP_REG_CTL_LAYER_EXTN_OFFSET,
		mixercfg_extn);

	pr_debug("mixer=%d cfg=0%08x cfg_extn=0x%08x op_mode=0x%08x w=%d h=%d\n",
	pr_debug("mixer=%d cfg=0%08x cfg_extn=0x%08x op_mode=0x%08x w=%d h=%d bc0=0x%x bc1=0x%x\n",
		mixer->num, mixercfg, mixercfg_extn,
		mixer_op_mode, mixer->roi.w, mixer->roi.h);
		mixer_op_mode, mixer->roi.w, mixer->roi.h,
		(mdata->bcolor0 & 0xFFF) | ((mdata->bcolor1 & 0xFFF) << 16),
		mdata->bcolor2 & 0xFFF);
	MDSS_XLOG(mixer->num, mixercfg, mixercfg_extn, mixer_op_mode,
		mixer->roi.h, mixer->roi.w);
}
+7 −0
Original line number Diff line number Diff line
@@ -389,6 +389,13 @@ int mdss_mdp_debugfs_init(struct mdss_data_type *mdata)
	debugfs_create_bool("serialize_wait4pp", 0644, mdd->root,
		(u32 *)&mdata->serialize_wait4pp);

	debugfs_create_u32("color0", 0644, mdd->bordercolor,
		(u32 *)&mdata->bcolor0);
	debugfs_create_u32("color1", 0644, mdd->bordercolor,
		(u32 *)&mdata->bcolor1);
	debugfs_create_u32("color2", 0644, mdd->bordercolor,
		(u32 *)&mdata->bcolor2);

	return 0;
}
#endif