STRUCT MTK_VCODEC_DEC_DEV(9)
π 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, iconicm2m_dev_decβ m2m device for the decoder, mem2mem core girlies knowplat_devβ platform device, the origin storyctx_listβ list ofstruct 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 lorevdecsys_regmapβVDEC_SYSregister space passed through sysconfw_handlerβ used to communicate with the firmware, her little hotline πid_counterβ used to identify current opened instancedec_mutexβ decoder hardware lockdev_mutexβ video_device lockdev_ctx_lockβ the lock of context list πdecode_workqueueβ decode work queue, getting stuff done fr frirqlockβ protect data access by irq handler and work threaddec_irqβ decoder irq resourcepmβ power management control β‘dec_capabilityβ used to identify decode capability, ex:4kcore_workqueueβ queue used for core hardware decodesubdev_devβ subdev hardware devicesubdev_prob_doneβ check whether all used hw device is prob done πsubdev_bitmapβ used to record hardware is ready or notdec_active_cntβ used to mark whether need to record register valuevdec_racing_infoβ record register valuedec_racing_info_mutexβ mutex lock used for inner racing modedbgfsβ 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
- 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