Merge 49957290aa on remote branch

Change-Id: I99d15e7fae6def8a6e40492494d2150b997cca13
This commit is contained in:
Linux Build Service Account 2024-02-12 21:12:10 -08:00
commit e53dc7165b
8 changed files with 72 additions and 21 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.
*/
@ -2119,6 +2119,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");
@ -2128,6 +2130,8 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
dp->dp_display.is_mst_supported = dp->parser->has_mst;
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);
@ -2632,7 +2636,7 @@ static int dp_display_enable(struct dp_display *dp_display, void *panel)
goto end;
/*edp backlight enable and edp pwm enable*/
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_PWR, true);
if (rc) {
DP_ERR("Cannot turn edp backlight power on");
@ -2732,7 +2736,7 @@ static int dp_display_post_enable(struct dp_display *dp_display, void *panel)
dp_display_stream_post_enable(dp, dp_panel);
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_EN, true);
if (rc) {
DP_ERR("Cannot turn edp backlight power on");
@ -2802,7 +2806,7 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel)
goto end;
}
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_EN, false);
if (rc) {
DP_ERR("Cannot turn edp backlight power off");
@ -2885,7 +2889,7 @@ static int dp_display_disable(struct dp_display *dp_display, void *panel)
goto end;
}
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_PWR, false);
if (rc)
DP_ERR("Cannot turn edp backlight power off\n");
@ -3417,6 +3421,9 @@ static int dp_display_set_backlight(struct dp_display *dp_display,
return -EINVAL;
}
if(dp_display->no_backlight_support)
return 0;
dp = container_of(dp_display, struct dp_display_private, dp_display);
dp_panel = panel;
@ -3911,8 +3918,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.
*/
@ -97,6 +97,8 @@ struct dp_display {
u32 max_mixer_count;
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;
}
@ -295,6 +301,8 @@ static void dp_parser_bl_config(struct dp_parser *parser)
} else {
parser->pwm_period_usecs = val;
}
parser->no_backlight_support = of_property_read_bool(of_node,
"qcom,no-backlight-support");
}
static int dp_parser_gpio(struct dp_parser *parser)

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.
*/
@ -231,6 +231,9 @@ static inline char *dp_phy_aux_config_type_to_string(u32 cfg_type)
* @has_mst_sideband: MST sideband feature enable status
* @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
@ -271,6 +274,9 @@ struct dp_parser {
bool gpio_aux_switch;
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;

View file

@ -746,7 +746,13 @@ static int dp_power_edp_panel_set_gpio(struct dp_power *dp_power,
return -EINVAL;
if ((pin_state >= DP_GPIO_EDP_MIN) && (pin_state < DP_GPIO_EDP_MAX)) {
gpio_direction_output(config[pin_state].gpio, enable);
if (gpio_is_valid(config[pin_state].gpio)) {
rc = gpio_direction_output(config[pin_state].gpio, enable);
if (rc)
DP_ERR("unable to set gpio rc=%d\n", rc);
} else {
DP_ERR("gpio invalid for %d pin\n", pin_state);
}
} else {
pr_err(" Invalid GPIO call\n");
return -EINVAL;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
@ -4493,6 +4493,12 @@ static int _sde_kms_get_splash_data(struct sde_kms *sde_kms,
+ dp_display_get_num_of_boot_displays();
num_regions = of_property_count_u64_elems(node, "reg") / 2;
if (num_displays >= MAX_DSI_DISPLAYS) {
SDE_ERROR("invalid number of built in displays %d\n",
num_displays);
return -EINVAL;
}
data->num_splash_displays = num_displays;
SDE_DEBUG("splash mem num_regions:%d\n", num_regions);