From 0adca3fb721e76116d0e41be2b800d3f4eb10309 Mon Sep 17 00:00:00 2001 From: Xiaowen Wu Date: Thu, 1 Aug 2019 11:02:10 -0400 Subject: [PATCH 1/2] drm/msm/dsi-staging: decouple label and display type for DSI DSI driver requires label and display type to be the same, which introduces the limitation that only DSI display can be the primary display. This change will decouple the label and display type to allow other display to set to primary. Change-Id: Ibff404ddc9927c239420861af6bce025ced340cc Signed-off-by: Xiaowen Wu --- drivers/gpu/drm/msm/dsi-staging/dsi_display.c | 18 ++++-------------- drivers/gpu/drm/msm/dsi-staging/dsi_display.h | 2 ++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c index bc346173b19d..30bdaaa02006 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c @@ -3647,7 +3647,7 @@ static int dsi_display_res_init(struct dsi_display *display) display->panel = dsi_panel_get(&display->pdev->dev, display->panel_of, display->parser_node, - display->display_type, + display->dsi_type, display->cmdline_topology); if (IS_ERR_OR_NULL(display->panel)) { rc = PTR_ERR(display->panel); @@ -5265,7 +5265,6 @@ int dsi_display_dev_probe(struct platform_device *pdev) for (i = 0; i < count; i++) { struct device_node *np; - const char *disp_type = NULL; np = of_parse_phandle(node, disp_list, i); name = of_get_property(np, "label", NULL); @@ -5274,16 +5273,6 @@ int dsi_display_dev_probe(struct platform_device *pdev) continue; } - disp_type = of_get_property(np, "qcom,display-type", NULL); - if (!disp_type) { - pr_err("display type not defined for %s\n", name); - continue; - } - - /* primary/secondary display should match with current dsi */ - if (strcmp(dsi_type, disp_type)) - continue; - if (boot_disp->boot_disp_en) { if (!strcmp(boot_disp->name, name)) { disp_node = np; @@ -5313,6 +5302,7 @@ int dsi_display_dev_probe(struct platform_device *pdev) display->name = name; display->pdev = pdev; display->boot_disp = boot_disp; + display->dsi_type = dsi_type; dsi_display_parse_cmdline_topology(display, index); @@ -5539,7 +5529,7 @@ static int dsi_display_ext_get_info(struct drm_connector *connector, info->is_connected = connector->status != connector_status_disconnected; - if (!strcmp(display->display_type, "primary")) + if (!strcmp(display->dsi_type, "primary")) info->is_primary = true; else info->is_primary = false; @@ -5901,7 +5891,7 @@ int dsi_display_get_info(struct drm_connector *connector, info->is_connected = true; info->is_primary = false; - if (!strcmp(display->display_type, "primary")) + if (!strcmp(display->dsi_type, "primary")) info->is_primary = true; info->width_mm = phy_props.panel_width_mm; diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.h b/drivers/gpu/drm/msm/dsi-staging/dsi_display.h index 1eef2fa5aa03..2fbb9142efef 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.h +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.h @@ -147,6 +147,7 @@ struct dsi_display_ext_bridge { * @ext_conn: Pointer to external connector attached to DSI connector * @name: Name of the display. * @display_type: Display type as defined in device tree. + * @dsi_type: Display label as defined in device tree. * @list: List pointer. * @is_active: Is display active. * @is_cont_splash_enabled: Is continuous splash enabled @@ -198,6 +199,7 @@ struct dsi_display { const char *name; const char *display_type; + const char *dsi_type; struct list_head list; bool is_cont_splash_enabled; bool sw_te_using_wd; From 5478828c3206e12f1c2347c9290dbc28cffd9567 Mon Sep 17 00:00:00 2001 From: Xiaowen Wu Date: Thu, 1 Aug 2019 11:35:42 -0400 Subject: [PATCH 2/2] drm/msm/shd: add display-type support in shared display Add display-type support in shared display to support shared display as primary display. Change-Id: I2e64935b064344ce9e567b0ce0a6981784dbc071 Signed-off-by: Xiaowen Wu --- drivers/gpu/drm/msm/shd/shd_drm.c | 8 ++++++++ drivers/gpu/drm/msm/shd/shd_drm.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/msm/shd/shd_drm.c b/drivers/gpu/drm/msm/shd/shd_drm.c index 738ba982b40c..6ef8a524bf00 100644 --- a/drivers/gpu/drm/msm/shd/shd_drm.c +++ b/drivers/gpu/drm/msm/shd/shd_drm.c @@ -687,6 +687,9 @@ static int shd_conn_set_info_blob(struct drm_connector *connector, sde_kms_info_add_keyint(info, "max_blendstages", shd_display->stage_range.size); + sde_kms_info_add_keystr(info, "display type", + shd_display->display_type); + return 0; } @@ -1120,6 +1123,11 @@ static int shd_parse_display(struct shd_display *display) display->stage_range.start, display->stage_range.size); + display->display_type = of_get_property(of_node, + "qcom,display-type", NULL); + if (!display->display_type) + display->display_type = "unknown"; + error: return rc; } diff --git a/drivers/gpu/drm/msm/shd/shd_drm.h b/drivers/gpu/drm/msm/shd/shd_drm.h index 03aa95e511d8..35a927861358 100644 --- a/drivers/gpu/drm/msm/shd/shd_drm.h +++ b/drivers/gpu/drm/msm/shd/shd_drm.h @@ -53,6 +53,7 @@ struct shd_display_base { struct shd_display { struct drm_device *drm_dev; const char *name; + const char *display_type; struct shd_display_base *base; struct drm_bridge *bridge;