drm/msm/dsi: fix initialization in the bonded DSI case
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 25 Nov 2021 18:01:14 +0000 (21:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:32 +0000 (11:03 +0100)
[ Upstream commit 92cb1bedde9dba78d802fe2510949743a2581aed ]

Commit 739b4e7756d3 ("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: 739b4e7756d3 ("drm/msm/dsi: Fix an error code in msm_dsi_modeset_init()")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://lore.kernel.org/r/20211125180114.561278-1-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/dsi/dsi.c
drivers/gpu/drm/msm/dsi/dsi.h
drivers/gpu/drm/msm/dsi/dsi_manager.c

index 75ae3008b68f4a2bb81f2cb4a439a42174c8d199..fc280cc4349437f0b21b452542cb5019c5233d60 100644 (file)
@@ -215,9 +215,13 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
                goto fail;
        }
 
-       if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) {
-               ret = -EINVAL;
-               goto fail;
+       if (msm_dsi_is_bonded_dsi(msm_dsi) &&
+           !msm_dsi_is_master_dsi(msm_dsi)) {
+               /*
+                * Do not return an eror here,
+                * Just skip creating encoder/connector for the slave-DSI.
+                */
+               return 0;
        }
 
        msm_dsi->encoder = encoder;
index 569c8ff062ba484ab74e16b0dfef23d8613b00bc..a63666e59d19e6dd73b4e32212e3350fd4917412 100644 (file)
@@ -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);
 int msm_dsi_manager_register(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);
 
 /* msm dsi */
index fb4ccffdcfe138241c6b72da0f05743cf3fbb5c8..fa4c396df6a923f4093b7e947b1fbb2fe6458513 100644 (file)
@@ -647,23 +647,6 @@ fail:
        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 */
 struct drm_bridge *msm_dsi_manager_bridge_init(u8 id)
 {