drm_connector_init_with_ddc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_connector_init_with_ddc β€” Kernel API Manual πŸ’…

okay so bestie, you're in the drm_connector_init_with_ddc(9) page, which lives in the Kernel API Manual, and honestly? it's a vibe. it's the glow-up ritual for a connector you already allocated yourself. let's get into it ✨


✨ NAME ✨

drm_connector_init_with_ddc β€” Init a preallocated connector πŸŽ€

✨ SYNOPSIS ✨

int drm_connector_init_with_ddc (struct drm_device *dev , struct
       drm_connector *connector , const struct drm_connector_funcs *funcs , int
       connector_type , struct i2c_adapter *ddc );

✨ ARGUMENTS ✨

  • dev β€” the DRM device, your main character 🫢
  • connector β€” the connector to init. it's the connector. the one getting the makeover πŸ’…
  • funcs β€” callbacks for this connector, aka its personality traits 🌸
  • connector_type β€” user visible type of the connector, so the humans know what they're looking at πŸ‘€
  • ddc β€” pointer to the associated ddc adapter, its little sidekick πŸ¦‹

✨ DESCRIPTION ✨

So like, this initialises a preallocated connector. Connectors should be subclassed as part of driver connector objects β€” that's the assignment, no skipping it bestie πŸ“

At driver unload time the driver's drm_connector_funcs.destroy hook should call drm_connector_cleanup and free the connector structure. like, you brought it into this world, you clean it up 🧹

⚠️ The connector structure should not be allocated with devm_kzalloc. not to be dramatic but this is the "don't do it" part of the page πŸ’€

It also Ensures that the ddc field of the connector is correctly set. slay, one less thing for you to worry about ✨

✨ NOTE ✨

consider using drmm_connector_init instead of drm_connector_init_with_ddc to let the DRM managed resource infrastructure take care of cleanup and deallocation. genuinely so much easier, the DRM managed resource infrastructure is doing the most so you don't have to πŸ‘‘

✨ RETURN ✨

Zero on success, error code on failure. iykyk β€” 0 is the happy ending, anything else means check yourself 😭

✨ SEE ALSO ✨

Kernel file ./drivers/gpu/drm/drm_connector.c plus the whole extended universe of friends, icymi:


and that's the whole page bestie, no cap 🫢 this came out of ./drivers/gpu/drm in October 2026, and it's filed under drm_connector_init_with_ddc(9) β€” go init something gorgeous πŸ’œπŸ§š

πŸ“¦ where this page comes from