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

Commit ce278e37 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: configure panel split based on configuration"

parents c5b853e8 587ae26f
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -274,16 +274,27 @@ static ssize_t mdss_fb_get_type(struct device *dev,
	return ret;
}

static int mdss_fb_get_panel_xres(struct mdss_panel_info *pinfo)
{
	struct mdss_panel_data *pdata;
	int xres;

	pdata = container_of(pinfo, struct mdss_panel_data, panel_info);

	xres = pinfo->xres;
	if (pdata->next)
		xres += mdss_fb_get_panel_xres(&pdata->next->panel_info);

	return xres;
}

static inline int mdss_fb_validate_split(int left, int right,
			struct msm_fb_data_type *mfd)
{
	int rc = -EINVAL;
	u32 panel_xres = mfd->panel_info->xres;
	u32 panel_xres = mdss_fb_get_panel_xres(mfd->panel_info);
	/* more validate condition could be added if needed */
	if (left && right) {
		if (is_panel_split(mfd))
			panel_xres *= 2;

		if (panel_xres == left + right) {
			mfd->split_fb_left = left;
			mfd->split_fb_right = right;
@@ -291,7 +302,8 @@ static inline int mdss_fb_validate_split(int left, int right,
		}
	} else {
		if (is_split_lm(mfd)) {
			mfd->split_fb_left = mfd->split_fb_right = panel_xres;
			mfd->split_fb_left = mfd->panel_info->xres;
			mfd->split_fb_right = panel_xres - mfd->split_fb_left;
			rc = 0;
		} else {
			mfd->split_fb_left = mfd->split_fb_right = 0;
@@ -1767,9 +1779,7 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
		return ret;
	}

	var->xres = panel_info->xres;
	if (is_panel_split(mfd))
		var->xres *= 2;
	var->xres = mdss_fb_get_panel_xres(panel_info);

	fix->type = panel_info->is_3d_panel;
	if (mfd->mdp.fb_stride)