STRUCT VDEC_VPU_INST(9)
π 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:0means 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β iffw_abi_version >= 2, this contains the instance ID, and that ID gets given in place ofinst_addrin messages. so like... new firmware, new way of pointing at the instance β¨signaledβ1means the host has received the ack message from the VPU;0means 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 π«Ά:
vpu_dec_init(9)vpu_dec_start(9)vpu_dec_end(9)vpu_dec_deinit(9)vpu_dec_reset(9)vpu_dec_core(9)vpu_dec_core_end(9)vpu_dec_get_param(9)
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
- 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