STRUCT DRM_ENCODER_FUNCS(9)
π 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 throughdrm_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, throughdrm_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, fromdrm_dev_register. super important though bestie: everything you add from this callback should be unregistered in theearly_unregistercallback. 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 whateverlate_registerdid: unregister the additional userspace interfaces attached to the encoder. it's called fromdrm_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
- 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