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

Commit d0504465 authored by Jeykumar Sankaran's avatar Jeykumar Sankaran
Browse files

msm: mdss: dsi: Share panel alignment restrictions through sysfs node



Read panel alignment restrictions on left, top, width and height values of
the updating ROI from the dtsi file and share through sysfs node.
Framework needs these details for configuring MDP for certain
features (e.g. Partial frame update).

Change-Id: Ibe6973b721bb20120a6d7a217bad2d0d159cc836
Signed-off-by: default avatarJeykumar Sankaran <jsanka@codeaurora.org>
parent de9a0741
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -288,6 +288,8 @@ Optional properties:
- qcom,mdss-dsi-rx-eot-ignore:		Boolean used to enable ignoring end of transmission packets.
- qcom,mdss-dsi-tx-eot-append:		Boolean used to enable appending end of transmission packets.
- qcom,ulps-enabled:			Boolean to enable support for Ultra Low Power State (ULPS) mode.
- qcom,panel-roi-alignment:		Specifies the panel ROI alignment restrictions on its
					left, top, width and height values

Note, if a given optional qcom,* binding is not present, then the driver will configure
the default values specified.
@@ -392,5 +394,6 @@ Example:
		mdss-dsi-rx-eot-ignore;
		mdss-dsi-tx-eot-append;
		qcom,ulps-enabled;
		qcom,panel-roi-alignment = <4 4 2 2>;
	};
};
+31 −0
Original line number Diff line number Diff line
@@ -737,6 +737,35 @@ static int mdss_dsi_parse_reset_seq(struct device_node *np,
	return 0;
}

static void mdss_dsi_parse_roi_alignment(struct device_node *np,
		struct mdss_panel_info *pinfo)
{
	int len = 0;
	u32 value[4];
	struct property *data;
	data = of_find_property(np, "qcom,panel-roi-alignment", &len);
	len /= sizeof(u32);
	if (!data || (len != 4)) {
		pr_debug("%s: Panel roi alignment not found", __func__);
	} else {
		int rc = of_property_read_u32_array(np,
				"qcom,panel-roi-alignment", value, len);
		if (rc)
			pr_debug("%s: Error reading panel roi alignment values",
					__func__);
		else {
			pinfo->xstart_pix_align = value[0];
			pinfo->width_pix_align = value[1];
			pinfo->ystart_pix_align = value[2];
			pinfo->height_pix_align = value[3];
		}

		pr_debug("%s: coordinate rules: [%d, %d, %d, %d]", __func__,
			pinfo->xstart_pix_align, pinfo->width_pix_align,
			pinfo->ystart_pix_align, pinfo->height_pix_align);
	}
}

static int mdss_dsi_parse_panel_features(struct device_node *np,
	struct mdss_dsi_ctrl_pdata *ctrl)
{
@@ -1027,6 +1056,8 @@ static int mdss_panel_parse_dt(struct device_node *np,
	rc = of_property_read_u32(np, "qcom,mdss-dsi-init-delay-us", &tmp);
	pinfo->mipi.init_delay = (!rc ? tmp : 0);

	mdss_dsi_parse_roi_alignment(np, pinfo);

	mdss_dsi_parse_trigger(np, &(pinfo->mipi.mdp_trigger),
		"qcom,mdss-dsi-mdp-trigger");

+19 −0
Original line number Diff line number Diff line
@@ -382,12 +382,30 @@ static ssize_t mdss_fb_get_idle_notify(struct device *dev,
	return ret;
}

static ssize_t mdss_fb_get_panel_info(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct msm_fb_data_type *mfd = fbi->par;
	struct mdss_panel_info *pinfo = mfd->panel_info;
	int ret;

	ret = scnprintf(buf, PAGE_SIZE,
			"pu_en=%d\nxalign=%d\nwalign=%d\nystart=%d\nhalign=%d",
			pinfo->partial_update_enabled, pinfo->xstart_pix_align,
			pinfo->width_pix_align, pinfo->ystart_pix_align,
			pinfo->height_pix_align);

	return ret;
}

static DEVICE_ATTR(msm_fb_type, S_IRUGO, mdss_fb_get_type, NULL);
static DEVICE_ATTR(msm_fb_split, S_IRUGO, mdss_fb_get_split, NULL);
static DEVICE_ATTR(show_blank_event, S_IRUGO, mdss_mdp_show_blank_event, NULL);
static DEVICE_ATTR(idle_time, S_IRUGO | S_IWUSR | S_IWGRP,
	mdss_fb_get_idle_time, mdss_fb_set_idle_time);
static DEVICE_ATTR(idle_notify, S_IRUGO, mdss_fb_get_idle_notify, NULL);
static DEVICE_ATTR(msm_fb_panel_info, S_IRUGO, mdss_fb_get_panel_info, NULL);

static struct attribute *mdss_fb_attrs[] = {
	&dev_attr_msm_fb_type.attr,
@@ -395,6 +413,7 @@ static struct attribute *mdss_fb_attrs[] = {
	&dev_attr_show_blank_event.attr,
	&dev_attr_idle_time.attr,
	&dev_attr_idle_notify.attr,
	&dev_attr_msm_fb_panel_info.attr,
	NULL,
};

+4 −0
Original line number Diff line number Diff line
@@ -320,6 +320,10 @@ struct mdss_panel_info {
	char dfps_update;
	int new_fps;
	u32 mode_gpio_state;
	u32 xstart_pix_align;
	u32 width_pix_align;
	u32 ystart_pix_align;
	u32 height_pix_align;

	u32 cont_splash_enabled;
	u32 partial_update_enabled;