Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>

authored by

Dmitry Baryshkov and committed by
Rob Clark
92cb1bed f7254785

+7 -21
+7 -3
drivers/gpu/drm/msm/dsi/dsi.c
··· 223 223 goto fail; 224 224 } 225 225 226 - if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) { 227 - ret = -EINVAL; 228 - goto fail; 226 + if (msm_dsi_is_bonded_dsi(msm_dsi) && 227 + !msm_dsi_is_master_dsi(msm_dsi)) { 228 + /* 229 + * Do not return an eror here, 230 + * Just skip creating encoder/connector for the slave-DSI. 231 + */ 232 + return 0; 229 233 } 230 234 231 235 msm_dsi->encoder = encoder;
-1
drivers/gpu/drm/msm/dsi/dsi.h
··· 82 82 bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); 83 83 int msm_dsi_manager_register(struct msm_dsi *msm_dsi); 84 84 void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); 85 - bool msm_dsi_manager_validate_current_config(u8 id); 86 85 void msm_dsi_manager_tpg_enable(void); 87 86 88 87 /* msm dsi */
-17
drivers/gpu/drm/msm/dsi/dsi_manager.c
··· 645 645 return ERR_PTR(ret); 646 646 } 647 647 648 - bool msm_dsi_manager_validate_current_config(u8 id) 649 - { 650 - bool is_bonded_dsi = IS_BONDED_DSI(); 651 - 652 - /* 653 - * For bonded DSI, we only have one drm panel. For this 654 - * use case, we register only one bridge/connector. 655 - * Skip bridge/connector initialisation if it is 656 - * slave-DSI for bonded DSI configuration. 657 - */ 658 - if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) { 659 - DBG("Skip bridge registration for slave DSI->id: %d\n", id); 660 - return false; 661 - } 662 - return true; 663 - } 664 - 665 648 /* initialize bridge */ 666 649 struct drm_bridge *msm_dsi_manager_bridge_init(u8 id) 667 650 {