diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2019-12-03 15:15:09 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2019-12-09 10:03:17 +0100 |
commit | 4ec5c9050a496a984ffdaaf2307aef353634dc87 (patch) | |
tree | 0608fd53cc0abdaaa8c943bdfda67182f66e2ab6 /include/drm/drm_bridge.h | |
parent | drm/bridge: Make the bridge chain a double-linked list (diff) | |
download | linux-4ec5c9050a496a984ffdaaf2307aef353634dc87.tar.xz linux-4ec5c9050a496a984ffdaaf2307aef353634dc87.zip |
drm/bridge: Add the drm_for_each_bridge_in_chain() helper
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191203141515.3597631-6-boris.brezillon@collabora.com
Diffstat (limited to 'include/drm/drm_bridge.h')
-rw-r--r-- | include/drm/drm_bridge.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index c118726469ee..1eb854025a20 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -441,6 +441,17 @@ drm_bridge_chain_get_first_bridge(struct drm_encoder *encoder) struct drm_bridge, chain_node); } +/** + * drm_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) + bool drm_bridge_chain_mode_fixup(struct drm_bridge *bridge, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); |