From a521764b537574cd2ff43779788fa269dde6f092 Mon Sep 17 00:00:00 2001 From: Jeykumar Sankaran Date: Fri, 28 Aug 2020 18:14:59 -0700 Subject: [PATCH] disp: msm: sde: populate connector modes during init When continuous splash is enabled, KMS populates the modes of a connector during splash config. With TUI VM enabled, this path will also be exercised by trusted vm for splash handoff, where for a given display we try to use the same HW blocks configured by the primary VM. Since the trusted VM invokes the path under connection_mutex lock, calling fill_modes will lead to a deadlock. So, move the connector mode population during init for DSI displays, since the modes are available for the connector during initialization. Change-Id: I12f920f4af84b7bccc97a5f5edb5117ada49b960 Signed-off-by: Jeykumar Sankaran --- msm/sde/sde_connector.c | 6 ++++++ msm/sde/sde_kms.c | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c index 4fb0dd5f06..84e2d5b891 100644 --- a/msm/sde/sde_connector.c +++ b/msm/sde/sde_connector.c @@ -2707,6 +2707,12 @@ static int _sde_connector_install_properties(struct drm_device *dev, sizeof(dsi_display->panel->hdr_props), CONNECTOR_PROP_HDR_INFO); } + + mutex_lock(&c_conn->base.dev->mode_config.mutex); + sde_connector_fill_modes(&c_conn->base, + dev->mode_config.max_width, + dev->mode_config.max_height); + mutex_unlock(&c_conn->base.dev->mode_config.mutex); } msm_property_install_volatile_range( diff --git a/msm/sde/sde_kms.c b/msm/sde/sde_kms.c index 77031d174a..c9b605cda6 100644 --- a/msm/sde/sde_kms.c +++ b/msm/sde/sde_kms.c @@ -3043,16 +3043,6 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms) mutex_unlock(&dev->mode_config.mutex); return -EINVAL; } - - if (connector->funcs->fill_modes) { - connector->funcs->fill_modes(connector, - dev->mode_config.max_width, - dev->mode_config.max_height); - } else { - SDE_ERROR("fill_modes api not defined\n"); - mutex_unlock(&dev->mode_config.mutex); - return -EINVAL; - } mutex_unlock(&dev->mode_config.mutex); crtc->state->encoder_mask = (1 << drm_encoder_index(encoder));