STRUCT SUNXI_ENGINE_OPS(9)
β¨ 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 thedrm_crtc_helper_funcs.atomic_begincallback, 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 thedrm_crtc_helper_funcs.atomic_checkcallback, 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 π¦
- Kernel file
./drivers/gpu/drm/sun4i/sunxi_engine.hstructsunxi_engine(9) sunxi_engine_commit(9)sunxi_engine_layers_init(9)sunxi_engine_apply_color_correction(9)sunxi_engine_disable_color_correction(9)sunxi_engine_mode_set(9)
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
- 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