diff mbox series

[1/3] drm/msm/dsi: remove the drm_bridge_attach fallback

Message ID 20240309-fd-dsi-cleanup-bridges-v1-1-962ebdba82ed@linaro.org
State Accepted
Commit 9febe4a015b97952bd086a21062a55c49f31a117
Headers show
Series drm/msm/dsi: rework drm_connector instantiation | expand

Commit Message

Dmitry Baryshkov March 9, 2024, 3:09 p.m. UTC
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(-)

Comments

Abhinav Kumar April 5, 2024, 5:20 p.m. UTC | #1
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>
Dmitry Baryshkov April 5, 2024, 6:16 p.m. UTC | #2
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>
Abhinav Kumar April 5, 2024, 6:17 p.m. UTC | #3
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
Dmitry Baryshkov April 5, 2024, 6:19 p.m. UTC | #4
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.
Abhinav Kumar April 5, 2024, 6:57 p.m. UTC | #5
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
diff mbox series

Patch

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;
 }