STRUCT VDEC_VPU_INST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct vdec_vpu_inst(9) β€” the Kernel API Manual glow-up you didn't know you needed πŸ’–

okay bestie, so this is a page straight out of the Kernel API Manual, and it's about struct vdec_vpu_inst β€” literally the VPU instance for the video codec. no cap, this is the little data homegirl that holds all the decoder's state. let's get into it πŸŽ€


✨ NAME ✨

struct vdec_vpu_inst β€” VPU instance for video codec πŸ¦‹

like, the whole vibe of this struct is "I am one (1) instance of a VPU, and I handle video codec things." iconic behaviour honestly.


🌸 SYNOPSIS 🌸

struct vdec_vpu_inst {
    int id;
    int core_id;
    void *vsi;
    int32_t failure;
    uint32_t inst_addr;
    uint32_t fw_abi_version;
    uint32_t inst_id;
    unsigned int signaled;
    struct mtk_vcodec_dec_ctx *ctx;
    wait_queue_head_t wq;
    mtk_vcodec_ipi_handler handler;
    unsigned int codec_type;
    unsigned int capture_type;
    unsigned int fb_sz[2];
 };

look at her. fourteen fields. all of them carrying their little job on their shoulders πŸ˜­πŸ’…


πŸ‘‘ Members πŸ‘‘

  • id β€” the ipi msg id for each decoder πŸ†” β€” this is how each decoder gets told apart in the message flow.
  • core_id β€” the core id, used to separate different hardware β€” because not every core is the same core, okay?
  • vsi β€” the driver structure allocated by the VPU side and shared over to the AP side, so the two sides can share control and info 🀝 β€” a whole little shared hangout spot.
  • failure β€” the VPU execution result status: 0 means success, and anything else means fail πŸ’€ (yes, "others: fail" β€” that's the actual rule, bestie, don't come for me).
  • inst_addr β€” the VPU decoder instance address πŸ“ β€” where the instance lives.
  • fw_abi_version β€” the ABI version of the firmware β€” important, because the next member literally depends on it πŸ‘€.
  • inst_id β€” if fw_abi_version >= 2, this contains the instance ID, and that ID gets given in place of inst_addr in messages. so like... new firmware, new way of pointing at the instance ✨
  • signaled β€” 1 means the host has received the ack message from the VPU; 0 means it has not been received πŸ“¬ β€” the classic "did they text back" flag, fr fr.
  • ctx β€” the context for v4l2 layer integration 🫢 β€” this is where the v4l2 side plugs in.
  • wq β€” the wait queue used to wait for a VPU message ack ⏳ β€” the "pls hold, waiting for a reply" line.
  • handler β€” the ipi handler for each decoder πŸ“ž β€” someone's gotta pick up when the message comes in.
  • codec_type β€” uses codec type to separate different codecs 🎬 β€” different codec, different bucket.
  • capture_type β€” uses capture type to separate different capture formats 🌈 β€” same deal, but for capture formats.
  • fb_sz β€” the frame buffer size of each plane πŸ–ΌοΈ β€” it's an array of two, so one size per plane, mmkay?
side note bestie: fb_sz[2] is literally two entries, one per plane β€” the doc says "of each plane" and that's the whole tea 🍡

πŸ”₯ SEE ALSO πŸ”₯

Kernel file:

./drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.h

and the whole friend group 🫢:


that's the whole page, bestie β€” go forth and slay your MediaTek decoder integration πŸ’œβœ¨

🧚 sign-off time: this lil page came from ./drivers/media/platform/media... and it's dated October 2026. mwah πŸ’‹ see u in the next manpage πŸŽ€
πŸ“¦ where this page comes from