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

Commit 2d617607 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: Handle null panel name configuration"

parents 3fdb88fc e1b489ad
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -1307,6 +1307,21 @@ static int dsi_get_panel_cfg(char *panel_cfg)
	return rc;
}

static struct device_node *dsi_pref_prim_panel(
		struct platform_device *pdev)
{
	struct device_node *dsi_pan_node = NULL;

	pr_debug("%s:%d: Select primary panel from dt\n",
					__func__, __LINE__);
	dsi_pan_node = of_parse_phandle(pdev->dev.of_node,
					"qcom,dsi-pref-prim-pan", 0);
	if (!dsi_pan_node)
		pr_err("%s:can't find panel phandle\n", __func__);

	return dsi_pan_node;
}

/**
 * dsi_find_panel_of_node(): find device node of dsi panel
 * @pdev: platform_device of the dsi ctrl node
@@ -1336,14 +1351,7 @@ static struct device_node *dsi_find_panel_of_node(
		/* no panel cfg chg, parse dt */
		pr_debug("%s:%d: no cmd line cfg present\n",
			 __func__, __LINE__);
		dsi_pan_node = of_parse_phandle(
			pdev->dev.of_node,
			"qcom,dsi-pref-prim-pan", 0);
		if (!dsi_pan_node) {
			pr_err("%s:can't find panel phandle\n",
			       __func__);
			return NULL;
		}
		dsi_pan_node = dsi_pref_prim_panel(pdev);
	} else {
		if (panel_cfg[0] != '0') {
			pr_err("%s:%d:ctrl id=[%d] not supported\n",
@@ -1371,7 +1379,7 @@ static struct device_node *dsi_find_panel_of_node(
		if (!dsi_pan_node) {
			pr_err("%s: invalid pan node\n",
			       __func__);
			return NULL;
			dsi_pan_node = dsi_pref_prim_panel(pdev);
		}
	}
	return dsi_pan_node;
+12 −4
Original line number Diff line number Diff line
@@ -949,7 +949,7 @@ static int mdp3_get_pan_cfg(struct mdss_panel_cfg *pan_cfg)
{
	char *t = NULL;
	char pan_intf_str[MDSS_MAX_PANEL_LEN];
	int rc, i;
	int rc, i, panel_len;
	char pan_name[MDSS_MAX_PANEL_LEN];

	if (!pan_cfg)
@@ -986,6 +986,14 @@ static int mdp3_get_pan_cfg(struct mdss_panel_cfg *pan_cfg)
	strlcpy(&pan_cfg->arg_cfg[0], t, sizeof(pan_cfg->arg_cfg));
	pr_debug("%s:%d: t=[%s] panel name=[%s]\n", __func__, __LINE__,
		t, pan_cfg->arg_cfg);

	panel_len = strlen(pan_cfg->arg_cfg);
	if (!panel_len) {
		pr_err("%s: Panel name is invalid\n", __func__);
		pan_cfg->pan_intf = MDSS_PANEL_INTF_INVALID;
		return -EINVAL;
	}

	rc = mdp3_get_pan_intf(pan_intf_str);
	pan_cfg->pan_intf = (rc < 0) ?  MDSS_PANEL_INTF_INVALID : rc;
	return 0;
@@ -1069,10 +1077,10 @@ static int mdp3_parse_bootarg(struct platform_device *pdev)
	of_node_put(chosen_node);

	rc = mdp3_get_pan_cfg(pan_cfg);
	if (!rc)
	if (!rc) {
		pan_cfg->init_done = true;

		return rc;
	}

get_dt_pan:
	rc = mdp3_parse_dt_pan_intf(pdev);
+19 −10
Original line number Diff line number Diff line
@@ -783,6 +783,21 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
	return rc;
}

static struct device_node *mdss_dsi_pref_prim_panel(
		struct platform_device *pdev)
{
	struct device_node *dsi_pan_node = NULL;

	pr_debug("%s:%d: Select primary panel from dt\n",
					__func__, __LINE__);
	dsi_pan_node = of_parse_phandle(pdev->dev.of_node,
					"qcom,dsi-pref-prim-pan", 0);
	if (!dsi_pan_node)
		pr_err("%s:can't find panel phandle\n", __func__);

	return dsi_pan_node;
}

/**
 * mdss_dsi_find_panel_of_node(): find device node of dsi panel
 * @pdev: platform_device of the dsi ctrl node
@@ -810,14 +825,7 @@ static struct device_node *mdss_dsi_find_panel_of_node(
		/* no panel cfg chg, parse dt */
		pr_debug("%s:%d: no cmd line cfg present\n",
			 __func__, __LINE__);
		dsi_pan_node = of_parse_phandle(
			pdev->dev.of_node,
			"qcom,dsi-pref-prim-pan", 0);
		if (!dsi_pan_node) {
			pr_err("%s:can't find panel phandle\n",
			       __func__);
			return NULL;
		}
		dsi_pan_node = mdss_dsi_pref_prim_panel(pdev);
	} else {
		if (panel_cfg[0] == '0') {
			pr_debug("%s:%d: DSI ctrl 1\n", __func__, __LINE__);
@@ -850,11 +858,12 @@ static struct device_node *mdss_dsi_find_panel_of_node(
		dsi_pan_node = of_find_node_by_name(mdss_node,
						    panel_name);
		if (!dsi_pan_node) {
			pr_err("%s: invalid pan node\n",
			pr_err("%s: invalid pan node, selecting prim panel\n",
			       __func__);
			return NULL;
			dsi_pan_node = mdss_dsi_pref_prim_panel(pdev);
		}
	}

	return dsi_pan_node;
}

+12 −4
Original line number Diff line number Diff line
@@ -1311,7 +1311,7 @@ static int mdss_mdp_get_pan_cfg(struct mdss_panel_cfg *pan_cfg)
{
	char *t = NULL;
	char pan_intf_str[MDSS_MAX_PANEL_LEN];
	int rc, i;
	int rc, i, panel_len;
	char pan_name[MDSS_MAX_PANEL_LEN];

	if (!pan_cfg)
@@ -1348,6 +1348,14 @@ static int mdss_mdp_get_pan_cfg(struct mdss_panel_cfg *pan_cfg)
	strlcpy(&pan_cfg->arg_cfg[0], t, sizeof(pan_cfg->arg_cfg));
	pr_debug("%s:%d: t=[%s] panel name=[%s]\n", __func__, __LINE__,
		t, pan_cfg->arg_cfg);

	panel_len = strlen(pan_cfg->arg_cfg);
	if (!panel_len) {
		pr_err("%s: Panel name is invalid\n", __func__);
		pan_cfg->pan_intf = MDSS_PANEL_INTF_INVALID;
		return -EINVAL;
	}

	rc = mdss_mdp_get_pan_intf(pan_intf_str);
	pan_cfg->pan_intf = (rc < 0) ?  MDSS_PANEL_INTF_INVALID : rc;
	return 0;
@@ -1452,10 +1460,10 @@ static int mdss_mdp_parse_bootarg(struct platform_device *pdev)
	of_node_put(chosen_node);

	rc = mdss_mdp_get_pan_cfg(pan_cfg);
	if (!rc)
	if (!rc) {
		pan_cfg->init_done = true;

		return rc;
	}

get_dt_pan:
	rc = mdss_mdp_parse_dt_pan_intf(pdev);