STRUCT SUNXI_ENGINE_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct sunxi_engine_ops(9) ✨

okay bestie, so we're deep in the Kernel API Manual and this one is literally about helper operations for sunXi engines πŸ’… no cap, it's the struct sunxi_engine_ops and it's giving "backstage crew for your DRM driver" energy. the common part of the DRM driver uses these hooks to do the right thing, and we're gonna walk through every single function pointer like it's a group chat roll call 🫢


🌸 SYNOPSIS 🌸

here's the whole struct, character-for-character, because we do not paraphrase code in this house:

struct sunxi_engine_ops {
    void (*atomic_begin)(struct sunxi_engine *engine, struct
drm_crtc_state *old_state);
    int (*atomic_check)(struct sunxi_engine *engine, struct
drm_crtc_state *state);
    void (*commit)(struct sunxi_engine *engine, struct drm_crtc *crtc,
struct drm_atomic_commit *state);
    struct drm_plane **(*layers_init)(struct drm_device *drm, struct
sunxi_engine *engine);
    void (*apply_color_correction)(struct sunxi_engine *engine);
    void (*disable_color_correction)(struct sunxi_engine *engine);
    void (*vblank_quirk)(struct sunxi_engine *engine);
    void (*mode_set)(struct sunxi_engine *engine, const struct
drm_display_mode *mode);
 };

πŸŽ€ Members πŸŽ€

bestie, let's go one by one. some of these are optional, some are mandatory β€” and you already know we're gonna call out which is which every single time πŸ‘‘

  • atomic_begin β€” this callback lets you prep your engine for an atomic update ✨ it's mirroring the drm_crtc_helper_funcs.atomic_begin callback, so any docs over there apply here too, fr fr.

this function is optional.

  • atomic_check β€” this one lets you validate plane-update-related CRTC constraints that are specific to engines πŸ” it mirrors the drm_crtc_helper_funcs.atomic_check callback, so all the documentation there applies.

this function is optional.

RETURNS:

0 on success or a negative error code.

  • commit β€” this callback triggers the hardware switch to commit the new configuration that's been set up during the next vblank period 🌈

this function is optional.

  • layers_init β€” this callback is used to allocate, initialize, and register the layers supported by that engine. it's a whole glow-up moment for your layers πŸ’…

this function is mandatory. (yes, you have to implement this one, no skipping πŸ™ˆ)

RETURNS:

the array of struct drm_plane backing the layers, or an error pointer on failure.

  • apply_color_correction β€” this callback enables color correction in the engine 🎨 it's useful only for the composite output.

this function is optional.

  • disable_color_correction β€” this callback stops the color correction in the engine. again, useful only for the composite output.

this function is optional.

  • vblank_quirk β€” this callback implements engine-specific behaviour as part of the VBLANK event πŸ¦‹
⚠️ okay this is the serious one bestie: it runs with all the constraints of an interrupt β€” it can't sleep, and all local interrupts are disabled β€” so it should be as fast as possible. like, blink-and-you-miss-it fast. no cap.

this function is optional.

  • mode_set β€” this callback sets mode-related parameters like interlacing, screen size, etc. β€” once per mode set 🌟

this function is optional.


πŸ’– Description πŸ’–

these hooks are used by the common part of the DRM driver to implement the proper behaviour. that's the whole vibe β€” the shared DRM code leans on these ops so everything behaves correctly πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, bestie! πŸŽ€ this little masterpiece lives in ./drivers/gpu/drm/sun4i, dated October 2026, and it's filed under struct sunxi_engine_ops(9) in the Kernel API Manual. slay, go implement your layers_init (it's mandatory, remember 😭), and i'll see you in the next man page πŸ’–βœ¨

πŸ“¦ where this page comes from