From a01dc18dd2d9829ab42e1c816fd8e883cdf65e1b Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Thu, 17 Feb 2022 17:50:39 +0530 Subject: [PATCH 1/8] disp: msm: dsi: fix compressed RGB101010 support The destination format for compressed rgb101010 should be the same as rgb888. After adding uncompressed RGB101010 support, the programming for compressed rgb101010 went wrong. Fix this to re-enable compressed rgb101010 format support. Change-Id: I805e15df14dda8ff0653a0dba8c4efe3fe0681fd Signed-off-by: Rajeev Nandan Signed-off-by: Ritesh Kumar --- msm/dsi/dsi_display.c | 11 +++++++++++ msm/dsi/dsi_panel.c | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/msm/dsi/dsi_display.c b/msm/dsi/dsi_display.c index 2f442bd4..b7fc3baa 100644 --- a/msm/dsi/dsi_display.c +++ b/msm/dsi/dsi_display.c @@ -7044,6 +7044,17 @@ int dsi_display_get_modes_helper(struct dsi_display *display, return rc; } + /* + * Update the host_config.dst_format for compressed RGB101010 pixel format. + */ + if (display->panel->host_config.dst_format == DSI_PIXEL_FORMAT_RGB101010 && + display_mode.timing.dsc_enabled) { + display->panel->host_config.dst_format = DSI_PIXEL_FORMAT_RGB888; + DSI_DEBUG("updated dst_format from %d to %d\n", + DSI_PIXEL_FORMAT_RGB101010, + display->panel->host_config.dst_format); + } + if (display->cmdline_timing == display_mode.mode_idx) { topology_override = display->cmdline_topology; is_preferred = true; diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index b996cbbd..652ceb38 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -964,6 +964,15 @@ static int dsi_panel_parse_pixel_format(struct dsi_host_common_cfg *host, fmt = DSI_PIXEL_FORMAT_RGB666; break; case 30: + /* + * The destination pixel format (host->dst_format) depends + * upon the compression, and should be RGB888 if the DSC is + * enable. + * The DSC status information is inside the timing modes, that + * is parsed during first dsi_display_get_modes() call. + * The dst_format will be updated there depending upon the + * DSC status. + */ fmt = DSI_PIXEL_FORMAT_RGB101010; break; case 24: From 65c37a6e5d4ac123cf38d1b4505062342d981aac Mon Sep 17 00:00:00 2001 From: Soutrik Mukhopadhyay Date: Thu, 22 Jun 2023 18:37:32 +0530 Subject: [PATCH 2/8] disp: msm: dp: update PHY settings for crow target Update PHY settings for crow target. Change-Id: I1242154cdb3aef5c9a84954d69e40f0520157620 Signed-off-by: Soutrik Mukhopadhyay --- msm/dp/dp_pll_4nm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/msm/dp/dp_pll_4nm.c b/msm/dp/dp_pll_4nm.c index 0f3dfb2e..43bca659 100644 --- a/msm/dp/dp_pll_4nm.c +++ b/msm/dp/dp_pll_4nm.c @@ -130,13 +130,13 @@ static const struct dp_pll_params pll_params_v1[HSCLK_RATE_MAX] = { {0x05, 0x3f, 0x00, 0x04, 0x01, 0x69, 0x00, 0x80, 0x07, 0x6f, 0x08, 0x45, 0x06, 0x36, 0x01, - 0xe2, 0x18, 0x0f, 0x0e, 0x1f, 0x0a, 0x11}, - {0x03, 0x3f, 0x00, 0x08, 0x01, 0x69, 0x00, 0x80, 0x07, 0x0f, 0x0e, 0x13, 0x06, 0x40, 0x01, - 0xe2, 0x18, 0x0f, 0x0e, 0x1f, 0x0a, 0x11}, - {0x01, 0x3f, 0x00, 0x08, 0x02, 0x8c, 0x00, 0x00, 0x0a, 0x1f, 0x1c, 0x1a, 0x08, 0x40, 0x01, - 0x2e, 0x21, 0x0f, 0x0e, 0x1f, 0x0a, 0x11}, - {0x00, 0x3f, 0x00, 0x08, 0x00, 0x69, 0x00, 0x80, 0x07, 0x2f, 0x2a, 0x13, 0x06, 0x40, 0x01, - 0xe2, 0x18, 0x0f, 0x0e, 0x1f, 0x0a, 0x11}, + 0xe2, 0x18, 0x0f, 0x0e, 0x0f, 0x0c, 0x0c}, + {0x03, 0x3f, 0x00, 0x08, 0x01, 0x69, 0x00, 0x80, 0x07, 0x0f, 0x0e, 0x45, 0x06, 0x36, 0x01, + 0xe2, 0x18, 0x0f, 0x0e, 0x0f, 0x0c, 0x0c}, + {0x01, 0x3f, 0x00, 0x08, 0x02, 0x8c, 0x00, 0x00, 0x0a, 0x1f, 0x1c, 0x5c, 0x08, 0x36, 0x01, + 0x2e, 0x21, 0x0f, 0x0e, 0x0f, 0x0c, 0x0c}, + {0x00, 0x3f, 0x00, 0x08, 0x00, 0x69, 0x00, 0x80, 0x07, 0x2f, 0x2a, 0x45, 0x06, 0x36, 0x01, + 0xe2, 0x18, 0x0f, 0x0e, 0x0f, 0x0c, 0x0c}, }; static const struct dp_pll_params pll_params_v1_1[HSCLK_RATE_MAX] = { From e85260e6a159fd073dced787526213556cc90863 Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Mon, 12 Jun 2023 20:54:20 +0800 Subject: [PATCH 3/8] disp: msm: sde: set layer mixer for each wb display mode Set the number of layer mixer for each wb mode based on the current mode hdisplay width. If the hdisplay width of current mode is greater than the maximum layer mixer width of HW supported, set dual layer mixers for this mode and check if the split hdisplay width is an even number. Change-Id: I0190830ed559f008f9e2c0752858ddc5e7cb83cd Signed-off-by: Lei Chen Signed-off-by: Yojana Juadi --- msm/sde/sde_wb.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/msm/sde/sde_wb.c b/msm/sde/sde_wb.c index 27a1537b..3efbf32a 100644 --- a/msm/sde/sde_wb.c +++ b/msm/sde/sde_wb.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ @@ -471,9 +471,6 @@ int sde_wb_get_mode_info(struct drm_connector *connector, const u32 single_intf = 1; const u32 no_enc = 0; struct msm_display_topology *topology; - struct sde_wb_device *wb_dev = display; - u16 hdisplay; - int i; if (!drm_mode || !mode_info || !avail_res || !avail_res->max_mixer_width || !display) { @@ -481,18 +478,17 @@ int sde_wb_get_mode_info(struct drm_connector *connector, return -EINVAL; } - hdisplay = drm_mode->hdisplay; - - /* find maximum display width to support */ - for (i = 0; i < wb_dev->count_modes; i++) - hdisplay = max(hdisplay, wb_dev->modes[i].hdisplay); - topology = &mode_info->topology; - topology->num_lm = (avail_res->max_mixer_width <= hdisplay) ? + topology->num_lm = (avail_res->max_mixer_width <= drm_mode->hdisplay) ? dual_lm : single_lm; topology->num_enc = no_enc; topology->num_intf = single_intf; + if (topology->num_lm == dual_lm && (drm_mode->hdisplay % 4)) { + SDE_ERROR("invalid mode settings for 3d-merge, hdisplay:%d\n", drm_mode->hdisplay); + return -EINVAL; + } + mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_NONE; mode_info->wide_bus_en = false; mode_info->comp_info.comp_ratio = MSM_DISPLAY_COMPRESSION_RATIO_NONE; From b56a9415bd47b0a36370f9e60ef3c2d4ce53151f Mon Sep 17 00:00:00 2001 From: Mahadevan Date: Sat, 15 Apr 2023 13:31:43 +0530 Subject: [PATCH 4/8] disp: msm: initialize and register drm device after splash_config If continuous splash is enabled crtc_state active is set to true from the driver. During the handoff commit this new_state is compared with the older state and active change will be set to false. If there is a race condition between the continuous splash config and atomic check of the first commit, an improper state with active change to true is formed leading to commit failure. This change makes sure drm device will get initialized and registered after continuous splash config which will block the userspace from the handoff commit. Change-Id: I91aa64c480a3341488f1e2c9422c9a2b8200fe53 Signed-off-by: Mahadevan --- msm/msm_drv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/msm/msm_drv.c b/msm/msm_drv.c index 54ccb167..23e1c7ff 100644 --- a/msm/msm_drv.c +++ b/msm/msm_drv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark @@ -977,11 +977,6 @@ static int msm_drm_component_init(struct device *dev) drm_mode_config_reset(ddev); - ret = drm_dev_register(ddev, 0); - if (ret) - goto fail; - priv->registered = true; - if (kms && kms->funcs && kms->funcs->cont_splash_config) { ret = kms->funcs->cont_splash_config(kms, NULL); if (ret) { @@ -990,6 +985,11 @@ static int msm_drm_component_init(struct device *dev) } } + ret = drm_dev_register(ddev, 0); + if (ret) + goto fail; + priv->registered = true; + #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) if (fbdev) priv->fbdev = msm_fbdev_init(ddev); From ffb63d124877e44c87095401565a2f005ba07179 Mon Sep 17 00:00:00 2001 From: Nisarg Bhavsar Date: Fri, 28 Oct 2022 12:08:29 -0700 Subject: [PATCH 5/8] disp: msm: dp: Add abstract and wcd939x aux switch support Add functionality to change which aux switch is used at compile time for different targets. Add wcd939x switch support. Change-Id: Iced3b11733009680063790dfa8f180b19002f963 Signed-off-by: Nisarg Bhavsar Signed-off-by: Soutrik Mukhopadhyay --- config/gki_kalamadisp.conf | 1 + config/gki_kalamadispconf.h | 1 + msm/dp/dp_aux.c | 77 +++++++++++++++++++++++++++++++++++-- msm/dp/dp_aux.h | 9 +++-- msm/dp/dp_display.c | 25 ++++++------ 5 files changed, 94 insertions(+), 19 deletions(-) diff --git a/config/gki_kalamadisp.conf b/config/gki_kalamadisp.conf index 56465736..5058638b 100644 --- a/config/gki_kalamadisp.conf +++ b/config/gki_kalamadisp.conf @@ -15,3 +15,4 @@ export CONFIG_HDCP_QSEECOM=y export CONFIG_DRM_SDE_VM=y export CONFIG_QTI_HW_FENCE=y export CONFIG_QCOM_SPEC_SYNC=y +export CONFIG_QCOM_FSA4480_I2C=y diff --git a/config/gki_kalamadispconf.h b/config/gki_kalamadispconf.h index 5b5bfbce..f88dec0d 100644 --- a/config/gki_kalamadispconf.h +++ b/config/gki_kalamadispconf.h @@ -23,3 +23,4 @@ #define CONFIG_DRM_SDE_VM 1 #define CONFIG_QTI_HW_FENCE 1 #define CONFIG_QCOM_SPEC_SYNC 1 +#define CONFIG_QCOM_FSA4480_I2C 1 diff --git a/msm/dp/dp_aux.c b/msm/dp/dp_aux.c index aad6f718..a0c2e288 100644 --- a/msm/dp/dp_aux.c +++ b/msm/dp/dp_aux.c @@ -1,12 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023, Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. */ -#include #include +#if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C) +#include +#elif IS_ENABLED(CONFIG_QCOM_WCD939X_I2C) +#include +#endif + #include "dp_aux.h" #include "dp_hpd.h" #include "dp_debug.h" @@ -755,7 +760,8 @@ static void dp_aux_set_sim_mode(struct dp_aux *dp_aux, mutex_unlock(&aux->mutex); } -static int dp_aux_configure_aux_switch(struct dp_aux *dp_aux, +#if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C) +static int dp_aux_configure_fsa_switch(struct dp_aux *dp_aux, bool enable, int orientation) { struct dp_aux_private *aux; @@ -795,11 +801,65 @@ static int dp_aux_configure_aux_switch(struct dp_aux *dp_aux, enable, orientation, event); rc = fsa4480_switch_event(aux->aux_switch_node, event); + if (rc) DP_AUX_ERR(dp_aux, "failed to configure fsa4480 i2c device (%d)\n", rc); end: return rc; } +#endif + +#if IS_ENABLED(CONFIG_QCOM_WCD939X_I2C) +static int dp_aux_configure_wcd_switch(struct dp_aux *dp_aux, + bool enable, int orientation) +{ + struct dp_aux_private *aux; + int rc = 0; + enum wcd_usbss_cable_status status = WCD_USBSS_CABLE_DISCONNECT; + enum wcd_usbss_cable_types event = WCD_USBSS_DP_AUX_CC1; + + if (!dp_aux) { + DP_AUX_ERR(dp_aux, "invalid input\n"); + rc = -EINVAL; + goto end; + } + + aux = container_of(dp_aux, struct dp_aux_private, dp_aux); + + if (!aux->aux_switch_node) { + DP_AUX_DEBUG(dp_aux, "undefined wcd939x switch handle\n"); + rc = -EINVAL; + goto end; + } + + if (enable) { + status = WCD_USBSS_CABLE_CONNECT; + + switch (orientation) { + case ORIENTATION_CC1: + event = WCD_USBSS_DP_AUX_CC1; + break; + case ORIENTATION_CC2: + event = WCD_USBSS_DP_AUX_CC2; + break; + default: + DP_AUX_ERR(dp_aux, "invalid orientation\n"); + rc = -EINVAL; + goto end; + } + } + + DP_AUX_DEBUG(dp_aux, "enable=%d, orientation=%d, event=%d\n", + enable, orientation, event); + + rc = wcd_usbss_switch_update(event, status); + + if (rc) + DP_AUX_ERR(dp_aux, "failed to configure wcd939x i2c device (%d)\n", rc); +end: + return rc; +} +#endif struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog, struct dp_parser *parser, struct device_node *aux_switch, @@ -841,7 +901,16 @@ struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog, dp_aux->reconfig = dp_aux_reconfig; dp_aux->abort = dp_aux_abort_transaction; dp_aux->set_sim_mode = dp_aux_set_sim_mode; - dp_aux->aux_switch = dp_aux_configure_aux_switch; + +#if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C) + dp_aux->switch_configure = dp_aux_configure_fsa_switch; + dp_aux->switch_register_notifier = fsa4480_reg_notifier; + dp_aux->switch_unregister_notifier = fsa4480_unreg_notifier; +#elif IS_ENABLED(CONFIG_QCOM_WCD939X_I2C) + dp_aux->switch_configure = dp_aux_configure_wcd_switch; + dp_aux->switch_register_notifier = wcd_usbss_reg_notifier; + dp_aux->switch_unregister_notifier = wcd_usbss_unreg_notifier; +#endif return dp_aux; error: diff --git a/msm/dp/dp_aux.h b/msm/dp/dp_aux.h index 4a922d55..a9c431e5 100644 --- a/msm/dp/dp_aux.h +++ b/msm/dp/dp_aux.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. */ @@ -52,9 +52,10 @@ struct dp_aux { void (*deinit)(struct dp_aux *aux); void (*reconfig)(struct dp_aux *aux); void (*abort)(struct dp_aux *aux, bool abort); - void (*set_sim_mode)(struct dp_aux *aux, - struct dp_aux_bridge *sim_bridge); - int (*aux_switch)(struct dp_aux *aux, bool enable, int orientation); + void (*set_sim_mode)(struct dp_aux *aux, struct dp_aux_bridge *sim_bridge); + int (*switch_configure)(struct dp_aux *aux, bool enable, int orientation); + int (*switch_register_notifier)(struct notifier_block *nb, struct device_node *node); + int (*switch_unregister_notifier)(struct notifier_block *nb, struct device_node *node); }; struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog, diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index 065c8ed0..1e19fb09 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -1221,8 +1220,8 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp) dp->debug->max_pclk_khz); if (!dp->debug->sim_mode && !dp->no_aux_switch && !dp->parser->gpio_aux_switch - && dp->aux_switch_node) { - rc = dp->aux->aux_switch(dp->aux, true, dp->hpd->orientation); + && dp->aux_switch_node && dp->aux->switch_configure) { + rc = dp->aux->switch_configure(dp->aux, true, dp->hpd->orientation); if (rc) { mutex_unlock(&dp->session_lock); return rc; @@ -1400,7 +1399,7 @@ static int dp_display_process_hpd_low(struct dp_display_private *dp, bool skip_w return rc; } -static int dp_display_fsa4480_callback(struct notifier_block *self, +static int dp_display_aux_switch_callback(struct notifier_block *self, unsigned long event, void *data) { return 0; @@ -1416,9 +1415,12 @@ static int dp_display_init_aux_switch(struct dp_display_private *dp) if (dp->aux_switch_ready) return rc; + if (!dp->aux->switch_register_notifier) + return rc; + SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY); - nb.notifier_call = dp_display_fsa4480_callback; + nb.notifier_call = dp_display_aux_switch_callback; nb.priority = 0; /* @@ -1426,7 +1428,7 @@ static int dp_display_init_aux_switch(struct dp_display_private *dp) * Bootup DP with cable connected usecase can hit this scenario. */ for (retry = 0; retry < max_retries; retry++) { - rc = fsa4480_reg_notifier(&nb, dp->aux_switch_node); + rc = dp->aux->switch_register_notifier(&nb, dp->aux_switch_node); if (rc == 0) { DP_DEBUG("registered notifier successfully\n"); dp->aux_switch_ready = true; @@ -1443,7 +1445,8 @@ static int dp_display_init_aux_switch(struct dp_display_private *dp) return rc; } - fsa4480_unreg_notifier(&nb, dp->aux_switch_node); + if (dp->aux->switch_unregister_notifier) + dp->aux->switch_unregister_notifier(&nb, dp->aux_switch_node); SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, rc); return rc; @@ -1466,12 +1469,12 @@ static int dp_display_usbpd_configure_cb(struct device *dev) } if (!dp->debug->sim_mode && !dp->no_aux_switch - && !dp->parser->gpio_aux_switch && dp->aux_switch_node) { + && !dp->parser->gpio_aux_switch && dp->aux_switch_node && dp->aux->switch_configure) { rc = dp_display_init_aux_switch(dp); if (rc) return rc; - rc = dp->aux->aux_switch(dp->aux, true, dp->hpd->orientation); + rc = dp->aux->switch_configure(dp->aux, true, dp->hpd->orientation); if (rc) return rc; } @@ -1709,8 +1712,8 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev) dp->aux->abort(dp->aux, true); if (!dp->debug->sim_mode && !dp->no_aux_switch - && !dp->parser->gpio_aux_switch) - dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE); + && !dp->parser->gpio_aux_switch && dp->aux->switch_configure) + dp->aux->switch_configure(dp->aux, false, ORIENTATION_NONE); dp_display_disconnect_sync(dp); From 4232c28148fec65e17e82db90bfbea317c6afc50 Mon Sep 17 00:00:00 2001 From: Soutrik Mukhopadhyay Date: Mon, 22 May 2023 14:46:28 +0530 Subject: [PATCH 6/8] disp: msm: dp: Parse device tree to find specific aux switch Changes to select particular dp_aux_switch based on board requirements. Currently provision to support both fsa4480 and wcd939x as aux switches are provided. Change-Id: Iafbee4d91d14aafb1e7a37ddfa2b1ea0d0e5e784 Signed-off-by: Soutrik Mukhopadhyay --- msm/dp/dp_aux.c | 27 ++++++++++++++++++--------- msm/dp/dp_aux.h | 8 +++++++- msm/dp/dp_display.c | 10 +++++++++- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/msm/dp/dp_aux.c b/msm/dp/dp_aux.c index a0c2e288..efb1ccc4 100644 --- a/msm/dp/dp_aux.c +++ b/msm/dp/dp_aux.c @@ -8,7 +8,8 @@ #if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C) #include -#elif IS_ENABLED(CONFIG_QCOM_WCD939X_I2C) +#endif +#if IS_ENABLED(CONFIG_QCOM_WCD939X_I2C) #include #endif @@ -863,7 +864,7 @@ end: struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog, struct dp_parser *parser, struct device_node *aux_switch, - struct dp_aux_bridge *aux_bridge) + struct dp_aux_bridge *aux_bridge, enum dp_aux_switch_type switch_type) { int rc = 0; struct dp_aux_private *aux; @@ -902,15 +903,23 @@ struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog, dp_aux->abort = dp_aux_abort_transaction; dp_aux->set_sim_mode = dp_aux_set_sim_mode; + /*Condition to avoid allocating function pointers for aux bypass mode*/ + if (switch_type != DP_AUX_SWITCH_BYPASS) { #if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C) - dp_aux->switch_configure = dp_aux_configure_fsa_switch; - dp_aux->switch_register_notifier = fsa4480_reg_notifier; - dp_aux->switch_unregister_notifier = fsa4480_unreg_notifier; -#elif IS_ENABLED(CONFIG_QCOM_WCD939X_I2C) - dp_aux->switch_configure = dp_aux_configure_wcd_switch; - dp_aux->switch_register_notifier = wcd_usbss_reg_notifier; - dp_aux->switch_unregister_notifier = wcd_usbss_unreg_notifier; + if (switch_type == DP_AUX_SWITCH_FSA4480) { + dp_aux->switch_configure = dp_aux_configure_fsa_switch; + dp_aux->switch_register_notifier = fsa4480_reg_notifier; + dp_aux->switch_unregister_notifier = fsa4480_unreg_notifier; + } #endif +#if IS_ENABLED(CONFIG_QCOM_WCD939X_I2C) + if (switch_type == DP_AUX_SWITCH_WCD939x) { + dp_aux->switch_configure = dp_aux_configure_wcd_switch; + dp_aux->switch_register_notifier = wcd_usbss_reg_notifier; + dp_aux->switch_unregister_notifier = wcd_usbss_unreg_notifier; + } +#endif + } return dp_aux; error: diff --git a/msm/dp/dp_aux.h b/msm/dp/dp_aux.h index a9c431e5..d3778b11 100644 --- a/msm/dp/dp_aux.h +++ b/msm/dp/dp_aux.h @@ -26,6 +26,12 @@ #define DP_STATE_AUX_TIMEOUT BIT(12) #define DP_STATE_PLL_LOCKED BIT(13) +enum dp_aux_switch_type { + DP_AUX_SWITCH_BYPASS, + DP_AUX_SWITCH_FSA4480, + DP_AUX_SWITCH_WCD939x, +}; + enum dp_aux_error { DP_AUX_ERR_NONE = 0, DP_AUX_ERR_ADDR = -1, @@ -60,7 +66,7 @@ struct dp_aux { struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog, struct dp_parser *parser, struct device_node *aux_switch, - struct dp_aux_bridge *aux_bridge); + struct dp_aux_bridge *aux_bridge, enum dp_aux_switch_type switch_type); void dp_aux_put(struct dp_aux *aux); #endif /*__DP_AUX_H_*/ diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index 1e19fb09..f2e45c3c 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -168,6 +168,7 @@ struct dp_display_private { enum drm_connector_status cached_connector_status; enum dp_display_states state; + enum dp_aux_switch_type switch_type; struct platform_device *pdev; struct device_node *aux_switch_node; @@ -2161,8 +2162,15 @@ static int dp_init_sub_modules(struct dp_display_private *dp) dp->no_aux_switch = true; } + if (!strcmp(dp->aux_switch_node->name, "fsa4480")) + dp->switch_type = DP_AUX_SWITCH_FSA4480; + else if (!strcmp(dp->aux_switch_node->name, "wcd939x_i2c")) + dp->switch_type = DP_AUX_SWITCH_WCD939x; + else + dp->switch_type = DP_AUX_SWITCH_BYPASS; + dp->aux = dp_aux_get(dev, &dp->catalog->aux, dp->parser, - dp->aux_switch_node, dp->aux_bridge); + dp->aux_switch_node, dp->aux_bridge, dp->switch_type); if (IS_ERR(dp->aux)) { rc = PTR_ERR(dp->aux); DP_ERR("failed to initialize aux, rc = %d\n", rc); From 191d8b78c44e1c37953ad978929ff13278d44a77 Mon Sep 17 00:00:00 2001 From: Kashish Jain Date: Sat, 1 Jul 2023 23:27:33 +0530 Subject: [PATCH 7/8] disp: config: add support for fsa and wcd aux switch for crow target Add support for fsa and wcd aux switch for crow target. Change-Id: If50226c5f9f7cbb3a1ab1d469bc2c9efa0b541c4 Signed-off-by: Kashish Jain --- config/gki_crowdisp.conf | 2 ++ config/gki_crowdispconf.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config/gki_crowdisp.conf b/config/gki_crowdisp.conf index ccae67ab..98c9476d 100644 --- a/config/gki_crowdisp.conf +++ b/config/gki_crowdisp.conf @@ -14,3 +14,5 @@ export CONFIG_DISPLAY_BUILD=m export CONFIG_HDCP_QSEECOM=y export CONFIG_DRM_SDE_VM=y export CONFIG_QCOM_SPEC_SYNC=y +export CONFIG_QCOM_WCD939X_I2C=y +export CONFIG_QCOM_FSA4480_I2C=y diff --git a/config/gki_crowdispconf.h b/config/gki_crowdispconf.h index 25edefc9..e4a44582 100644 --- a/config/gki_crowdispconf.h +++ b/config/gki_crowdispconf.h @@ -20,3 +20,5 @@ #define CONFIG_HDCP_QSEECOM 1 #define CONFIG_DRM_SDE_VM 1 #define CONFIG_QCOM_SPEC_SYNC 1 +#define CONFIG_QCOM_WCD939X_I2C 1 +#define CONFIG_QCOM_FSA4480_I2C 1 From 15a6e6deda6e21fb74a00fd191d1f02d539c34b1 Mon Sep 17 00:00:00 2001 From: Akash Gajjar Date: Thu, 6 Jul 2023 23:17:55 +0530 Subject: [PATCH 8/8] disp: msm: sde: avoid returning zero vsync count in poms usecase In POMS use case while disabling the virtual encoder, the virt reset function sets the current master to null. concurrently, if there is a query from the DRM client for the current vsync count, it returns a zero value. This results in the blocking of the drm_crtc_funcs.disable_vblank function. since the vsync count has been relocated to the virtual encoder, remove the physical encoder structure. Change-Id: Ie692df657b5a86b6b8915a15e9a070642243fcfb Signed-off-by: Akash Gajjar --- msm/sde/sde_encoder.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index 8e9c9f29..bf45fb85 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -5851,7 +5851,6 @@ enum sde_intf_mode sde_encoder_get_intf_mode(struct drm_encoder *encoder) u32 sde_encoder_get_frame_count(struct drm_encoder *encoder) { struct sde_encoder_virt *sde_enc = NULL; - struct sde_encoder_phys *phys; if (!encoder) { SDE_ERROR("invalid encoder\n"); @@ -5859,9 +5858,7 @@ u32 sde_encoder_get_frame_count(struct drm_encoder *encoder) } sde_enc = to_sde_encoder_virt(encoder); - phys = sde_enc->cur_master; - - return phys ? atomic_read(&sde_enc->vsync_cnt) : 0; + return atomic_read(&sde_enc->vsync_cnt); } bool sde_encoder_get_vblank_timestamp(struct drm_encoder *encoder,