diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2019-12-03 15:15:08 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2019-12-09 10:03:01 +0100 |
commit | 05193dc38197021894b17239fafbd2eb1afe5a45 (patch) | |
tree | ae8656cacf3a21e180c0a9a920c3d661550032a3 /include/drm/drm_bridge.h | |
parent | drm: Stop accessing encoder->bridge directly (diff) | |
download | linux-05193dc38197021894b17239fafbd2eb1afe5a45.tar.xz linux-05193dc38197021894b17239fafbd2eb1afe5a45.zip |
drm/bridge: Make the bridge chain a double-linked list
So that each element in the chain can easily access its predecessor.
This will be needed to support bus format negotiation between elements
of the bridge chain.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191203141515.3597631-5-boris.brezillon@collabora.com
Diffstat (limited to 'include/drm/drm_bridge.h')
-rw-r--r-- | include/drm/drm_bridge.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index bd78c256b1ed..c118726469ee 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -384,8 +384,8 @@ struct drm_bridge { struct drm_device *dev; /** @encoder: encoder to which this bridge is connected */ struct drm_encoder *encoder; - /** @next: the next bridge in the encoder chain */ - struct drm_bridge *next; + /** @chain_node: used to form a bridge chain */ + struct list_head chain_node; #ifdef CONFIG_OF /** @of_node: device node pointer to the bridge */ struct device_node *of_node; @@ -420,7 +420,10 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, static inline struct drm_bridge * drm_bridge_get_next_bridge(struct drm_bridge *bridge) { - return bridge->next; + if (list_is_last(&bridge->chain_node, &bridge->encoder->bridge_chain)) + return NULL; + + return list_next_entry(bridge, chain_node); } /** @@ -434,7 +437,8 @@ drm_bridge_get_next_bridge(struct drm_bridge *bridge) static inline struct drm_bridge * drm_bridge_chain_get_first_bridge(struct drm_encoder *encoder) { - return encoder->bridge; + return list_first_entry_or_null(&encoder->bridge_chain, + struct drm_bridge, chain_node); } bool drm_bridge_chain_mode_fixup(struct drm_bridge *bridge, |