drm_bridge_attach(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_bridge_attach(9) β€” Kernel API Manual, bestie edition

okay so we're in the Kernel API Manual today and the vibe is bridge engineering πŸŽ€ like the drm_bridge_attach(9) girlies know exactly what's up. let's get into it ✨

🌸 NAME 🌸

drm_bridge_attach β€” attach the bridge to an encoder's chain πŸ’«

✨ SYNOPSIS ✨

int drm_bridge_attach (struct drm_encoder *encoder , struct drm_bridge
*bridge , struct drm_bridge *previous , enum drm_bridge_attach_flags
flags );

🫢 ARGUMENTS 🫢

  • encoder β€” the DRM encoder. the main character of this whole situation ngl πŸ‘‘
  • bridge β€” the bridge you're attaching. she's the one we're linking up πŸ’…
  • previous β€” the previous bridge in the chain (optional, bestie, it's fine if she's not there) πŸ¦‹
  • flags β€” the DRM_BRIDGE_ATTACH_* flags. literally the flags, that's the whole description 🌈

🧚 DESCRIPTION 🧚

So a kms driver calls this to link the bridge to an encoder's chain. ✨ The previous argument specifies the previous bridge in the chain β€” very much giving "who came before me" energy. If it's NULL, the bridge is linked directly at the encoder's output. Otherwise it gets linked at the previous bridge's output. periodt πŸ’…

If previous is non-NULL, that previous bridge must already be attached by a call to this function. no cap, that's a requirement fr fr 😭

The bridge you're attaching must have been previously added by drm_bridge_add. like she has to exist before you can be obsessed with her, y'know? πŸŽ€

⚠️ important vibes: bridges attached to encoders are auto-detached during encoder cleanup in drm_encoder_cleanup, so drm_bridge_attach should generally not be balanced with a drm_bridge_detach in driver code. not me warning you about double-detaching πŸ’€ please don't.

⭐ RETURN ⭐

Zero on success, error code on failure. that's it, that's the tea πŸ“

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/gpu/drm/drm_bridge.c, plus the whole friend group:


k bye bestie, go attach some bridges πŸ’– this page lives in ./drivers/gpu/drm, dated October 2026, and it's literally drm_bridge_attach(9) β€” iykyk πŸ¦‹πŸ’…

πŸ“¦ where this page comes from