diff mbox series

[v2,08/21] drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder

Message ID 20190826152649.13820-9-boris.brezillon@collabora.com (mailing list archive)
State New, archived
Headers show
Series drm: Add support for bus-format negotiation | expand

Commit Message

Boris Brezillon Aug. 26, 2019, 3:26 p.m. UTC
This is part of our attempt to make the bridge chain a double-linked
list based on the generic list helpers. In order to do that, we must
patch all drivers manipulating the encoder->bridge field directly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes in v2:
* Add Laurent and Sam R-b (waiting for a R-b from a drm/msm maintainer
  now)
---
 drivers/gpu/drm/msm/edp/edp.c   | 4 +++-
 drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Sean Paul Aug. 28, 2019, 3:22 p.m. UTC | #1
On Mon, Aug 26, 2019 at 05:26:36PM +0200, Boris Brezillon wrote:
> This is part of our attempt to make the bridge chain a double-linked
> list based on the generic list helpers. In order to do that, we must
> patch all drivers manipulating the encoder->bridge field directly.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Do you want to take this through -misc?

Reviewed-by: Sean Paul <sean@poorly.run>


> ---
> Changes in v2:
> * Add Laurent and Sam R-b (waiting for a R-b from a drm/msm maintainer
>   now)
> ---
>  drivers/gpu/drm/msm/edp/edp.c   | 4 +++-
>  drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
> index b54559a79d36..ad4e963ccd9b 100644
> --- a/drivers/gpu/drm/msm/edp/edp.c
> +++ b/drivers/gpu/drm/msm/edp/edp.c
> @@ -178,7 +178,9 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
>  		goto fail;
>  	}
>  
> -	encoder->bridge.next = edp->bridge;
> +	ret = drm_bridge_attach(encoder, edp->bridge, NULL);
> +	if (ret)
> +		goto fail;
>  
>  	priv->bridges[priv->num_bridges++]       = edp->bridge;
>  	priv->connectors[priv->num_connectors++] = edp->connector;
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 9d94a88dd8d6..55b9a8c8312b 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -327,7 +327,9 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
>  		goto fail;
>  	}
>  
> -	encoder->bridge.next = hdmi->bridge;
> +	ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
> +	if (ret)
> +		goto fail;
>  
>  	priv->bridges[priv->num_bridges++]       = hdmi->bridge;
>  	priv->connectors[priv->num_connectors++] = hdmi->connector;
> -- 
> 2.21.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Boris Brezillon Aug. 28, 2019, 3:25 p.m. UTC | #2
On Wed, 28 Aug 2019 11:22:57 -0400
Sean Paul <sean@poorly.run> wrote:

> On Mon, Aug 26, 2019 at 05:26:36PM +0200, Boris Brezillon wrote:
> > This is part of our attempt to make the bridge chain a double-linked
> > list based on the generic list helpers. In order to do that, we must
> > patch all drivers manipulating the encoder->bridge field directly.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>  
> 
> Do you want to take this through -misc?
> 
> Reviewed-by: Sean Paul <sean@poorly.run>

Yes, that was the plan, unless you want to apply it to the msm tree
(not sure if there's such a tree).

> 
> 
> > ---
> > Changes in v2:
> > * Add Laurent and Sam R-b (waiting for a R-b from a drm/msm maintainer
> >   now)
> > ---
> >  drivers/gpu/drm/msm/edp/edp.c   | 4 +++-
> >  drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +++-
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
> > index b54559a79d36..ad4e963ccd9b 100644
> > --- a/drivers/gpu/drm/msm/edp/edp.c
> > +++ b/drivers/gpu/drm/msm/edp/edp.c
> > @@ -178,7 +178,9 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
> >  		goto fail;
> >  	}
> >  
> > -	encoder->bridge.next = edp->bridge;
> > +	ret = drm_bridge_attach(encoder, edp->bridge, NULL);
> > +	if (ret)
> > +		goto fail;
> >  
> >  	priv->bridges[priv->num_bridges++]       = edp->bridge;
> >  	priv->connectors[priv->num_connectors++] = edp->connector;
> > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > index 9d94a88dd8d6..55b9a8c8312b 100644
> > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > @@ -327,7 +327,9 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
> >  		goto fail;
> >  	}
> >  
> > -	encoder->bridge.next = hdmi->bridge;
> > +	ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
> > +	if (ret)
> > +		goto fail;
> >  
> >  	priv->bridges[priv->num_bridges++]       = hdmi->bridge;
> >  	priv->connectors[priv->num_connectors++] = hdmi->connector;
> > -- 
> > 2.21.0
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel  
>
Sean Paul Aug. 28, 2019, 3:30 p.m. UTC | #3
On Wed, Aug 28, 2019 at 11:25 AM Boris Brezillon
<boris.brezillon@collabora.com> wrote:
>
> On Wed, 28 Aug 2019 11:22:57 -0400
> Sean Paul <sean@poorly.run> wrote:
>
> > On Mon, Aug 26, 2019 at 05:26:36PM +0200, Boris Brezillon wrote:
> > > This is part of our attempt to make the bridge chain a double-linked
> > > list based on the generic list helpers. In order to do that, we must
> > > patch all drivers manipulating the encoder->bridge field directly.
> > >
> > > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > > Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > Do you want to take this through -misc?
> >
> > Reviewed-by: Sean Paul <sean@poorly.run>
>
> Yes, that was the plan, unless you want to apply it to the msm tree
> (not sure if there's such a tree).
>

There is, but I think it's fine to take this through -misc.

Sean

> >
> >
> > > ---
> > > Changes in v2:
> > > * Add Laurent and Sam R-b (waiting for a R-b from a drm/msm maintainer
> > >   now)
> > > ---
> > >  drivers/gpu/drm/msm/edp/edp.c   | 4 +++-
> > >  drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +++-
> > >  2 files changed, 6 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
> > > index b54559a79d36..ad4e963ccd9b 100644
> > > --- a/drivers/gpu/drm/msm/edp/edp.c
> > > +++ b/drivers/gpu/drm/msm/edp/edp.c
> > > @@ -178,7 +178,9 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
> > >             goto fail;
> > >     }
> > >
> > > -   encoder->bridge.next = edp->bridge;
> > > +   ret = drm_bridge_attach(encoder, edp->bridge, NULL);
> > > +   if (ret)
> > > +           goto fail;
> > >
> > >     priv->bridges[priv->num_bridges++]       = edp->bridge;
> > >     priv->connectors[priv->num_connectors++] = edp->connector;
> > > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > > index 9d94a88dd8d6..55b9a8c8312b 100644
> > > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> > > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > > @@ -327,7 +327,9 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
> > >             goto fail;
> > >     }
> > >
> > > -   encoder->bridge.next = hdmi->bridge;
> > > +   ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
> > > +   if (ret)
> > > +           goto fail;
> > >
> > >     priv->bridges[priv->num_bridges++]       = hdmi->bridge;
> > >     priv->connectors[priv->num_connectors++] = hdmi->connector;
> > > --
> > > 2.21.0
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
>
Boris Brezillon Aug. 28, 2019, 8:27 p.m. UTC | #4
On Wed, 28 Aug 2019 11:30:43 -0400
Sean Paul <sean@poorly.run> wrote:

> On Wed, Aug 28, 2019 at 11:25 AM Boris Brezillon
> <boris.brezillon@collabora.com> wrote:
> >
> > On Wed, 28 Aug 2019 11:22:57 -0400
> > Sean Paul <sean@poorly.run> wrote:
> >  
> > > On Mon, Aug 26, 2019 at 05:26:36PM +0200, Boris Brezillon wrote:  
> > > > This is part of our attempt to make the bridge chain a double-linked
> > > > list based on the generic list helpers. In order to do that, we must
> > > > patch all drivers manipulating the encoder->bridge field directly.
> > > >
> > > > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > > > Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>  
> > >
> > > Do you want to take this through -misc?
> > >
> > > Reviewed-by: Sean Paul <sean@poorly.run>  
> >
> > Yes, that was the plan, unless you want to apply it to the msm tree
> > (not sure if there's such a tree).
> >  
> 
> There is, but I think it's fine to take this through -misc.

Queued to drm-misc-next.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
index b54559a79d36..ad4e963ccd9b 100644
--- a/drivers/gpu/drm/msm/edp/edp.c
+++ b/drivers/gpu/drm/msm/edp/edp.c
@@ -178,7 +178,9 @@  int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
 		goto fail;
 	}
 
-	encoder->bridge.next = edp->bridge;
+	ret = drm_bridge_attach(encoder, edp->bridge, NULL);
+	if (ret)
+		goto fail;
 
 	priv->bridges[priv->num_bridges++]       = edp->bridge;
 	priv->connectors[priv->num_connectors++] = edp->connector;
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 9d94a88dd8d6..55b9a8c8312b 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -327,7 +327,9 @@  int msm_hdmi_modeset_init(struct hdmi *hdmi,
 		goto fail;
 	}
 
-	encoder->bridge.next = hdmi->bridge;
+	ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
+	if (ret)
+		goto fail;
 
 	priv->bridges[priv->num_bridges++]       = hdmi->bridge;
 	priv->connectors[priv->num_connectors++] = hdmi->connector;