STRUCT MTK_VCODEC_DEC_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct mtk_vcodec_dec_dev β€” driver data, bestie. it's the main-character struct of the MediaTek decoder driver πŸŽ€


✨ SYNOPSIS ✨

okay so picture the whole vibe of this thing, like literally every field, no skips:

struct mtk_vcodec_dec_dev {
    struct v4l2_device v4l2_dev;
    struct video_device *vfd_dec;
    struct media_device mdev_dec;
    struct v4l2_m2m_dev *m2m_dev_dec;
    struct platform_device *plat_dev;
    struct list_head ctx_list;
    struct mtk_vcodec_dec_ctx *curr_ctx;
    void __iomem *reg_base[NUM_MAX_VCODEC_REG_BASE];
    const struct mtk_vcodec_dec_pdata *vdec_pdata;
    struct regmap *vdecsys_regmap;
    struct mtk_vcodec_fw *fw_handler;
    u64 id_counter;
    struct mutex dec_mutex[MTK_VDEC_HW_MAX];
    struct mutex dev_mutex;
    spinlock_t dev_ctx_lock;
    struct workqueue_struct *decode_workqueue;
    spinlock_t irqlock;
    int dec_irq;
    struct mtk_vcodec_pm pm;
    unsigned int dec_capability;
    struct workqueue_struct *core_workqueue;
    void *subdev_dev[MTK_VDEC_HW_MAX];
    int (*subdev_prob_done)(struct mtk_vcodec_dec_dev *vdec_dev);
    unsigned long subdev_bitmap[BITS_TO_LONGS( MTK_VDEC_HW_MAX)];
    atomic_t dec_active_cnt;
    u32 vdec_racing_info[132];
    struct mutex dec_racing_info_mutex;
    struct mtk_vcodec_dbgfs dbgfs;
    enum mtk_vcodec_dec_chip_name chip_name;
 };

like, that's a lot of fields but we're gonna go through every single one, periodt πŸ’…


πŸ¦‹ MEMBERS πŸ¦‹

get comfy, we're doing a full tour 🫢

  • v4l2_dev β€” the V4L2 device you register your video devices for ✨
  • vfd_dec β€” the video device for the decoder, its whole moment πŸŽ₯
  • mdev_dec β€” media device for the decoder, iconic
  • m2m_dev_dec β€” m2m device for the decoder, mem2mem core girlies know
  • plat_dev β€” platform device, the origin story
  • ctx_list β€” list of struct mtk_vcodec_ctx, the whole friend group πŸ’–
  • curr_ctx β€” the context that is waiting for codec hardware, like waiting for the bathroom at a party 😭
  • reg_base β€” mapped address of MTK Vcodec registers πŸ’…
  • vdec_pdata β€” decoder IC-specific data, the per-chip lore
  • vdecsys_regmap β€” VDEC_SYS register space passed through syscon
  • fw_handler β€” used to communicate with the firmware, her little hotline πŸ“ž
  • id_counter β€” used to identify current opened instance
  • dec_mutex β€” decoder hardware lock
  • dev_mutex β€” video_device lock
  • dev_ctx_lock β€” the lock of context list πŸ”’
  • decode_workqueue β€” decode work queue, getting stuff done fr fr
  • irqlock β€” protect data access by irq handler and work thread
  • dec_irq β€” decoder irq resource
  • pm β€” power management control ⚑
  • dec_capability β€” used to identify decode capability, ex: 4k
  • core_workqueue β€” queue used for core hardware decode
  • subdev_dev β€” subdev hardware device
  • subdev_prob_done β€” check whether all used hw device is prob done πŸ‘€
  • subdev_bitmap β€” used to record hardware is ready or not
  • dec_active_cnt β€” used to mark whether need to record register value
  • vdec_racing_info β€” record register value
  • dec_racing_info_mutex β€” mutex lock used for inner racing mode
  • dbgfs β€” debug log related information, the receipts 🧾
  • chip_name β€” used to distinguish platforms and select the correct codec configuration values πŸ‘‘

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h β€” yes that exact path, go read her
  • struct vdec_pic_info(9)
  • struct mtk_vcodec_dec_pdata(9)
  • struct mtk_vcodec_dec_request(9)
  • struct mtk_vcodec_dec_ctx(9)

okay so that's the whole page πŸ’œ sign-off time: this came from ./drivers/media/platform/media... and it's dated October 2026, and the header said struct mtk_vcodec_dec_dev(9) from the Kernel API Manual β€” slay, ate, no cap πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from