drm_for_each...dge_in_chain(9)
π NAME π
drm_for_each_bridge_in_chain β okay bestie, this one's a macro that literally iterates over all the bridges attached to an encoder. every single one. no skipping. periodt. π
β¨ SYNOPSIS β¨
drm_for_each_bridge_in_chain (encoder , bridge );
π ARGUMENTS π
encoderβ the encoder you're iterating bridges on. that's your main character right there. πbridgeβ a bridge pointer that gets updated at each iteration so it points to the current bridge. like a little cursor that keeps up with the vibe check. π¦
πΈ DESCRIPTION πΈ
So the way this works: it iterates over every bridge present in the bridge chain attached to encoder. all of them. the whole squad. π«Ά
And it's lowkey doing a lot for you behind the scenes β it automatically gets/puts the bridge reference while iterating (so the refcount stays immaculate, no leaks, no cap β¨), and it locks the encoder chain mutex so nobody can go modify the chain while you're mid-loop. it's giving "protected energy". π
ngl, the locking part matters β don't go thinking you can just mutate the chain while you're iterating. that's not the vibe.
π₯ SEE ALSO π₯
Kernel file ./include/drm/drm_bridge.h, plus the whole bridge family β enum drm_bridge_attach_flags(9), struct drm_bridge_funcs(9), struct drm_bridge_timings(9), enum drm_bridge_ops(9), struct drm_bridge(9), devm_drm_bridge_alloc(9), drm_bridge_get_current_state(9), drm_bridge_get_next_bridge(9), drm_bridge_get_prev_bridge(9), drm_bridge_chain_get_first_bridge(9), drm_bridge_chain_get_last_bridge(9), and its sibling-in-chain drm_for_each_bridge_in_chain_from(9). π§
that's the whole lore, bestie β this page came from ./include/drm and it's dated October 2026, so go forth and iterate responsibly ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms