disp: msm: dp: add support of hotplug for eDP interface.

Add for eDP display support pluggable and support eDP as secondary.

Change-Id: I25d153282f08b8db21fdad15d3c971f609cdf49a
Signed-off-by: Boyuan Yan <quic_boyuyan@quicinc.com>
This commit is contained in:
boyuyan 2023-10-20 14:55:19 +08:00 • committed by Boyuan Yan
commit 0f45eca383
6 changed files with 45 additions and 15 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*/
@ -2301,6 +2301,7 @@ static void dp_catalog_hpd_config_hpd(struct dp_catalog_hpd *hpd, bool en)
{
struct dp_catalog_private *catalog;
struct dp_io_data *io_data;
struct dp_parser *parser;
if (!hpd) {
DP_ERR("invalid input\n");
@ -2309,16 +2310,17 @@ static void dp_catalog_hpd_config_hpd(struct dp_catalog_hpd *hpd, bool en)
catalog = dp_catalog_get_priv(hpd);
io_data = catalog->io.dp_aux;
parser = catalog->parser;
if (en) {
u32 reftimer = dp_read(DP_DP_HPD_REFTIMER);
/*
* Arm only the UNPLUG and HPD_IRQ interrupts for DP
* whereas for EDP arm only the HPD_IRQ interrupt
* Arm only the UNPLUG and HPD_IRQ interrupts for DP and pluggable EDP
* whereas for buitin EDP arm only the HPD_IRQ interrupt
*/
dp_write(DP_DP_HPD_INT_ACK, 0xF);
if (hpd->is_edp)
if ((hpd->is_edp) && (!parser->ext_hpd_en))
dp_write(DP_DP_HPD_INT_MASK, 0x2);
else
dp_write(DP_DP_HPD_INT_MASK, 0xA);

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
@ -2120,6 +2120,8 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
goto error;
}
dp->parser->is_edp = dp->dp_display.is_edp;
rc = dp->parser->parse(dp->parser);
if (rc) {
DP_ERR("device tree parsing failed\n");
@ -2130,6 +2132,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
dp->dp_display.dsc_cont_pps = dp->parser->dsc_continuous_pps;
dp->dp_display.no_backlight_support = dp->parser->no_backlight_support;
dp->dp_display.ext_hpd_en = dp->parser->ext_hpd_en;
dp->catalog = dp_catalog_get(dev, dp->parser);
if (IS_ERR(dp->catalog)) {
rc = PTR_ERR(dp->catalog);
@ -3916,8 +3919,8 @@ static int dp_display_get_display_type(struct dp_display *dp_display,
}
dp = container_of(dp_display, struct dp_display_private, dp_display);
*display_type = dp->parser->display_type;
if (dp->parser)
*display_type = dp->parser->display_type;
return 0;
}

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*/
@ -98,6 +98,7 @@ struct dp_display {
u32 max_dsc_count;
bool cont_splash_enabled;
bool no_backlight_support;
bool ext_hpd_en;
int (*enable)(struct dp_display *dp_display, void *panel);
int (*post_enable)(struct dp_display *dp_display, void *panel);

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
@ -470,6 +470,7 @@ int dp_connector_get_info(struct drm_connector *connector,
struct msm_display_info *info, void *data)
{
struct dp_display *display = data;
const char *display_type = NULL;
if (!info || !display || !display->drm_dev) {
DP_ERR("invalid params\n");
@ -478,6 +479,14 @@ 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 (!strcmp(display_type, "primary"))
info->display_type = SDE_CONNECTOR_PRIMARY;
else if (!strcmp(display_type, "secondary"))
info->display_type = SDE_CONNECTOR_SECONDARY;
}
info->num_of_h_tiles = 1;
info->h_tile_instance[0] = 0;
info->is_connected = display->is_sst_connected;
@ -486,8 +495,10 @@ int dp_connector_get_info(struct drm_connector *connector,
if (display && display->is_edp) {
info->intf_type = DRM_MODE_CONNECTOR_eDP;
info->display_type = SDE_CONNECTOR_PRIMARY;
info->is_connected = true;
if(display->ext_hpd_en)
info->capabilities |= MSM_DISPLAY_CAP_HOT_PLUG;
else
info->is_connected = true;
} else {
info->capabilities |= MSM_DISPLAY_CAP_HOT_PLUG;
}
@ -644,6 +655,9 @@ int dp_connector_set_info_blob(struct drm_connector *connector,
dp_display->get_display_type(dp_display, &display_type);
sde_kms_info_add_keystr(info, "display type", display_type);
if((dp_display->is_edp) && (dp_display->ext_hpd_en))
sde_kms_info_add_keystr(info, "ext bridge hpd support", "true");
return 0;
}

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*/
@ -174,13 +174,19 @@ static int dp_parser_misc(struct dp_parser *parser)
}
parser->display_type = of_get_property(of_node, "qcom,display-type", NULL);
if (!parser->display_type)
parser->display_type = "unknown";
if (!parser->display_type) {
if (parser->is_edp)
parser->display_type = "primary";
else
parser->display_type = "secondary";
}
parser->panel_notifier_support = of_property_read_bool(of_node,
"qcom,panel-notifier-support");
DP_DEBUG("panel-notifier-support = %d\n", parser->panel_notifier_support);
parser->ext_hpd_en = of_property_read_bool(of_node,
"qcom,dp-ext-hpd");
return 0;
}

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*/
@ -232,6 +232,8 @@ static inline char *dp_phy_aux_config_type_to_string(u32 cfg_type)
* @no_aux_switch: presence AUX switch status
* @gpio_aux_switch: presence GPIO AUX switch status
* @no_backlight_support: For some display type that no support backlight
* @ext_hpd_en: A boolean value indicates an external dp can support hotplug
* @is_edp: A boolean value indicates an edp interface
* @dsc_feature_enable: DSC feature enable status
* @fec_feature_enable: FEC feature enable status
* @dsc_continuous_pps: PPS sent every frame by HW
@ -273,6 +275,8 @@ struct dp_parser {
bool lphw_hpd;
bool panel_notifier_support;
bool no_backlight_support;
bool ext_hpd_en;
bool is_edp;
u32 bl_min_level;
u32 bl_max_level;
u32 brightness_max_level;