drivers/media/platform/amphion/vdec.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/amphion/vdec.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/amphion/vdec.c- Extension
.c- Size
- 50966 bytes
- Lines
- 1985
- 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.
- 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
linux/init.hlinux/interconnect.hlinux/ioctl.hlinux/list.hlinux/kernel.hlinux/module.hlinux/videodev2.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-mem2mem.hmedia/v4l2-ioctl.hmedia/videobuf2-v4l2.hmedia/videobuf2-dma-contig.hvpu.hvpu_defs.hvpu_core.hvpu_helpers.hvpu_v4l2.hvpu_cmds.hvpu_rpc.h
Detected Declarations
struct vdec_fs_infostruct vdec_frame_store_tstruct vdec_tfunction vdec_op_s_ctrlfunction vdec_ctrl_initfunction vdec_attach_frame_storefunction vdec_reset_frame_storefunction vdec_handle_resolution_changefunction vdec_update_statefunction vdec_set_last_buffer_dequeuedfunction vdec_querycapfunction vdec_enum_fmtfunction vdec_g_fmtfunction vdec_try_fmtfunction vdec_s_fmt_commonfunction vdec_s_fmtfunction vdec_g_selectionfunction vdec_drainfunction vdec_cmd_startfunction vdec_cmd_stopfunction vdec_decoder_cmdfunction vdec_subscribe_eventfunction vdec_check_readyfunction vdec_frame_decodedfunction vdec_buf_donefunction vdec_stop_donefunction vdec_check_source_changefunction vdec_init_fmtfunction vdec_init_cropfunction vdec_init_mbifunction vdec_init_dcpfunction vdec_request_one_fsfunction vdec_alloc_fs_bufferfunction vdec_alloc_fsfunction vdec_clear_fsfunction vdec_response_fsfunction vdec_response_frame_abnormalfunction vdec_response_framefunction vdec_response_fs_requestfunction vdec_response_fs_releasefunction vdec_recycle_bufferfunction vdec_release_curr_frame_storefunction vdec_clear_slotsfunction vdec_update_v4l2_ctrlfunction vdec_update_v4l2_profile_levelfunction vdec_event_seq_hdrfunction vdec_event_resolution_changefunction vdec_event_req_fs
Annotated Snippet
struct vdec_fs_info {
char name[8];
u32 type;
u32 max_count;
u32 req_count;
u32 count;
u32 index;
u32 size;
struct vpu_buffer buffer[32];
u32 tag;
};
struct vdec_frame_store_t {
struct vpu_vb2_buffer *curr;
struct vpu_vb2_buffer *pend;
dma_addr_t addr;
unsigned int state;
u32 tag;
};
struct vdec_t {
u32 seq_hdr_found;
struct vpu_buffer udata;
struct vpu_decode_params params;
struct vpu_dec_codec_info codec_info;
enum vpu_codec_state state;
struct vdec_frame_store_t *slots;
u32 slot_count;
u32 req_frame_count;
struct vdec_fs_info mbi;
struct vdec_fs_info dcp;
u32 seq_tag;
bool reset_codec;
bool fixed_fmt;
u32 decoded_frame_count;
u32 display_frame_count;
u32 sequence;
u32 eos_received;
bool is_source_changed;
u32 source_change;
u32 drain;
bool aborting;
};
static const struct vpu_format vdec_formats[] = {
{
.pixfmt = V4L2_PIX_FMT_NV12M_8L128,
.mem_planes = 2,
.comp_planes = 2,
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.sibling = V4L2_PIX_FMT_NV12_8L128,
},
{
.pixfmt = V4L2_PIX_FMT_NV12_8L128,
.mem_planes = 1,
.comp_planes = 2,
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.sibling = V4L2_PIX_FMT_NV12M_8L128,
},
{
.pixfmt = V4L2_PIX_FMT_NV12M_10BE_8L128,
.mem_planes = 2,
.comp_planes = 2,
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.sibling = V4L2_PIX_FMT_NV12_10BE_8L128,
},
{
.pixfmt = V4L2_PIX_FMT_NV12_10BE_8L128,
.mem_planes = 1,
.comp_planes = 2,
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.sibling = V4L2_PIX_FMT_NV12M_10BE_8L128
},
{
.pixfmt = V4L2_PIX_FMT_H264,
.mem_planes = 1,
.comp_planes = 1,
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
},
{
.pixfmt = V4L2_PIX_FMT_H264_MVC,
.mem_planes = 1,
.comp_planes = 1,
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
},
{
Annotation
- Immediate include surface: `linux/init.h`, `linux/interconnect.h`, `linux/ioctl.h`, `linux/list.h`, `linux/kernel.h`, `linux/module.h`, `linux/videodev2.h`, `media/v4l2-device.h`.
- Detected declarations: `struct vdec_fs_info`, `struct vdec_frame_store_t`, `struct vdec_t`, `function vdec_op_s_ctrl`, `function vdec_ctrl_init`, `function vdec_attach_frame_store`, `function vdec_reset_frame_store`, `function vdec_handle_resolution_change`, `function vdec_update_state`, `function vdec_set_last_buffer_dequeued`.
- 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.