Message ID | 20220710184536.172705-4-dmitry.baryshkov@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | drm/bridge: ti-sn65dsi86: support DRM_BRIDGE_ATTACH_NO_CONNECTOR | expand |
Hi Dmitry, On Sun, Jul 10, 2022 at 09:45:36PM +0300, Dmitry Baryshkov wrote: > Now as the driver does not depend on pdata->connector, add support for > attaching the bridge with DRM_BRIDGE_ATTACH_NO_CONNECTOR. > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Looks good, Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Hi Dmitry, Thank you for the patch. On Sun, Jul 10, 2022 at 09:45:36PM +0300, Dmitry Baryshkov wrote: > Now as the driver does not depend on pdata->connector, add support for > attaching the bridge with DRM_BRIDGE_ATTACH_NO_CONNECTOR. > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > --- > drivers/gpu/drm/bridge/ti-sn65dsi86.c | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > index df08207d6223..9bca4615f71b 100644 > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > @@ -698,11 +698,6 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, > struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); > int ret; > > - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { > - DRM_ERROR("Fix bridge driver to make connector optional!"); > - return -EINVAL; > - } > - > pdata->aux.drm_dev = bridge->dev; > ret = drm_dp_aux_register(&pdata->aux); > if (ret < 0) { > @@ -710,15 +705,15 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, > return ret; > } > > - /* We never want the next bridge to *also* create a connector: */ > - flags |= DRM_BRIDGE_ATTACH_NO_CONNECTOR; > - > - /* Attach the next bridge */ > + /* Attach the next bridge, We never want the next bridge to *also* create a connector. */ s/bridge,/bridge./ I also would have wrapped this line. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > ret = drm_bridge_attach(bridge->encoder, pdata->next_bridge, > - &pdata->bridge, flags); > + &pdata->bridge, flags | DRM_BRIDGE_ATTACH_NO_CONNECTOR); > if (ret < 0) > goto err_initted_aux; > > + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) > + return 0; > + > pdata->connector = drm_bridge_connector_init(pdata->bridge.dev, > pdata->bridge.encoder); > if (IS_ERR(pdata->connector)) {
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index df08207d6223..9bca4615f71b 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -698,11 +698,6 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); int ret; - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { - DRM_ERROR("Fix bridge driver to make connector optional!"); - return -EINVAL; - } - pdata->aux.drm_dev = bridge->dev; ret = drm_dp_aux_register(&pdata->aux); if (ret < 0) { @@ -710,15 +705,15 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, return ret; } - /* We never want the next bridge to *also* create a connector: */ - flags |= DRM_BRIDGE_ATTACH_NO_CONNECTOR; - - /* Attach the next bridge */ + /* Attach the next bridge, We never want the next bridge to *also* create a connector. */ ret = drm_bridge_attach(bridge->encoder, pdata->next_bridge, - &pdata->bridge, flags); + &pdata->bridge, flags | DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (ret < 0) goto err_initted_aux; + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) + return 0; + pdata->connector = drm_bridge_connector_init(pdata->bridge.dev, pdata->bridge.encoder); if (IS_ERR(pdata->connector)) {
Now as the driver does not depend on pdata->connector, add support for attaching the bridge with DRM_BRIDGE_ATTACH_NO_CONNECTOR. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)