mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
disp: msm: dp: parse display_type before connector initialization
dp_parser is only available post connector init, so if parser is not available get display_type from devicetree itself and remove redundant code. Change-Id: I2131a257cb4795f52be1706882dce533baf94600 Signed-off-by: Nilesh Laad <quic_nlaad@quicinc.com>
This commit is contained in:
parent
addbc02b3a
commit
8d79506120
3 changed files with 16 additions and 12 deletions
|
|
@ -3919,6 +3919,7 @@ static int dp_display_get_display_type(struct dp_display *dp_display,
|
|||
const char **display_type)
|
||||
{
|
||||
struct dp_display_private *dp;
|
||||
struct device_node *of_node;
|
||||
|
||||
if (!dp_display || !display_type) {
|
||||
pr_err("invalid input\n");
|
||||
|
|
@ -3928,7 +3929,11 @@ static int dp_display_get_display_type(struct dp_display *dp_display,
|
|||
dp = container_of(dp_display, struct dp_display_private, dp_display);
|
||||
if (dp->parser)
|
||||
*display_type = dp->parser->display_type;
|
||||
|
||||
else {
|
||||
of_node = dp->pdev->dev.of_node;
|
||||
*display_type = of_get_property(of_node, "qcom,display-type",
|
||||
NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -471,6 +471,7 @@ int dp_connector_get_info(struct drm_connector *connector,
|
|||
{
|
||||
struct dp_display *display = data;
|
||||
const char *display_type = NULL;
|
||||
u32 conn_disp_type = SDE_CONNECTOR_PRIMARY;
|
||||
|
||||
if (!info || !display || !display->drm_dev) {
|
||||
DP_ERR("invalid params\n");
|
||||
|
|
@ -480,11 +481,11 @@ int dp_connector_get_info(struct drm_connector *connector,
|
|||
info->intf_type = DRM_MODE_CONNECTOR_DisplayPort;
|
||||
|
||||
display->get_display_type(display, &display_type);
|
||||
if (display_type){
|
||||
if (display_type) {
|
||||
if (!strcmp(display_type, "primary"))
|
||||
info->display_type = SDE_CONNECTOR_PRIMARY;
|
||||
conn_disp_type = SDE_CONNECTOR_PRIMARY;
|
||||
else if (!strcmp(display_type, "secondary"))
|
||||
info->display_type = SDE_CONNECTOR_SECONDARY;
|
||||
conn_disp_type = SDE_CONNECTOR_SECONDARY;
|
||||
}
|
||||
|
||||
info->num_of_h_tiles = 1;
|
||||
|
|
@ -495,7 +496,8 @@ int dp_connector_get_info(struct drm_connector *connector,
|
|||
|
||||
if (display && display->is_edp) {
|
||||
info->intf_type = DRM_MODE_CONNECTOR_eDP;
|
||||
if(display->ext_hpd_en)
|
||||
info->display_type = conn_disp_type;
|
||||
if (display->ext_hpd_en)
|
||||
info->capabilities |= MSM_DISPLAY_CAP_HOT_PLUG;
|
||||
else
|
||||
info->is_connected = true;
|
||||
|
|
|
|||
|
|
@ -178,13 +178,10 @@ static int dp_parser_misc(struct dp_parser *parser)
|
|||
&parser->pixel_base_off[i]);
|
||||
}
|
||||
|
||||
parser->display_type = of_get_property(of_node, "qcom,display-type", NULL);
|
||||
if (!parser->display_type) {
|
||||
if (parser->is_edp)
|
||||
parser->display_type = "primary";
|
||||
else
|
||||
parser->display_type = "secondary";
|
||||
}
|
||||
parser->display_type = of_get_property(of_node, "qcom,display-type",
|
||||
NULL);
|
||||
if (!parser->display_type)
|
||||
parser->display_type = "unknown";
|
||||
|
||||
parser->panel_notifier_support = of_property_read_bool(of_node,
|
||||
"qcom,panel-notifier-support");
|
||||
|
|
|
|||
Loading…
Reference in a new issue