drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_cmn_drv.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_cmn_drv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_cmn_drv.h- Extension
.h- Size
- 3041 bytes
- Lines
- 148
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hlinux/videodev2.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-ioctl.hmedia/v4l2-mem2mem.hmedia/videobuf2-core.h
Detected Declarations
struct mtk_vcodec_clk_infostruct mtk_vcodec_clkstruct mtk_vcodec_pmstruct mtk_video_fmtstruct mtk_q_dataenum mtk_q_typeenum mtk_hw_reg_idxenum mtk_vdec_hw_idenum mtk_instance_stateenum mtk_fmt_typeenum mtk_instance_type
Annotated Snippet
struct mtk_vcodec_clk_info {
const char *clk_name;
struct clk *vcodec_clk;
};
/*
* struct mtk_vcodec_clk - Structure used to store vcodec clock information
*/
struct mtk_vcodec_clk {
struct mtk_vcodec_clk_info *clk_info;
int clk_num;
};
/*
* struct mtk_vcodec_pm - Power management data structure
*/
struct mtk_vcodec_pm {
struct mtk_vcodec_clk vdec_clk;
struct mtk_vcodec_clk venc_clk;
struct device *dev;
};
/*
* enum mtk_vdec_hw_id - Hardware index used to separate
* different hardware
*/
enum mtk_vdec_hw_id {
MTK_VDEC_CORE,
MTK_VDEC_LAT0,
MTK_VDEC_LAT1,
MTK_VDEC_LAT_SOC,
MTK_VDEC_HW_MAX,
};
/**
* enum mtk_instance_state - The state of an MTK Vcodec instance.
* @MTK_STATE_FREE: default state when instance is created
* @MTK_STATE_INIT: vcodec instance is initialized
* @MTK_STATE_HEADER: vdec had sps/pps header parsed or venc
* had sps/pps header encoded
* @MTK_STATE_FLUSH: vdec is flushing. Only used by decoder
* @MTK_STATE_ABORT: vcodec should be aborted
*/
enum mtk_instance_state {
MTK_STATE_FREE = 0,
MTK_STATE_INIT = 1,
MTK_STATE_HEADER = 2,
MTK_STATE_FLUSH = 3,
MTK_STATE_ABORT = 4,
};
enum mtk_fmt_type {
MTK_FMT_DEC = 0,
MTK_FMT_ENC = 1,
MTK_FMT_FRAME = 2,
};
/*
* struct mtk_video_fmt - Structure used to store information about pixelformats
*/
struct mtk_video_fmt {
u32 fourcc;
enum mtk_fmt_type type;
u32 num_planes;
u32 flags;
struct v4l2_frmsize_stepwise frmsize;
};
/*
* struct mtk_q_data - Structure used to store information about queue
*/
struct mtk_q_data {
unsigned int visible_width;
unsigned int visible_height;
unsigned int coded_width;
unsigned int coded_height;
enum v4l2_field field;
unsigned int bytesperline[MTK_VCODEC_MAX_PLANES];
unsigned int sizeimage[MTK_VCODEC_MAX_PLANES];
const struct mtk_video_fmt *fmt;
};
/*
* enum mtk_instance_type - The type of an MTK Vcodec instance.
*/
enum mtk_instance_type {
MTK_INST_DECODER = 0,
MTK_INST_ENCODER = 1,
};
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/videodev2.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`, `media/v4l2-ioctl.h`, `media/v4l2-mem2mem.h`, `media/videobuf2-core.h`.
- Detected declarations: `struct mtk_vcodec_clk_info`, `struct mtk_vcodec_clk`, `struct mtk_vcodec_pm`, `struct mtk_video_fmt`, `struct mtk_q_data`, `enum mtk_q_type`, `enum mtk_hw_reg_idx`, `enum mtk_vdec_hw_id`, `enum mtk_instance_state`, `enum mtk_fmt_type`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.