Message ID | 20190826152649.13820-12-boris.brezillon@collabora.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: Add support for bus-format negotiation | expand |
On 26/08/2019 17:26, Boris Brezillon wrote: > To iterate over all bridges attached to a specific encoder. > > Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> > --- > Changes in v2: > * New patch > --- > include/drm/drm_bridge.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h > index 8af92f0a9541..cf05b30f2967 100644 > --- a/include/drm/drm_bridge.h > +++ b/include/drm/drm_bridge.h > @@ -409,6 +409,17 @@ struct drm_bridge *of_drm_find_bridge(struct device_node *np); > int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, > struct drm_bridge *previous); > > +/** > + * for_each_bridge_in_chain() - Iterate over all bridges present in a chain > + * @encoder: the encoder to iterate bridges on > + * @bridge: a bridge pointer updated to point to the current bridge at each > + * iteration > + * > + * Iterate over all bridges present in the bridge chain attached to @encoder. > + */ > +#define drm_for_each_bridge_in_chain(encoder, bridge) \ > + list_for_each_entry(bridge, &(encoder)->bridge_chain, chain_node) > + > struct drm_bridge * > drm_bridge_chain_get_next_bridge(struct drm_bridge *bridge); > bool drm_bridge_chain_mode_fixup(struct drm_bridge *bridge, >
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 8af92f0a9541..cf05b30f2967 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -409,6 +409,17 @@ struct drm_bridge *of_drm_find_bridge(struct device_node *np); int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, struct drm_bridge *previous); +/** + * for_each_bridge_in_chain() - Iterate over all bridges present in a chain + * @encoder: the encoder to iterate bridges on + * @bridge: a bridge pointer updated to point to the current bridge at each + * iteration + * + * Iterate over all bridges present in the bridge chain attached to @encoder. + */ +#define drm_for_each_bridge_in_chain(encoder, bridge) \ + list_for_each_entry(bridge, &(encoder)->bridge_chain, chain_node) + struct drm_bridge * drm_bridge_chain_get_next_bridge(struct drm_bridge *bridge); bool drm_bridge_chain_mode_fixup(struct drm_bridge *bridge,
To iterate over all bridges attached to a specific encoder. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> --- Changes in v2: * New patch --- include/drm/drm_bridge.h | 11 +++++++++++ 1 file changed, 11 insertions(+)