[PATCH v2 34/50] drm/omap: Create connector for bridges

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Aug 22 23:41:53 UTC 2019


Hi Boris,

On Thu, Aug 22, 2019 at 07:00:11PM +0200, Boris Brezillon wrote:
> On Tue, 20 Aug 2019 04:17:05 +0300 Laurent Pinchart wrote:
> > Use the drm_bridge_connector helper to create a connector for pipelines
> > that use drm_bridge. This allows splitting connector operations across
> > multiple bridges when necessary, instead of having the last bridge in
> > the chain creating the connector and handling all connector operations
> > internally.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > ---
> > Changes since v1:
> > 
> > - Squash with patch "drm/omap: Detach from panels at remove time"
> > ---
> >  drivers/gpu/drm/omapdrm/omap_drv.c | 82 +++++++++++++++++++++++++-----
> >  1 file changed, 70 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> > index de373fd50729..f38d95cb31ba 100644
> > --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> > +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> > @@ -11,10 +11,12 @@
> >  
> >  #include <drm/drm_atomic.h>
> >  #include <drm/drm_atomic_helper.h>
> > +#include <drm/drm_bridge_connector.h>
> >  #include <drm/drm_drv.h>
> >  #include <drm/drm_fb_helper.h>
> >  #include <drm/drm_file.h>
> >  #include <drm/drm_ioctl.h>
> > +#include <drm/drm_panel.h>
> >  #include <drm/drm_prime.h>
> >  #include <drm/drm_probe_helper.h>
> >  #include <drm/drm_vblank.h>
> > @@ -290,9 +292,14 @@ static int omap_modeset_init(struct drm_device *dev)
> >  
> >  		if (pipe->output->bridge) {
> >  			ret = drm_bridge_attach(pipe->encoder,
> > -						pipe->output->bridge, NULL, 0);
> > -			if (ret < 0)
> > +						pipe->output->bridge, NULL,
> > +						DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> 
> I guess the only external bridge connected to an omap display
> controller in upstream DTs is the TFP410.

No, there's also the TI OP362 (analog amplier) and TI TPD12S015 (HDMI
ESD protection and level shifter). Those are not really encoders, but
they're bridges.

> I was wondering if falling back to !DRM_BRIDGE_ATTACH_NO_CONNECTOR
> would be acceptable in case one wants to convert a display controller
> driver which is known to be used in conjunction with various external
> bridges.

Yes, a display controller can support both options. I would however
recommend addressing bridges first in a conversion, and once all bridges
used by a display controller support DRM_BRIDGE_ATTACH_NO_CONNECTOR (and
implement the connector bridge ops), switch the display controller to
DRM_BRIDGE_ATTACH_NO_CONNECTOR unconditionally.

> > +			if (ret < 0) {
> > +				dev_err(priv->dev,
> > +					"unable to attach bridge %pOF\n",
> > +					pipe->output->bridge->of_node);
> >  				return ret;
> > +			}
> >  		}
> >  

-- 
Regards,

Laurent Pinchart


More information about the dri-devel mailing list