drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c- Extension
.c- Size
- 27266 bytes
- Lines
- 968
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
media/videobuf2-v4l2.hmedia/videobuf2-dma-contig.hmedia/v4l2-event.hmedia/v4l2-mem2mem.hlinux/module.hmtk_vcodec_dec.hmtk_vcodec_dec_pm.hvdec_drv_if.h
Detected Declarations
struct mtk_stateless_controlfunction mtk_vcodec_dec_request_releasefunction mtk_vdec_stateless_cap_to_dispfunction vb2ops_vdec_buf_request_completefunction mtk_vdec_workerfunction vb2ops_vdec_stateless_buf_queuefunction mtk_vdec_flush_decoderfunction mtk_vcodec_get_pic_infofunction mtk_vdec_s_ctrlfunction mtk_vcodec_dec_fill_h264_levelfunction mtk_vcodec_dec_fill_h264_profilefunction mtk_vcodec_dec_fill_h265_levelfunction mtk_vcodec_dec_fill_h265_profilefunction mtk_vcodec_dec_fill_vp9_levelfunction mtk_vcodec_dec_fill_vp9_profilefunction mtk_vcodec_dec_reset_controlsfunction mtk_vcodec_dec_ctrls_setupfunction fops_media_request_freefunction fops_media_request_validatefunction fops_media_request_queuefunction mtk_vcodec_add_formatsfunction mtk_vcodec_get_supported_formatsfunction mtk_init_vdec_paramsfunction vb2ops_vdec_out_buf_validate
Annotated Snippet
struct mtk_stateless_control {
struct v4l2_ctrl_config cfg;
int codec_type;
};
static const struct mtk_stateless_control mtk_stateless_controls[] = {
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SPS,
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_PPS,
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SCALING_MATRIX,
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_DECODE_PARAMS,
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE,
.def = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN,
.max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
.menu_skip_mask =
BIT(V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) |
BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED),
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL,
.min = V4L2_MPEG_VIDEO_H264_LEVEL_1_0,
.def = V4L2_MPEG_VIDEO_H264_LEVEL_4_1,
.max = V4L2_MPEG_VIDEO_H264_LEVEL_4_2,
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_DECODE_MODE,
.min = V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED,
.def = V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED,
.max = V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED,
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_START_CODE,
.min = V4L2_STATELESS_H264_START_CODE_ANNEX_B,
.def = V4L2_STATELESS_H264_START_CODE_ANNEX_B,
.max = V4L2_STATELESS_H264_START_CODE_ANNEX_B,
},
.codec_type = V4L2_PIX_FMT_H264_SLICE,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_VP8_FRAME,
},
.codec_type = V4L2_PIX_FMT_VP8_FRAME,
},
{
.cfg = {
.id = V4L2_CID_MPEG_VIDEO_VP8_PROFILE,
.min = V4L2_MPEG_VIDEO_VP8_PROFILE_0,
.def = V4L2_MPEG_VIDEO_VP8_PROFILE_0,
.max = V4L2_MPEG_VIDEO_VP8_PROFILE_3,
},
.codec_type = V4L2_PIX_FMT_VP8_FRAME,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_VP9_FRAME,
},
.codec_type = V4L2_PIX_FMT_VP9_FRAME,
},
{
Annotation
- Immediate include surface: `media/videobuf2-v4l2.h`, `media/videobuf2-dma-contig.h`, `media/v4l2-event.h`, `media/v4l2-mem2mem.h`, `linux/module.h`, `mtk_vcodec_dec.h`, `mtk_vcodec_dec_pm.h`, `vdec_drv_if.h`.
- Detected declarations: `struct mtk_stateless_control`, `function mtk_vcodec_dec_request_release`, `function mtk_vdec_stateless_cap_to_disp`, `function vb2ops_vdec_buf_request_complete`, `function mtk_vdec_worker`, `function vb2ops_vdec_stateless_buf_queue`, `function mtk_vdec_flush_decoder`, `function mtk_vcodec_get_pic_info`, `function mtk_vdec_s_ctrl`, `function mtk_vcodec_dec_fill_h264_level`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.