* [PATCH] drm/msm/dsi: fix initialization in the bonded DSI case
@ 2021-11-25 18:01 Dmitry Baryshkov
2021-12-08 0:42 ` Abhinav Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Baryshkov @ 2021-11-25 18:01 UTC (permalink / raw)
To: Bjorn Andersson, Rob Clark, Sean Paul, Abhinav Kumar
Cc: Stephen Boyd, David Airlie, Daniel Vetter, linux-arm-msm,
dri-devel, freedreno
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>
---
drivers/gpu/drm/msm/dsi/dsi.c | 10 +++++++---
drivers/gpu/drm/msm/dsi/dsi.h | 1 -
drivers/gpu/drm/msm/dsi/dsi_manager.c | 17 -----------------
3 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 75ae3008b68f..fc280cc43494 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -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;
diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
index 66443dc98500..ef8212990254 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.h
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
@@ -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 */
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index a152dbf63038..a73cfeb93e90 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -645,23 +645,6 @@ struct drm_connector *msm_dsi_manager_connector_init(u8 id)
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)
{
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/msm/dsi: fix initialization in the bonded DSI case
2021-11-25 18:01 [PATCH] drm/msm/dsi: fix initialization in the bonded DSI case Dmitry Baryshkov
@ 2021-12-08 0:42 ` Abhinav Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Abhinav Kumar @ 2021-12-08 0:42 UTC (permalink / raw)
To: Dmitry Baryshkov, Bjorn Andersson, Rob Clark, Sean Paul, Abhinav Kumar
Cc: Stephen Boyd, linux-arm-msm, dri-devel, David Airlie, freedreno
On 11/25/2021 10:01 AM, Dmitry Baryshkov wrote:
> 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>
> ---
> drivers/gpu/drm/msm/dsi/dsi.c | 10 +++++++---
> drivers/gpu/drm/msm/dsi/dsi.h | 1 -
> drivers/gpu/drm/msm/dsi/dsi_manager.c | 17 -----------------
> 3 files changed, 7 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> index 75ae3008b68f..fc280cc43494 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -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;
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
> index 66443dc98500..ef8212990254 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.h
> +++ b/drivers/gpu/drm/msm/dsi/dsi.h
> @@ -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 */
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> index a152dbf63038..a73cfeb93e90 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> @@ -645,23 +645,6 @@ struct drm_connector *msm_dsi_manager_connector_init(u8 id)
> 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)
> {
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-08 0:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 18:01 [PATCH] drm/msm/dsi: fix initialization in the bonded DSI case Dmitry Baryshkov
2021-12-08 0:42 ` Abhinav Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).