drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c- Extension
.c- Size
- 26456 bytes
- Lines
- 1018
- 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/fs.hlinux/slab.hlinux/syscalls.hlinux/delay.hlinux/time.h../../common/mtk_vcodec_intr.h../vdec_drv_base.h../vdec_vpu_if.h
Detected Declarations
struct vp9_dram_bufstruct vp9_fb_infostruct vp9_ref_cnt_bufstruct vp9_ref_bufstruct vp9_sf_ref_fbstruct vdec_vp9_vsistruct vdec_vp9_instfunction vp9_is_sf_ref_fbfunction list_for_each_entryfunction vp9_add_to_fb_free_listfunction vp9_free_sf_ref_fbfunction vp9_ref_cnt_fbfunction vp9_free_all_sf_ref_fbfunction vp9_get_sf_ref_fbfunction vp9_alloc_work_buffunction vp9_add_to_fb_disp_listfunction vp9_swap_frm_bufsfunction vp9_wait_dec_endfunction vp9_free_instfunction vp9_decode_end_procfunction vp9_is_last_sub_frmfunction vp9_add_to_fb_use_listfunction vp9_resetfunction init_all_fb_listsfunction get_pic_infofunction get_disp_fbfunction get_free_fbfunction validate_vsi_array_indexesfunction vdec_vp9_deinitfunction vdec_vp9_initfunction vdec_vp9_decodefunction get_crop_infofunction vdec_vp9_get_param
Annotated Snippet
struct vp9_dram_buf {
unsigned long va;
unsigned long pa;
unsigned int sz;
unsigned int padding;
};
/**
* struct vp9_fb_info - contains frame buffer info
* @fb : frame buffer
* @reserved : reserved field used by vpu
*/
struct vp9_fb_info {
struct vdec_fb *fb;
unsigned int reserved[32];
};
/**
* struct vp9_ref_cnt_buf - contains reference buffer information
* @buf : referenced frame buffer
* @ref_cnt : referenced frame buffer's reference count.
* When reference count=0, remove it from reference list
*/
struct vp9_ref_cnt_buf {
struct vp9_fb_info buf;
unsigned int ref_cnt;
};
/**
* struct vp9_ref_buf - contains current frame's reference buffer information
* @buf : reference buffer
* @idx : reference buffer index to frm_bufs
* @reserved : reserved field used by vpu
*/
struct vp9_ref_buf {
struct vp9_fb_info *buf;
unsigned int idx;
unsigned int reserved[6];
};
/**
* struct vp9_sf_ref_fb - contains frame buffer info
* @fb : super frame reference frame buffer
* @used : this reference frame info entry is used
* @padding : for 64 bytes size align
*/
struct vp9_sf_ref_fb {
struct vdec_fb fb;
int used;
int padding;
};
/*
* struct vdec_vp9_vsi - shared buffer between host and VPU firmware
* AP-W/R : AP is writer/reader on this item
* VPU-W/R: VPU is write/reader on this item
* @sf_bs_buf : super frame backup buffer (AP-W, VPU-R)
* @sf_ref_fb : record super frame reference buffer information
* (AP-R/W, VPU-R/W)
* @sf_next_ref_fb_idx : next available super frame (AP-W, VPU-R)
* @sf_frm_cnt : super frame count, filled by vpu (AP-R, VPU-W)
* @sf_frm_offset : super frame offset, filled by vpu (AP-R, VPU-W)
* @sf_frm_sz : super frame size, filled by vpu (AP-R, VPU-W)
* @sf_frm_idx : current super frame (AP-R, VPU-W)
* @sf_init : inform super frame info already parsed by vpu (AP-R, VPU-W)
* @fb : capture buffer (AP-W, VPU-R)
* @bs : bs buffer (AP-W, VPU-R)
* @cur_fb : current show capture buffer (AP-R/W, VPU-R/W)
* @pic_w : picture width (AP-R, VPU-W)
* @pic_h : picture height (AP-R, VPU-W)
* @buf_w : codec width (AP-R, VPU-W)
* @buf_h : coded height (AP-R, VPU-W)
* @buf_sz_y_bs : ufo compressed y plane size (AP-R, VPU-W)
* @buf_sz_c_bs : ufo compressed cbcr plane size (AP-R, VPU-W)
* @buf_len_sz_y : size used to store y plane ufo info (AP-R, VPU-W)
* @buf_len_sz_c : size used to store cbcr plane ufo info (AP-R, VPU-W)
* @profile : profile sparsed from vpu (AP-R, VPU-W)
* @show_frame : [BIT(0)] display this frame or not (AP-R, VPU-W)
* [BIT(1)] reset segment data or not (AP-R, VPU-W)
* [BIT(2)] trig decoder hardware or not (AP-R, VPU-W)
* [BIT(3)] ask VPU to set bits(0~4) accordingly (AP-W, VPU-R)
* [BIT(4)] do not reset segment data before every frame (AP-R, VPU-W)
* @show_existing_frame : inform this frame is show existing frame
* (AP-R, VPU-W)
* @frm_to_show_idx : index to show frame (AP-R, VPU-W)
* @refresh_frm_flags : indicate when frame need to refine reference count
* (AP-R, VPU-W)
* @resolution_changed : resolution change in this frame (AP-R, VPU-W)
Annotation
- Immediate include surface: `linux/fs.h`, `linux/slab.h`, `linux/syscalls.h`, `linux/delay.h`, `linux/time.h`, `../../common/mtk_vcodec_intr.h`, `../vdec_drv_base.h`, `../vdec_vpu_if.h`.
- Detected declarations: `struct vp9_dram_buf`, `struct vp9_fb_info`, `struct vp9_ref_cnt_buf`, `struct vp9_ref_buf`, `struct vp9_sf_ref_fb`, `struct vdec_vp9_vsi`, `struct vdec_vp9_inst`, `function vp9_is_sf_ref_fb`, `function list_for_each_entry`, `function vp9_add_to_fb_free_list`.
- 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.