STRUCT MTK_VPU(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct mtk_vpu(9)

okay so this is a page from the Kernel API Manual, and bestie, we are about to get so acquainted with the VPU driver data struct. no cap, it's a good one. 🫢


🌸 NAME 🌸

struct mtk_vpu β€” literally just the vpu driver data. that's the whole vibe. ✨


πŸŽ€ SYNOPSIS πŸŽ€

struct mtk_vpu {
    struct vpu_mem extmem[2];
    struct vpu_regs reg;
    struct vpu_run run;
    struct vpu_wdt wdt;
    struct vpu_ipi_desc ipi_desc[IPI_MAX];
    struct share_obj __iomem *recv_buf;
    struct share_obj __iomem *send_buf;
    struct device *dev;
    struct clk *clk;
    bool fw_loaded;
    bool enable_4GB;
    struct mutex vpu_mutex;
    u32 wdt_refcnt;
    wait_queue_head_t ack_wq;
    bool ipi_id_ack[IPI_MAX];
 };

like, look at her. iconic struct. no notes. πŸ‘‘


πŸ¦‹ Members πŸ¦‹

✨ the actual members, one by one ✨

  • extmem β€” the VPU extended memory information. extra memory, extra slay. πŸ’–
  • reg β€” the VPU TCM and configuration registers. very official. very main character. ⭐
  • run β€” the VPU initialization status. is she up? is she running? this knows. πŸ”₯
  • wdt β€” the VPU watchdog workqueue. someone's gotta watch, fr fr. πŸ‘€
  • ipi_desc β€” the VPU IPI descriptor. πŸŽ€
  • recv_buf β€” the VPU DTCM share buffer for receiving. ⚠️ heads up: the receive buffer is only accessed in interrupt context. that's not a suggestion, that's the rule. πŸ’€
  • send_buf β€” the VPU DTCM share buffer for sending. the outgoing bestie. πŸ¦‹
  • dev β€” the VPU struct device. the whole identity tbh. 🌸
  • clk β€” the VPU clock on/off. turn it up. πŸ”₯
  • fw_loaded β€” indicates the VPU firmware is loaded. βœ…
  • enable_4GB β€” VPU 4GB mode on/off. 4GB mode is either giving or it isn't. πŸ’…
  • vpu_mutex β€” protects mtk_vpu (except recv_buf) and makes sure only one client uses the VPU service at a time. for example: suppose a client is using the VPU to decode VP8. if the other client wants to encode VP8, it has to wait until VP8 decode completes. no cutting the line, periodt. 🚧
  • wdt_refcnt β€” the WDT reference count, which makes sure the watchdog can be disabled if no other client is using the VPU service. 🧚
  • ack_wq β€” the wait queue for each codec and mdp. when sleeping processes wake up, they check the condition ipi_id_ack to run the corresponding action or go back to sleep. like a group chat notification β€” you check it, then maybe you go back to bed. 😭
  • ipi_id_ack β€” the ACKs for the registered IPI function sending an interrupt to the VPU. πŸ“¬

πŸ’œ SEE ALSO πŸ’œ

  • the kernel file ./drivers/media/platform/mediatek/vpu/mtk_vpu.c
  • enum vpu_fw_type(9)
  • struct vpu_mem(9)
  • struct vpu_regs(9)
  • struct vpu_wdt_handler(9)
  • struct vpu_wdt(9)
  • struct vpu_run(9)
  • struct vpu_ipi_desc(9)
  • struct share_obj(9)

go read those too, iykyk. 🫢


🌈 and that's the page, bestie! it came from ./drivers/media/platform/media... and it's dated October 2026. catch you in the next manpage, mwah πŸ’‹βœ¨
πŸ“¦ where this page comes from