Commit 92cb1bed authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Rob Clark

drm/msm/dsi: fix initialization in the bonded DSI case

Commit 739b4e77 ("drm/msm/dsi: Fix an error code in
msm_dsi_modeset_init()") changed msm_dsi_modeset_init() to return an
error code in case msm_dsi_manager_validate_current_config() returns
false. However this is not an error case, but a slave DSI of the bonded
DSI link. In this case msm_dsi_modeset_init() should return 0, but just
skip connector and bridge initialization.

To reduce possible confusion, drop the
msm_dsi_manager_validate_current_config() function, and specif 'bonded
&& !master' condition directly in the msm_dsi_modeset_init().

Fixes: 739b4e77 ("drm/msm/dsi: Fix an error code in msm_dsi_modeset_init()")
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://lore.kernel.org/r/20211125180114.561278-1-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent f7254785
...@@ -223,9 +223,13 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, ...@@ -223,9 +223,13 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
goto fail; goto fail;
} }
if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) { if (msm_dsi_is_bonded_dsi(msm_dsi) &&
ret = -EINVAL; !msm_dsi_is_master_dsi(msm_dsi)) {
goto fail; /*
* Do not return an eror here,
* Just skip creating encoder/connector for the slave-DSI.
*/
return 0;
} }
msm_dsi->encoder = encoder; msm_dsi->encoder = encoder;
......
...@@ -82,7 +82,6 @@ int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg); ...@@ -82,7 +82,6 @@ int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg);
bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len);
int msm_dsi_manager_register(struct msm_dsi *msm_dsi); int msm_dsi_manager_register(struct msm_dsi *msm_dsi);
void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi);
bool msm_dsi_manager_validate_current_config(u8 id);
void msm_dsi_manager_tpg_enable(void); void msm_dsi_manager_tpg_enable(void);
/* msm dsi */ /* msm dsi */
......
...@@ -645,23 +645,6 @@ struct drm_connector *msm_dsi_manager_connector_init(u8 id) ...@@ -645,23 +645,6 @@ struct drm_connector *msm_dsi_manager_connector_init(u8 id)
return ERR_PTR(ret); return ERR_PTR(ret);
} }
bool msm_dsi_manager_validate_current_config(u8 id)
{
bool is_bonded_dsi = IS_BONDED_DSI();
/*
* For bonded DSI, we only have one drm panel. For this
* use case, we register only one bridge/connector.
* Skip bridge/connector initialisation if it is
* slave-DSI for bonded DSI configuration.
*/
if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) {
DBG("Skip bridge registration for slave DSI->id: %d\n", id);
return false;
}
return true;
}
/* initialize bridge */ /* initialize bridge */
struct drm_bridge *msm_dsi_manager_bridge_init(u8 id) struct drm_bridge *msm_dsi_manager_bridge_init(u8 id)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment