diff mbox series

[v1,4/4] drm/bridge: tc358764: make connector creation optional

Message ID 20200414084727.8326-5-sam@ravnborg.org (mailing list archive)
State New, archived
Headers show
Series drm: tc358764: support drm bridge connector helper | expand

Commit Message

Sam Ravnborg April 14, 2020, 8:47 a.m. UTC
Make the connector creation optional to enable usage of the
tc358764 bridge with the DRM bridge connector helper.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/bridge/tc358764.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart April 14, 2020, 9:38 a.m. UTC | #1
Hi Sam,

Thank you for the patch.

On Tue, Apr 14, 2020 at 10:47:27AM +0200, Sam Ravnborg wrote:
> Make the connector creation optional to enable usage of the
> tc358764 bridge with the DRM bridge connector helper.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Jernej Skrabec <jernej.skrabec@siol.net>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thank you for the conversion. "Just a few" more bridge drivers to go,
and then there will be no more excuse not to use the DRM bridge
connector helper :-)

> ---
>  drivers/gpu/drm/bridge/tc358764.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c
> index a5abf15e5c7f..4ebabea86040 100644
> --- a/drivers/gpu/drm/bridge/tc358764.c
> +++ b/drivers/gpu/drm/bridge/tc358764.c
> @@ -337,10 +337,8 @@ static int tc358764_attach(struct drm_bridge *bridge,
>  	if (ret < 0)
>  		return ret;
>  
> -	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
> -		DRM_ERROR("Fix bridge driver to make connector optional!");
> -		return -EINVAL;
> -	}
> +	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> +		return 0;
>  
>  	ctx->connector.polled = DRM_CONNECTOR_POLL_HPD;
>  	ret = drm_connector_init(drm, &ctx->connector,
Sam Ravnborg April 14, 2020, 1:36 p.m. UTC | #2
On Tue, Apr 14, 2020 at 12:38:16PM +0300, Laurent Pinchart wrote:
> Hi Sam,
> 
> Thank you for the patch.
> 
> On Tue, Apr 14, 2020 at 10:47:27AM +0200, Sam Ravnborg wrote:
> > Make the connector creation optional to enable usage of the
> > tc358764 bridge with the DRM bridge connector helper.
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Andrzej Hajda <a.hajda@samsung.com>
> > Cc: Neil Armstrong <narmstrong@baylibre.com>
> > Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> > Cc: Jonas Karlman <jonas@kwiboo.se>
> > Cc: Jernej Skrabec <jernej.skrabec@siol.net>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks. I will wait a few days for more feedback before applying.
 
> Thank you for the conversion. "Just a few" more bridge drivers to go,
> and then there will be no more excuse not to use the DRM bridge
> connector helper :-)

A quick grep for ATTACH and drm_bridge_attach_flags gave me following list:

adv7511				ongoing, Laurent
analogix/analogix-anx6345	todo
analogix/analogix-anx78xx	todo
analogix/analogix_dp_core	todo
cdns-dsi			done?
display-connector.c		done
lvds-codec			done?
megachips-stdpxxxx-ge-b850v3-fw	todo
nwl-dsi				(ongoing), Guido
nxp-ptn3460			todo
panel.c				done
parade-ps8622			todo
parade-ps8640			done?
sii902x				todo
sil-sii8620			done?
simple-bridge			ongoing, Laurent
synopsys/dw-hdmi		todo
synopsys/dw-mipi-dsi		done?
tc358764			ongoing, Sam
tc358767			todo
tc358768			done?
thc63lvd1024			done?
ti-sn65dsi86			todo
ti-tfp410			done
ti-tpd12s015			todo

3	done
7	done?
4	ongoing
11	todo

Maybe a little simplistic - but gives some kind of overview.

Drivers marked with "Done?" do not have any hits for ATTACH,
dunno if they need more attantion.

I will try to take a look at a few of the trivial conversions
later this week.

	Sam
Laurent Pinchart April 14, 2020, 1:41 p.m. UTC | #3
Hi Sam,

On Tue, Apr 14, 2020 at 03:36:26PM +0200, Sam Ravnborg wrote:
> On Tue, Apr 14, 2020 at 12:38:16PM +0300, Laurent Pinchart wrote:
> > On Tue, Apr 14, 2020 at 10:47:27AM +0200, Sam Ravnborg wrote:
> > > Make the connector creation optional to enable usage of the
> > > tc358764 bridge with the DRM bridge connector helper.
> > > 
> > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > Cc: Andrzej Hajda <a.hajda@samsung.com>
> > > Cc: Neil Armstrong <narmstrong@baylibre.com>
> > > Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> > > Cc: Jonas Karlman <jonas@kwiboo.se>
> > > Cc: Jernej Skrabec <jernej.skrabec@siol.net>
> > 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Thanks. I will wait a few days for more feedback before applying.
>  
> > Thank you for the conversion. "Just a few" more bridge drivers to go,
> > and then there will be no more excuse not to use the DRM bridge
> > connector helper :-)
> 
> A quick grep for ATTACH and drm_bridge_attach_flags gave me following list:
> 
> adv7511				ongoing, Laurent
> analogix/analogix-anx6345	todo
> analogix/analogix-anx78xx	todo
> analogix/analogix_dp_core	todo
> cdns-dsi			done?
> display-connector.c		done
> lvds-codec			done?
> megachips-stdpxxxx-ge-b850v3-fw	todo
> nwl-dsi				(ongoing), Guido
> nxp-ptn3460			todo
> panel.c				done
> parade-ps8622			todo
> parade-ps8640			done?
> sii902x				todo
> sil-sii8620			done?
> simple-bridge			ongoing, Laurent
> synopsys/dw-hdmi		todo
> synopsys/dw-mipi-dsi		done?
> tc358764			ongoing, Sam
> tc358767			todo
> tc358768			done?
> thc63lvd1024			done?
> ti-sn65dsi86			todo
> ti-tfp410			done
> ti-tpd12s015			todo
> 
> 3	done
> 7	done?
> 4	ongoing
> 11	todo
> 
> Maybe a little simplistic - but gives some kind of overview.

Please note there are also bridge drivers in individual drivers
directories. For instance I'll convert rcar-du/rcar-lvds.

> Drivers marked with "Done?" do not have any hits for ATTACH,
> dunno if they need more attantion.

No, those drivers never had connector support in the first place, so as
far as I can tell they're good. I haven't checked if some of them need
to move to the DRM bridge panel helper, but if they don't create a
connector in the first place, they should already be using it.

> I will try to take a look at a few of the trivial conversions
> later this week.

Thanks a lot for that !
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c
index a5abf15e5c7f..4ebabea86040 100644
--- a/drivers/gpu/drm/bridge/tc358764.c
+++ b/drivers/gpu/drm/bridge/tc358764.c
@@ -337,10 +337,8 @@  static int tc358764_attach(struct drm_bridge *bridge,
 	if (ret < 0)
 		return ret;
 
-	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
-		DRM_ERROR("Fix bridge driver to make connector optional!");
-		return -EINVAL;
-	}
+	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+		return 0;
 
 	ctx->connector.polled = DRM_CONNECTOR_POLL_HPD;
 	ret = drm_connector_init(drm, &ctx->connector,