STRUCT MEDIA_ENTITY_OPERATIONS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct media_entity_operations(9) β€” like, the whole ops table for media entities, bestie

okay so this is from the Kernel API Manual and it's genuinely one of those pages where the struct is the whole personality. it's giving "here's the callback buffet, pick your faves" πŸ“


✨ NAME ✨

struct media_entity_operations β€” Media entity operations πŸŽ€

🌸 SYNOPSIS 🌸

struct media_entity_operations {
    int (*get_fwnode_pad)(struct media_entity *entity, struct
fwnode_endpoint *endpoint);
    int (*link_setup)(struct media_entity *entity, const struct
media_pad *local, const struct media_pad *remote, u32 flags);
    int (*link_validate)(struct media_link *link);
    bool (*has_pad_interdep)(struct media_entity *entity, unsigned int
pad0, unsigned int pad1);
 };

like yes that's the actual layout, copy it exactly, don't come for me πŸ’€

πŸ‘‘ Members πŸ‘‘

  • get_fwnode_pad β€” returns the pad number based on a fwnode endpoint, or a negative value on error πŸ¦‹ this one's for mapping a fwnode onto a media pad number. it's Optional.
  • link_setup β€” notifies the entity that links changed, bestie πŸ”₯ and here's the tea: the operation can return an error, and if it does, link setup gets cancelled. it's Optional.
  • link_validate β€” returns whether a link is valid from the entity's point of view ✨ the media_pipeline_start function validates all links by calling this operation, so it's lowkey the vibe-checker of the whole pipeline. it's Optional.
  • has_pad_interdep β€” returns whether two pads of the entity are interdependent πŸ’– and if two pads are interdependent they're part of the same pipeline, and enabling one of the pads means the other pad becomes "locked" and doesn't allow configuration changes πŸ”’ pad0 and pad1 are guaranteed to not both be sinks or sources.
Never call the .has_pad_interdep operation directly β€” always use media_entity_has_pad_interdep 😭 fr fr, just use the wrapper.

Optional: if the operation isn't implemented, all pads will be considered as interdependent πŸ™ˆ

πŸ’œ Description πŸ’œ

NOTE: Those these callbacks are called with struct media_device.graph_mutex mutex held. 🫢 (so like, mind the lock, bestie β€” that mutex is already in your hands when these run)

🌈 SEE ALSO 🌈

kernel file ./include/media/media-entity.h β€” and here's the full squad, no skips, all of them πŸ‘‘:


and that's the page, periodt πŸ’… sign-off time: this lil masterpiece lives in ./include/media, it's dated October 2026, and it's filed under struct media...y_operations(9) β€” iconic, no notes, ate πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from