msm: mdss: Handle null panel name configuration

LK sends default panel parameter string through
kernel command line argument if auto detection
fails or display is not enabled. DSI driver probe
is failing to parse this panel parameter passed by
LK. With this change, DSI driver will select the
preferred primary panel configured in dtsi if
it parsing fails.

Change-Id: Ief4804ae2cc10abf74317d64fb1b889bd41228d2
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This commit is contained in:
Dhaval Patel 2013-12-11 21:54:09 -08:00
parent 155357d0bb
commit e1b489ad53
4 changed files with 60 additions and 27 deletions

View file

@ -1221,6 +1221,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
@ -1250,14 +1265,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",
@ -1285,7 +1293,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;

View file

@ -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;
return rc;
}
get_dt_pan:
rc = mdp3_parse_dt_pan_intf(pdev);

View file

@ -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;
}

View file

@ -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;
return rc;
}
get_dt_pan:
rc = mdss_mdp_parse_dt_pan_intf(pdev);