drm_panel_bridge_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_panel_bridge_add(9) β€” like, the Kernel API Manual, bestie πŸŽ€

okay so real talk, this one lives in the Kernel API Manual and it's honestly kind of iconic once you get what it's doing. Let's get into it ✨


🌸 NAME 🌸

drm_panel_bridge_add β€” creates a &drm_bridge and a &drm_connector that literally just call the appropriate functions from &drm_panel. That's the whole vibe, no cap 🫢


✨ SYNOPSIS ✨

struct drm_bridge * drm_panel_bridge_add (struct drm_panel *panel );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • panel β€” the drm_panel that's getting wrapped up all cozy. must be non-NULL fr fr, don't come at it with a NULL, it will not slay πŸ’€

πŸ’– DESCRIPTION πŸ’–

so this is for the drivers out there converting from directly using drm_panel (glow-up era ✨). the expected usage pattern? okay so:

  • during either encoder module probe or DSI host attach, a drm_panel gets looked up through drm_of_find_panel_or_bridge
  • then drm_panel_bridge_add wraps that panel in the new bridge, and the result can be passed right along to drm_bridge_attach
  • and here's the fun part β€” drm_panel_prepare and its related functions can be dropped from the encoder driver entirely (they're now called by the KMS helpers before calling into the encoder), along with connector creation. like, bye bestie, the helpers handle it πŸ‘‹
  • when you're done with the bridge (after drm_mode_config_cleanup if the bridge has already been attached), then you hit up drm_panel_bridge_remove to free it. clean up your room, periodt 🧹

the connector type gets set to panel->connector_type, and it must be set to a known type. so like, calling this function with a panel whose connector type is DRM_MODE_CONNECTOR_Unknown will return ERR_PTR(-EINVAL). vibe check failed, respectfully πŸ™ˆ

also! peep devm_drm_panel_bridge_add if you want an automatically managed version of this function. it's giving "I'll handle the cleanup for you, you're welcome" πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/gpu/drm/bridge/panel.c plus the whole friend group:


and that's the whole page, bestie β€” mwah πŸ’‹ this little beauty comes from ./drivers/gpu/drm/bridge, dated October 2026, and it's filed under drm_panel_bridge_add(9). go forth and wrap those panels, you've absolutely got this πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from