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

Commit 8c750d7e 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: dsi: Share panel alignment restrictions through sysfs node"

parents b81df7a8 d0504465
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
@@ -758,6 +758,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)
{
@@ -1048,6 +1077,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;