STRUCT DRM_ENCODER_FUNCS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so this is the page for struct drm_encoder_funcs from the Kernel API Manual, and honestly? it's giving "small struct, big responsibilities." let's get into it πŸŽ€

✨ NAME ✨

struct drm_encoder_funcs β€” encoder controls. that's it, that's the name, she's concise πŸ‘‘

🌸 SYNOPSIS 🌸

struct drm_encoder_funcs {
    void (*reset)(struct drm_encoder *encoder);
    void (*destroy)(struct drm_encoder *encoder);
    int (*late_register)(struct drm_encoder *encoder);
    void (*early_unregister)(struct drm_encoder *encoder);
    void (*debugfs_init)(struct drm_encoder *encoder, struct dentry
*root);
 };

look at those five little function pointers. precious. iconic. load-bearing. πŸ’–

πŸ¦‹ Members πŸ¦‹

  • reset β€” resets the encoder's hardware and software state back to off. lowkey important: this one is not called by the core directly β€” it only gets called through drm_mode_config_reset. and yes, the fact that it's not a helper hook is purely for historical reasons. don't ask, we don't know either πŸ™ˆ
  • destroy β€” cleans up the encoder's resources. it's only called at driver unload time, through drm_mode_config_cleanup, because an encoder cannot be hotplugged in DRM. no hotplugging, no drama, no cap πŸ’…
  • late_register β€” an optional hook (so you don't have to) that lets you register extra userspace interfaces attached to the encoder. it gets called late in the driver load sequence, from drm_dev_register. super important though bestie: everything you add from this callback should be unregistered in the early_unregister callback. every single thing. i'm watching you πŸ‘€

Returns:

0 on success, or a negative error code on failure. no in-between, she's decisive ✨

  • early_unregister β€” an optional hook that should undo whatever late_register did: unregister the additional userspace interfaces attached to the encoder. it's called from drm_dev_unregister, early in the driver unload sequence, so that userspace access gets disabled before the data structures are torndown. safety first, chaos later 🫢
  • debugfs_init β€” lets encoders create their own encoder-specific debugfs files. go off, make your little debug files, i love that for you 🌈

πŸ’œ Description πŸ’œ

encoders sit between CRTCs and connectors.

that's the whole description. short king energy. she said "my job is clear and it is structural." literal main character of the display pipeline pipeline 🧚

⭐ SEE ALSO ⭐

kernel file ./include/drm/drm_encoder.h, plus a whole friend group: struct drm_encoder(9), drmm_encoder_alloc(9), drmm_plain_encoder_alloc(9), drm_encoder_index(9), drm_encoder_mask(9), drm_encoder_crtc_ok(9), drm_encoder_find(9), drm_for_each_encoder_mask(9), drm_for_each_encoder(9). go read them all, i'll wait πŸ’€


okay that's the page!! this one came from ./include/drm, October 2026 β€” so like, mark your calendars bestie, and remember: register it late, unregister it early, and slay πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from