* [PATCH 0/3] drm/msm/dsi: rework drm_connector instantiation
@ 2024-03-09 15:09 Dmitry Baryshkov
2024-03-09 15:09 ` [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback Dmitry Baryshkov
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Dmitry Baryshkov @ 2024-03-09 15:09 UTC (permalink / raw
To: Rob Clark, Abhinav Kumar, Sean Paul, Marijn Suijten, David Airlie,
Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno, Dmitry Baryshkov
- Drop attempts to call drm_bridge_attach with 0 flags, require that
downstream bridges support DRM_BRIDGE_ATTACH_NO_CONNECTOR
- Acquire next bridge during dsi_bind, making sure that it doesn't cause
-EPROBE_DEFER later during modeset_init.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Dmitry Baryshkov (3):
drm/msm/dsi: remove the drm_bridge_attach fallback
drm/msm/dsi: move next bridge acquisition to dsi_bind
drm/msm/dsi: simplify connector creation
drivers/gpu/drm/msm/dsi/dsi.c | 26 ++++++++----
drivers/gpu/drm/msm/dsi/dsi.h | 7 ++--
drivers/gpu/drm/msm/dsi/dsi_manager.c | 79 ++++++++++++-----------------------
3 files changed, 48 insertions(+), 64 deletions(-)
---
base-commit: 1843e16d2df9d98427ef8045589571749d627cf7
change-id: 20240309-fd-dsi-cleanup-bridges-22d5dc1c1341
Best regards,
--
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback
2024-03-09 15:09 [PATCH 0/3] drm/msm/dsi: rework drm_connector instantiation Dmitry Baryshkov
@ 2024-03-09 15:09 ` Dmitry Baryshkov
2024-04-05 17:20 ` Abhinav Kumar
2024-03-09 15:09 ` [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind Dmitry Baryshkov
2024-03-09 15:09 ` [PATCH 3/3] drm/msm/dsi: simplify connector creation Dmitry Baryshkov
2 siblings, 1 reply; 13+ messages in thread
From: Dmitry Baryshkov @ 2024-03-09 15:09 UTC (permalink / raw
To: Rob Clark, Abhinav Kumar, Sean Paul, Marijn Suijten, David Airlie,
Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno, Dmitry Baryshkov
All the bridges that are being used with the MSM DSI hosts have been
converted to support DRM_BRIDGE_ATTACH_NO_CONNECTOR. Drop the fallback
code and require DRM_BRIDGE_ATTACH_NO_CONNECTOR to be supported by the
downstream bridges.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/msm/dsi/dsi_manager.c | 36 +++++++++++------------------------
1 file changed, 11 insertions(+), 25 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index af2a287cb3bd..a7c7f85b73e4 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -465,6 +465,7 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
struct drm_device *dev = msm_dsi->dev;
struct drm_encoder *encoder;
struct drm_bridge *ext_bridge;
+ struct drm_connector *connector;
int ret;
ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
@@ -474,36 +475,21 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
encoder = int_bridge->encoder;
- /*
- * Try first to create the bridge without it creating its own
- * connector.. currently some bridges support this, and others
- * do not (and some support both modes)
- */
ret = drm_bridge_attach(encoder, ext_bridge, int_bridge,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
- if (ret == -EINVAL) {
- /*
- * link the internal dsi bridge to the external bridge,
- * connector is created by the next bridge.
- */
- ret = drm_bridge_attach(encoder, ext_bridge, int_bridge, 0);
- if (ret < 0)
- return ret;
- } else {
- struct drm_connector *connector;
-
- /* We are in charge of the connector, create one now. */
- connector = drm_bridge_connector_init(dev, encoder);
- if (IS_ERR(connector)) {
- DRM_ERROR("Unable to create bridge connector\n");
- return PTR_ERR(connector);
- }
+ if (ret)
+ return ret;
- ret = drm_connector_attach_encoder(connector, encoder);
- if (ret < 0)
- return ret;
+ connector = drm_bridge_connector_init(dev, encoder);
+ if (IS_ERR(connector)) {
+ DRM_ERROR("Unable to create bridge connector\n");
+ return PTR_ERR(connector);
}
+ ret = drm_connector_attach_encoder(connector, encoder);
+ if (ret < 0)
+ return ret;
+
return 0;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind
2024-03-09 15:09 [PATCH 0/3] drm/msm/dsi: rework drm_connector instantiation Dmitry Baryshkov
2024-03-09 15:09 ` [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback Dmitry Baryshkov
@ 2024-03-09 15:09 ` Dmitry Baryshkov
2024-04-05 17:35 ` Abhinav Kumar
2024-03-09 15:09 ` [PATCH 3/3] drm/msm/dsi: simplify connector creation Dmitry Baryshkov
2 siblings, 1 reply; 13+ messages in thread
From: Dmitry Baryshkov @ 2024-03-09 15:09 UTC (permalink / raw
To: Rob Clark, Abhinav Kumar, Sean Paul, Marijn Suijten, David Airlie,
Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno, Dmitry Baryshkov
Currently the MSM DSI driver looks for the next bridge during
msm_dsi_modeset_init(). If the bridge is not registered at that point,
this might result in -EPROBE_DEFER, which can be problematic that late
during the device probe process. Move next bridge acquisition to the
dsi_bind state so that probe deferral is returned as early as possible.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/msm/dsi/dsi.c | 16 ++++++++++++++++
drivers/gpu/drm/msm/dsi/dsi.h | 2 ++
drivers/gpu/drm/msm/dsi/dsi_manager.c | 8 +-------
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 37c4c07005fe..38f10f7a10d3 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -120,6 +120,22 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
struct msm_drm_private *priv = dev_get_drvdata(master);
struct msm_dsi *msm_dsi = dev_get_drvdata(dev);
+ /*
+ * Next bridge doesn't exist for the secondary DSI host in a bonded
+ * pair.
+ */
+ if (!msm_dsi_is_bonded_dsi(msm_dsi) ||
+ msm_dsi_is_master_dsi(msm_dsi)) {
+ struct drm_bridge *ext_bridge;
+
+ ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
+ msm_dsi->pdev->dev.of_node, 1, 0);
+ if (IS_ERR(ext_bridge))
+ return PTR_ERR(ext_bridge);
+
+ msm_dsi->next_bridge = ext_bridge;
+ }
+
priv->dsi[msm_dsi->id] = msm_dsi;
return 0;
diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
index 2ad9a842c678..0adef65be1de 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.h
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
@@ -38,6 +38,8 @@ struct msm_dsi {
struct mipi_dsi_host *host;
struct msm_dsi_phy *phy;
+ struct drm_bridge *next_bridge;
+
struct device *phy_dev;
bool phy_enabled;
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index a7c7f85b73e4..b7c52b14c790 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -464,18 +464,12 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
struct drm_device *dev = msm_dsi->dev;
struct drm_encoder *encoder;
- struct drm_bridge *ext_bridge;
struct drm_connector *connector;
int ret;
- ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
- msm_dsi->pdev->dev.of_node, 1, 0);
- if (IS_ERR(ext_bridge))
- return PTR_ERR(ext_bridge);
-
encoder = int_bridge->encoder;
- ret = drm_bridge_attach(encoder, ext_bridge, int_bridge,
+ ret = drm_bridge_attach(encoder, msm_dsi->next_bridge, int_bridge,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return ret;
--
2.39.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/3] drm/msm/dsi: simplify connector creation
2024-03-09 15:09 [PATCH 0/3] drm/msm/dsi: rework drm_connector instantiation Dmitry Baryshkov
2024-03-09 15:09 ` [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback Dmitry Baryshkov
2024-03-09 15:09 ` [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind Dmitry Baryshkov
@ 2024-03-09 15:09 ` Dmitry Baryshkov
2024-04-08 22:33 ` Abhinav Kumar
2 siblings, 1 reply; 13+ messages in thread
From: Dmitry Baryshkov @ 2024-03-09 15:09 UTC (permalink / raw
To: Rob Clark, Abhinav Kumar, Sean Paul, Marijn Suijten, David Airlie,
Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno, Dmitry Baryshkov
Instead of having two functions, msm_dsi_manager_bridge_init()
and msm_dsi_manager_ext_bridge_init(), merge them into
msm_dsi_manager_connector_init(), moving drm_bridge_attach() to be
called from the bridge's attach callback (as most other bridges do).
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/msm/dsi/dsi.c | 10 +--------
drivers/gpu/drm/msm/dsi/dsi.h | 5 ++---
drivers/gpu/drm/msm/dsi/dsi_manager.c | 41 +++++++++++++++--------------------
3 files changed, 21 insertions(+), 35 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 38f10f7a10d3..efd7c23b662f 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -232,7 +232,6 @@ void __exit msm_dsi_unregister(void)
int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
struct drm_encoder *encoder)
{
- struct drm_bridge *bridge;
int ret;
msm_dsi->dev = dev;
@@ -252,14 +251,7 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
return 0;
}
- bridge = msm_dsi_manager_bridge_init(msm_dsi, encoder);
- if (IS_ERR(bridge)) {
- ret = PTR_ERR(bridge);
- DRM_DEV_ERROR(dev->dev, "failed to create dsi bridge: %d\n", ret);
- return ret;
- }
-
- ret = msm_dsi_manager_ext_bridge_init(msm_dsi->id, bridge);
+ ret = msm_dsi_manager_connector_init(msm_dsi, encoder);
if (ret) {
DRM_DEV_ERROR(dev->dev,
"failed to create dsi connector: %d\n", ret);
diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
index 0adef65be1de..afc290408ba4 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.h
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
@@ -47,9 +47,8 @@ struct msm_dsi {
};
/* dsi manager */
-struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi,
- struct drm_encoder *encoder);
-int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge);
+int msm_dsi_manager_connector_init(struct msm_dsi *msm_dsi,
+ struct drm_encoder *encoder);
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);
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index b7c52b14c790..5b3f3068fd92 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -423,7 +423,18 @@ static enum drm_mode_status dsi_mgr_bridge_mode_valid(struct drm_bridge *bridge,
return msm_dsi_host_check_dsc(host, mode);
}
+static int dsi_mgr_bridge_attach(struct drm_bridge *bridge,
+ enum drm_bridge_attach_flags flags)
+{
+ int id = dsi_mgr_bridge_get_id(bridge);
+ struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
+
+ return drm_bridge_attach(bridge->encoder, msm_dsi->next_bridge,
+ bridge, flags);
+}
+
static const struct drm_bridge_funcs dsi_mgr_bridge_funcs = {
+ .attach = dsi_mgr_bridge_attach,
.pre_enable = dsi_mgr_bridge_pre_enable,
.post_disable = dsi_mgr_bridge_post_disable,
.mode_set = dsi_mgr_bridge_mode_set,
@@ -431,17 +442,19 @@ static const struct drm_bridge_funcs dsi_mgr_bridge_funcs = {
};
/* initialize bridge */
-struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi,
- struct drm_encoder *encoder)
+int msm_dsi_manager_connector_init(struct msm_dsi *msm_dsi,
+ struct drm_encoder *encoder)
{
+ struct drm_device *dev = msm_dsi->dev;
struct drm_bridge *bridge;
struct dsi_bridge *dsi_bridge;
+ struct drm_connector *connector;
int ret;
dsi_bridge = devm_kzalloc(msm_dsi->dev->dev,
sizeof(*dsi_bridge), GFP_KERNEL);
if (!dsi_bridge)
- return ERR_PTR(-ENOMEM);
+ return -ENOMEM;
dsi_bridge->id = msm_dsi->id;
@@ -450,27 +463,9 @@ struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi,
ret = devm_drm_bridge_add(msm_dsi->dev->dev, bridge);
if (ret)
- return ERR_PTR(ret);
-
- ret = drm_bridge_attach(encoder, bridge, NULL, 0);
- if (ret)
- return ERR_PTR(ret);
-
- return bridge;
-}
-
-int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
-{
- struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
- struct drm_device *dev = msm_dsi->dev;
- struct drm_encoder *encoder;
- struct drm_connector *connector;
- int ret;
-
- encoder = int_bridge->encoder;
+ return ret;
- ret = drm_bridge_attach(encoder, msm_dsi->next_bridge, int_bridge,
- DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+ ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return ret;
--
2.39.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback
2024-03-09 15:09 ` [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback Dmitry Baryshkov
@ 2024-04-05 17:20 ` Abhinav Kumar
2024-04-05 18:16 ` Dmitry Baryshkov
0 siblings, 1 reply; 13+ messages in thread
From: Abhinav Kumar @ 2024-04-05 17:20 UTC (permalink / raw
To: Dmitry Baryshkov, Rob Clark, Sean Paul, Marijn Suijten,
David Airlie, Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno
On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
> All the bridges that are being used with the MSM DSI hosts have been
> converted to support DRM_BRIDGE_ATTACH_NO_CONNECTOR. Drop the fallback
> code and require DRM_BRIDGE_ATTACH_NO_CONNECTOR to be supported by the
> downstream bridges.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/msm/dsi/dsi_manager.c | 36 +++++++++++------------------------
> 1 file changed, 11 insertions(+), 25 deletions(-)
>
There are the bridges I checked by looking at the dts:
1) lontium,lt9611
2) lontium,lt9611uxc
3) adi,adv7533
4) ti,sn65dsi86
Are there any more?
If not, this LGTM
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind
2024-03-09 15:09 ` [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind Dmitry Baryshkov
@ 2024-04-05 17:35 ` Abhinav Kumar
2024-04-05 18:15 ` Dmitry Baryshkov
0 siblings, 1 reply; 13+ messages in thread
From: Abhinav Kumar @ 2024-04-05 17:35 UTC (permalink / raw
To: Dmitry Baryshkov, Rob Clark, Sean Paul, Marijn Suijten,
David Airlie, Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno
On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
> Currently the MSM DSI driver looks for the next bridge during
> msm_dsi_modeset_init(). If the bridge is not registered at that point,
> this might result in -EPROBE_DEFER, which can be problematic that late
> during the device probe process. Move next bridge acquisition to the
> dsi_bind state so that probe deferral is returned as early as possible.
>
But msm_dsi_modeset)init() is also called during msm_drm_bind() only.
What issue are you suggesting will be fixed by moving this from
msm_drm_bind() to dsi_bind()?
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/msm/dsi/dsi.c | 16 ++++++++++++++++
> drivers/gpu/drm/msm/dsi/dsi.h | 2 ++
> drivers/gpu/drm/msm/dsi/dsi_manager.c | 8 +-------
> 3 files changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> index 37c4c07005fe..38f10f7a10d3 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -120,6 +120,22 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
> struct msm_drm_private *priv = dev_get_drvdata(master);
> struct msm_dsi *msm_dsi = dev_get_drvdata(dev);
>
> + /*
> + * Next bridge doesn't exist for the secondary DSI host in a bonded
> + * pair.
> + */
> + if (!msm_dsi_is_bonded_dsi(msm_dsi) ||
> + msm_dsi_is_master_dsi(msm_dsi)) {
> + struct drm_bridge *ext_bridge;
> +
> + ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
> + msm_dsi->pdev->dev.of_node, 1, 0);
> + if (IS_ERR(ext_bridge))
> + return PTR_ERR(ext_bridge);
> +
> + msm_dsi->next_bridge = ext_bridge;
> + }
> +
> priv->dsi[msm_dsi->id] = msm_dsi;
>
> return 0;
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
> index 2ad9a842c678..0adef65be1de 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.h
> +++ b/drivers/gpu/drm/msm/dsi/dsi.h
> @@ -38,6 +38,8 @@ struct msm_dsi {
> struct mipi_dsi_host *host;
> struct msm_dsi_phy *phy;
>
> + struct drm_bridge *next_bridge;
> +
> struct device *phy_dev;
> bool phy_enabled;
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> index a7c7f85b73e4..b7c52b14c790 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> @@ -464,18 +464,12 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
> struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
> struct drm_device *dev = msm_dsi->dev;
> struct drm_encoder *encoder;
> - struct drm_bridge *ext_bridge;
> struct drm_connector *connector;
> int ret;
>
> - ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
> - msm_dsi->pdev->dev.of_node, 1, 0);
> - if (IS_ERR(ext_bridge))
> - return PTR_ERR(ext_bridge);
> -
> encoder = int_bridge->encoder;
>
> - ret = drm_bridge_attach(encoder, ext_bridge, int_bridge,
> + ret = drm_bridge_attach(encoder, msm_dsi->next_bridge, int_bridge,
> DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> if (ret)
> return ret;
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind
2024-04-05 17:35 ` Abhinav Kumar
@ 2024-04-05 18:15 ` Dmitry Baryshkov
2024-04-08 21:45 ` Abhinav Kumar
0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Baryshkov @ 2024-04-05 18:15 UTC (permalink / raw
To: Abhinav Kumar
Cc: Rob Clark, Sean Paul, Marijn Suijten, David Airlie, Daniel Vetter,
linux-arm-msm, dri-devel, freedreno
On Fri, 5 Apr 2024 at 20:35, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>
>
>
> On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
> > Currently the MSM DSI driver looks for the next bridge during
> > msm_dsi_modeset_init(). If the bridge is not registered at that point,
> > this might result in -EPROBE_DEFER, which can be problematic that late
> > during the device probe process. Move next bridge acquisition to the
> > dsi_bind state so that probe deferral is returned as early as possible.
> >
>
> But msm_dsi_modeset)init() is also called during msm_drm_bind() only.
>
> What issue are you suggesting will be fixed by moving this from
> msm_drm_bind() to dsi_bind()?
The goal is to return as early as possible as not not cause
probe-deferral loops. See commit fbc35b45f9f6 ("Add documentation on
meaning of -EPROBE_DEFER"). It discusses returning from probe() but
the same logic applies to bind().
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> > drivers/gpu/drm/msm/dsi/dsi.c | 16 ++++++++++++++++
> > drivers/gpu/drm/msm/dsi/dsi.h | 2 ++
> > drivers/gpu/drm/msm/dsi/dsi_manager.c | 8 +-------
> > 3 files changed, 19 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> > index 37c4c07005fe..38f10f7a10d3 100644
> > --- a/drivers/gpu/drm/msm/dsi/dsi.c
> > +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> > @@ -120,6 +120,22 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
> > struct msm_drm_private *priv = dev_get_drvdata(master);
> > struct msm_dsi *msm_dsi = dev_get_drvdata(dev);
> >
> > + /*
> > + * Next bridge doesn't exist for the secondary DSI host in a bonded
> > + * pair.
> > + */
> > + if (!msm_dsi_is_bonded_dsi(msm_dsi) ||
> > + msm_dsi_is_master_dsi(msm_dsi)) {
> > + struct drm_bridge *ext_bridge;
> > +
> > + ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
> > + msm_dsi->pdev->dev.of_node, 1, 0);
> > + if (IS_ERR(ext_bridge))
> > + return PTR_ERR(ext_bridge);
> > +
> > + msm_dsi->next_bridge = ext_bridge;
> > + }
> > +
> > priv->dsi[msm_dsi->id] = msm_dsi;
> >
> > return 0;
> > diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
> > index 2ad9a842c678..0adef65be1de 100644
> > --- a/drivers/gpu/drm/msm/dsi/dsi.h
> > +++ b/drivers/gpu/drm/msm/dsi/dsi.h
> > @@ -38,6 +38,8 @@ struct msm_dsi {
> > struct mipi_dsi_host *host;
> > struct msm_dsi_phy *phy;
> >
> > + struct drm_bridge *next_bridge;
> > +
> > struct device *phy_dev;
> > bool phy_enabled;
> >
> > diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > index a7c7f85b73e4..b7c52b14c790 100644
> > --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > @@ -464,18 +464,12 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
> > struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
> > struct drm_device *dev = msm_dsi->dev;
> > struct drm_encoder *encoder;
> > - struct drm_bridge *ext_bridge;
> > struct drm_connector *connector;
> > int ret;
> >
> > - ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
> > - msm_dsi->pdev->dev.of_node, 1, 0);
> > - if (IS_ERR(ext_bridge))
> > - return PTR_ERR(ext_bridge);
> > -
> > encoder = int_bridge->encoder;
> >
> > - ret = drm_bridge_attach(encoder, ext_bridge, int_bridge,
> > + ret = drm_bridge_attach(encoder, msm_dsi->next_bridge, int_bridge,
> > DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> > if (ret)
> > return ret;
> >
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback
2024-04-05 17:20 ` Abhinav Kumar
@ 2024-04-05 18:16 ` Dmitry Baryshkov
2024-04-05 18:17 ` Abhinav Kumar
0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Baryshkov @ 2024-04-05 18:16 UTC (permalink / raw
To: Abhinav Kumar
Cc: Rob Clark, Sean Paul, Marijn Suijten, David Airlie, Daniel Vetter,
linux-arm-msm, dri-devel, freedreno
On Fri, 5 Apr 2024 at 20:20, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>
>
>
> On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
> > All the bridges that are being used with the MSM DSI hosts have been
> > converted to support DRM_BRIDGE_ATTACH_NO_CONNECTOR. Drop the fallback
> > code and require DRM_BRIDGE_ATTACH_NO_CONNECTOR to be supported by the
> > downstream bridges.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> > drivers/gpu/drm/msm/dsi/dsi_manager.c | 36 +++++++++++------------------------
> > 1 file changed, 11 insertions(+), 25 deletions(-)
> >
>
> There are the bridges I checked by looking at the dts:
>
> 1) lontium,lt9611
> 2) lontium,lt9611uxc
> 3) adi,adv7533
> 4) ti,sn65dsi86
>
> Are there any more?
>
> If not, this LGTM
>
> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
From your message it looks more like Tested-by rather than just Reviewed-by
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback
2024-04-05 18:16 ` Dmitry Baryshkov
@ 2024-04-05 18:17 ` Abhinav Kumar
2024-04-05 18:19 ` Dmitry Baryshkov
0 siblings, 1 reply; 13+ messages in thread
From: Abhinav Kumar @ 2024-04-05 18:17 UTC (permalink / raw
To: Dmitry Baryshkov
Cc: Rob Clark, Sean Paul, Marijn Suijten, David Airlie, Daniel Vetter,
linux-arm-msm, dri-devel, freedreno
On 4/5/2024 11:16 AM, Dmitry Baryshkov wrote:
> On Fri, 5 Apr 2024 at 20:20, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>>
>>
>> On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
>>> All the bridges that are being used with the MSM DSI hosts have been
>>> converted to support DRM_BRIDGE_ATTACH_NO_CONNECTOR. Drop the fallback
>>> code and require DRM_BRIDGE_ATTACH_NO_CONNECTOR to be supported by the
>>> downstream bridges.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>> drivers/gpu/drm/msm/dsi/dsi_manager.c | 36 +++++++++++------------------------
>>> 1 file changed, 11 insertions(+), 25 deletions(-)
>>>
>>
>> There are the bridges I checked by looking at the dts:
>>
>> 1) lontium,lt9611
>> 2) lontium,lt9611uxc
>> 3) adi,adv7533
>> 4) ti,sn65dsi86
>>
>> Are there any more?
>>
>> If not, this LGTM
>>
>> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>
> From your message it looks more like Tested-by rather than just Reviewed-by
>
No, I only cross-checked the dts.
So, its only Reviewed-by :)
But I wanted to list down all the bridges
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback
2024-04-05 18:17 ` Abhinav Kumar
@ 2024-04-05 18:19 ` Dmitry Baryshkov
2024-04-05 18:57 ` Abhinav Kumar
0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Baryshkov @ 2024-04-05 18:19 UTC (permalink / raw
To: Abhinav Kumar
Cc: Rob Clark, Sean Paul, Marijn Suijten, David Airlie, Daniel Vetter,
linux-arm-msm, dri-devel, freedreno
On Fri, 5 Apr 2024 at 21:17, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>
>
>
> On 4/5/2024 11:16 AM, Dmitry Baryshkov wrote:
> > On Fri, 5 Apr 2024 at 20:20, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
> >>
> >>
> >>
> >> On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
> >>> All the bridges that are being used with the MSM DSI hosts have been
> >>> converted to support DRM_BRIDGE_ATTACH_NO_CONNECTOR. Drop the fallback
> >>> code and require DRM_BRIDGE_ATTACH_NO_CONNECTOR to be supported by the
> >>> downstream bridges.
> >>>
> >>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >>> ---
> >>> drivers/gpu/drm/msm/dsi/dsi_manager.c | 36 +++++++++++------------------------
> >>> 1 file changed, 11 insertions(+), 25 deletions(-)
> >>>
> >>
> >> There are the bridges I checked by looking at the dts:
> >>
> >> 1) lontium,lt9611
> >> 2) lontium,lt9611uxc
> >> 3) adi,adv7533
> >> 4) ti,sn65dsi86
> >>
> >> Are there any more?
> >>
> >> If not, this LGTM
> >>
> >> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
> >
> > From your message it looks more like Tested-by rather than just Reviewed-by
> >
>
> No, I only cross-checked the dts.
>
> So, its only Reviewed-by :)
>
> But I wanted to list down all the bridges
Then I'd also nominate the panel bridge to the list of bridges for
cross-checking. It is created automatically when we request a bridge,
but DT has only a panel.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback
2024-04-05 18:19 ` Dmitry Baryshkov
@ 2024-04-05 18:57 ` Abhinav Kumar
0 siblings, 0 replies; 13+ messages in thread
From: Abhinav Kumar @ 2024-04-05 18:57 UTC (permalink / raw
To: Dmitry Baryshkov
Cc: Rob Clark, Sean Paul, Marijn Suijten, David Airlie, Daniel Vetter,
linux-arm-msm, dri-devel, freedreno
On 4/5/2024 11:19 AM, Dmitry Baryshkov wrote:
> On Fri, 5 Apr 2024 at 21:17, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>>
>>
>> On 4/5/2024 11:16 AM, Dmitry Baryshkov wrote:
>>> On Fri, 5 Apr 2024 at 20:20, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>>>
>>>>
>>>>
>>>> On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
>>>>> All the bridges that are being used with the MSM DSI hosts have been
>>>>> converted to support DRM_BRIDGE_ATTACH_NO_CONNECTOR. Drop the fallback
>>>>> code and require DRM_BRIDGE_ATTACH_NO_CONNECTOR to be supported by the
>>>>> downstream bridges.
>>>>>
>>>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>>>> ---
>>>>> drivers/gpu/drm/msm/dsi/dsi_manager.c | 36 +++++++++++------------------------
>>>>> 1 file changed, 11 insertions(+), 25 deletions(-)
>>>>>
>>>>
>>>> There are the bridges I checked by looking at the dts:
>>>>
>>>> 1) lontium,lt9611
>>>> 2) lontium,lt9611uxc
>>>> 3) adi,adv7533
>>>> 4) ti,sn65dsi86
>>>>
>>>> Are there any more?
>>>>
>>>> If not, this LGTM
>>>>
>>>> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>>>
>>> From your message it looks more like Tested-by rather than just Reviewed-by
>>>
>>
>> No, I only cross-checked the dts.
>>
>> So, its only Reviewed-by :)
>>
>> But I wanted to list down all the bridges
>
> Then I'd also nominate the panel bridge to the list of bridges for
> cross-checking. It is created automatically when we request a bridge,
> but DT has only a panel.
>
Yes, that one is fine too
58 static int panel_bridge_attach(struct drm_bridge *bridge,
59 enum drm_bridge_attach_flags flags)
60 {
61 struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
62 struct drm_connector *connector = &panel_bridge->connector;
63 int ret;
64
65 if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
66 return 0;
67
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind
2024-04-05 18:15 ` Dmitry Baryshkov
@ 2024-04-08 21:45 ` Abhinav Kumar
0 siblings, 0 replies; 13+ messages in thread
From: Abhinav Kumar @ 2024-04-08 21:45 UTC (permalink / raw
To: Dmitry Baryshkov
Cc: Rob Clark, Sean Paul, Marijn Suijten, David Airlie, Daniel Vetter,
linux-arm-msm, dri-devel, freedreno
On 4/5/2024 11:15 AM, Dmitry Baryshkov wrote:
> On Fri, 5 Apr 2024 at 20:35, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>>
>>
>> On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
>>> Currently the MSM DSI driver looks for the next bridge during
>>> msm_dsi_modeset_init(). If the bridge is not registered at that point,
>>> this might result in -EPROBE_DEFER, which can be problematic that late
>>> during the device probe process. Move next bridge acquisition to the
>>> dsi_bind state so that probe deferral is returned as early as possible.
>>>
>>
>> But msm_dsi_modeset)init() is also called during msm_drm_bind() only.
>>
>> What issue are you suggesting will be fixed by moving this from
>> msm_drm_bind() to dsi_bind()?
>
> The goal is to return as early as possible as not not cause
> probe-deferral loops. See commit fbc35b45f9f6 ("Add documentation on
> meaning of -EPROBE_DEFER"). It discusses returning from probe() but
> the same logic applies to bind().
>
Understood. I was trying to make sure the purpose of the patch is that
"deferral in component_bind() is better than component_master_bind()"
But yes, overall that is better since the unbounding path will be more
in the master case.
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>> drivers/gpu/drm/msm/dsi/dsi.c | 16 ++++++++++++++++
>>> drivers/gpu/drm/msm/dsi/dsi.h | 2 ++
>>> drivers/gpu/drm/msm/dsi/dsi_manager.c | 8 +-------
>>> 3 files changed, 19 insertions(+), 7 deletions(-)
>>>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] drm/msm/dsi: simplify connector creation
2024-03-09 15:09 ` [PATCH 3/3] drm/msm/dsi: simplify connector creation Dmitry Baryshkov
@ 2024-04-08 22:33 ` Abhinav Kumar
0 siblings, 0 replies; 13+ messages in thread
From: Abhinav Kumar @ 2024-04-08 22:33 UTC (permalink / raw
To: Dmitry Baryshkov, Rob Clark, Sean Paul, Marijn Suijten,
David Airlie, Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno
On 3/9/2024 7:09 AM, Dmitry Baryshkov wrote:
> Instead of having two functions, msm_dsi_manager_bridge_init()
> and msm_dsi_manager_ext_bridge_init(), merge them into
> msm_dsi_manager_connector_init(), moving drm_bridge_attach() to be
> called from the bridge's attach callback (as most other bridges do).
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/msm/dsi/dsi.c | 10 +--------
> drivers/gpu/drm/msm/dsi/dsi.h | 5 ++---
> drivers/gpu/drm/msm/dsi/dsi_manager.c | 41 +++++++++++++++--------------------
> 3 files changed, 21 insertions(+), 35 deletions(-)
>
LGTM,
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2024-04-08 22:33 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-09 15:09 [PATCH 0/3] drm/msm/dsi: rework drm_connector instantiation Dmitry Baryshkov
2024-03-09 15:09 ` [PATCH 1/3] drm/msm/dsi: remove the drm_bridge_attach fallback Dmitry Baryshkov
2024-04-05 17:20 ` Abhinav Kumar
2024-04-05 18:16 ` Dmitry Baryshkov
2024-04-05 18:17 ` Abhinav Kumar
2024-04-05 18:19 ` Dmitry Baryshkov
2024-04-05 18:57 ` Abhinav Kumar
2024-03-09 15:09 ` [PATCH 2/3] drm/msm/dsi: move next bridge acquisition to dsi_bind Dmitry Baryshkov
2024-04-05 17:35 ` Abhinav Kumar
2024-04-05 18:15 ` Dmitry Baryshkov
2024-04-08 21:45 ` Abhinav Kumar
2024-03-09 15:09 ` [PATCH 3/3] drm/msm/dsi: simplify connector creation Dmitry Baryshkov
2024-04-08 22:33 ` 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 read-only IMAP folder(s) and NNTP newsgroup(s).