2019-11-26 15:40:09

by Mihail Atanassov

[permalink] [raw]
Subject: [PATCH 28/30] drm/sti: sti_vdo: Use drm_bridge_init()

No functional change.

Signed-off-by: Mihail Atanassov <[email protected]>
---
drivers/gpu/drm/sti/sti_dvo.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 68289b0b063a..20a3956b33bc 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -462,9 +462,7 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
if (!bridge)
return -ENOMEM;

- bridge->driver_private = dvo;
- bridge->funcs = &sti_dvo_bridge_funcs;
- bridge->of_node = dvo->dev.of_node;
+ drm_bridge_init(bridge, &dvo->dev, &sti_dvo_bridge_funcs, NULL, dvo);
drm_bridge_add(bridge);

err = drm_bridge_attach(encoder, bridge, NULL);
--
2.23.0


2019-11-26 19:39:11

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 28/30] drm/sti: sti_vdo: Use drm_bridge_init()

Hi Mihail.

On Tue, Nov 26, 2019 at 01:16:26PM +0000, Mihail Atanassov wrote:
> No functional change.
>
> Signed-off-by: Mihail Atanassov <[email protected]>
> ---
> drivers/gpu/drm/sti/sti_dvo.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> index 68289b0b063a..20a3956b33bc 100644
> --- a/drivers/gpu/drm/sti/sti_dvo.c
> +++ b/drivers/gpu/drm/sti/sti_dvo.c
> @@ -462,9 +462,7 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
> if (!bridge)
> return -ENOMEM;
>
> - bridge->driver_private = dvo;
> - bridge->funcs = &sti_dvo_bridge_funcs;
> - bridge->of_node = dvo->dev.of_node;
> + drm_bridge_init(bridge, &dvo->dev, &sti_dvo_bridge_funcs, NULL, dvo);
> drm_bridge_add(bridge);
>
> err = drm_bridge_attach(encoder, bridge, NULL);

I can see from grepping that bridge.driver_private is used
in a couple of other files in sti/

Like sti_hdmi.c:
bridge->driver_private = hdmi;
bridge->funcs = &sti_hdmi_bridge_funcs;
drm_bridge_attach(encoder, bridge, NULL);


I wonder if a drm_bridge_init() should be added there.
I did not look closely - but it looked suspisiously.

Sam

2019-11-27 11:04:17

by Mihail Atanassov

[permalink] [raw]
Subject: Re: [PATCH 28/30] drm/sti: sti_vdo: Use drm_bridge_init()

On Tuesday, 26 November 2019 19:37:40 GMT Sam Ravnborg wrote:
> Hi Mihail.

Hi Sam,

>
> On Tue, Nov 26, 2019 at 01:16:26PM +0000, Mihail Atanassov wrote:
> > No functional change.
> >
> > Signed-off-by: Mihail Atanassov <[email protected]>
> > ---
> > drivers/gpu/drm/sti/sti_dvo.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> > index 68289b0b063a..20a3956b33bc 100644
> > --- a/drivers/gpu/drm/sti/sti_dvo.c
> > +++ b/drivers/gpu/drm/sti/sti_dvo.c
> > @@ -462,9 +462,7 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
> > if (!bridge)
> > return -ENOMEM;
> >
> > - bridge->driver_private = dvo;
> > - bridge->funcs = &sti_dvo_bridge_funcs;
> > - bridge->of_node = dvo->dev.of_node;
> > + drm_bridge_init(bridge, &dvo->dev, &sti_dvo_bridge_funcs, NULL, dvo);
> > drm_bridge_add(bridge);
> >
> > err = drm_bridge_attach(encoder, bridge, NULL);
>
> I can see from grepping that bridge.driver_private is used
> in a couple of other files in sti/
>
> Like sti_hdmi.c:
> bridge->driver_private = hdmi;
> bridge->funcs = &sti_hdmi_bridge_funcs;
> drm_bridge_attach(encoder, bridge, NULL);
>
>
> I wonder if a drm_bridge_init() should be added there.
> I did not look closely - but it looked suspisiously.

My goal with drm_bridge_init() was to get devlinks sorted out for
cross-module uses of a drm_bridge (via of_drm_find_bridge()), so I only
considered locations where drm_bridge_add/remove() were used.

Would you be okay with a promise to push a cleanup of this one and the
one in sti_hda.c after patch 1/30 lands in some form? I'd rather not
make this series much longer, it's already pushing it at 30 :).

>
> Sam
>


--
Mihail



2019-11-27 16:21:50

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 28/30] drm/sti: sti_vdo: Use drm_bridge_init()

Hi Mihail.

> >
> > I can see from grepping that bridge.driver_private is used
> > in a couple of other files in sti/
> >
> > Like sti_hdmi.c:
> > bridge->driver_private = hdmi;
> > bridge->funcs = &sti_hdmi_bridge_funcs;
> > drm_bridge_attach(encoder, bridge, NULL);
> >
> >
> > I wonder if a drm_bridge_init() should be added there.
> > I did not look closely - but it looked suspisiously.
>
> My goal with drm_bridge_init() was to get devlinks sorted out for
> cross-module uses of a drm_bridge (via of_drm_find_bridge()), so I only
> considered locations where drm_bridge_add/remove() were used.
>
> Would you be okay with a promise to push a cleanup of this one and the
> one in sti_hda.c after patch 1/30 lands in some form? I'd rather not
> make this series much longer, it's already pushing it at 30 :).

Absolutely - my drive-by comment was more out of concern if this
was missing. A clean-up later souns good.

Sam

2019-11-27 16:33:44

by Benjamin Gaignard

[permalink] [raw]
Subject: Re: [PATCH 28/30] drm/sti: sti_vdo: Use drm_bridge_init()

Le mer. 27 nov. 2019 à 17:19, Sam Ravnborg <[email protected]> a écrit :
>
> Hi Mihail.
>
> > >
> > > I can see from grepping that bridge.driver_private is used
> > > in a couple of other files in sti/
> > >
> > > Like sti_hdmi.c:
> > > bridge->driver_private = hdmi;
> > > bridge->funcs = &sti_hdmi_bridge_funcs;
> > > drm_bridge_attach(encoder, bridge, NULL);
> > >
> > >
> > > I wonder if a drm_bridge_init() should be added there.
> > > I did not look closely - but it looked suspisiously.
> >
> > My goal with drm_bridge_init() was to get devlinks sorted out for
> > cross-module uses of a drm_bridge (via of_drm_find_bridge()), so I only
> > considered locations where drm_bridge_add/remove() were used.
> >
> > Would you be okay with a promise to push a cleanup of this one and the
> > one in sti_hda.c after patch 1/30 lands in some form? I'd rather not
> > make this series much longer, it's already pushing it at 30 :).
>
> Absolutely - my drive-by comment was more out of concern if this
> was missing. A clean-up later souns good.

Or you can just do the changes for sti_hdmi and sti_hda in this patch too.

Benjamin

>
> Sam
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel