drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c- Extension
.c- Size
- 11738 bytes
- Lines
- 437
- 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/slab.hmedia/v4l2-mem2mem.hmedia/videobuf2-dma-contig.huapi/linux/v4l2-controls.h../mtk_vcodec_dec.h../../common/mtk_vcodec_intr.h../vdec_drv_base.h../vdec_drv_if.h../vdec_vpu_if.h
Detected Declarations
struct vdec_vp8_slice_infostruct vdec_vp8_slice_dpb_infostruct vdec_vp8_slice_vsistruct vdec_vp8_slice_instfunction vdec_vp8_slice_get_pic_infofunction vdec_vp8_slice_alloc_working_buffunction vdec_vp8_slice_free_working_buffunction vdec_vp8_slice_get_ref_by_tsfunction vdec_vp8_slice_get_decode_parametersfunction vdec_vp8_slice_initfunction vdec_vp8_slice_decodefunction vdec_vp8_slice_get_paramfunction vdec_vp8_slice_deinit
Annotated Snippet
struct vdec_vp8_slice_info {
u64 vld_wrapper_dma;
u64 seg_id_buf_dma;
u64 wrap_y_dma;
u64 wrap_c_dma;
u64 cur_y_fb_dma;
u64 cur_c_fb_dma;
u64 bs_dma;
u32 bs_sz;
u32 resolution_changed;
u32 frame_header_type;
u32 crc[8];
u32 reserved;
};
/**
* struct vdec_vp8_slice_dpb_info - vp8 reference information
*
* @y_dma_addr: Y bitstream physical address
* @c_dma_addr: CbCr bitstream physical address
* @reference_flag: reference picture flag
* @reserved: 64bit align
*/
struct vdec_vp8_slice_dpb_info {
dma_addr_t y_dma_addr;
dma_addr_t c_dma_addr;
int reference_flag;
int reserved;
};
/**
* struct vdec_vp8_slice_vsi - VPU shared information
*
* @dec: decoding information
* @pic: picture information
* @vp8_dpb_info: reference buffer information
*/
struct vdec_vp8_slice_vsi {
struct vdec_vp8_slice_info dec;
struct vdec_pic_info pic;
struct vdec_vp8_slice_dpb_info vp8_dpb_info[3];
};
/**
* struct vdec_vp8_slice_inst - VP8 decoder instance
*
* @seg_id_buf: seg buffer
* @wrap_y_buf: wrapper y buffer
* @wrap_c_buf: wrapper c buffer
* @vld_wrapper_buf: vld wrapper buffer
* @ctx: V4L2 context
* @vpu: VPU instance for decoder
* @vsi: VPU share information
*/
struct vdec_vp8_slice_inst {
struct mtk_vcodec_mem seg_id_buf;
struct mtk_vcodec_mem wrap_y_buf;
struct mtk_vcodec_mem wrap_c_buf;
struct mtk_vcodec_mem vld_wrapper_buf;
struct mtk_vcodec_dec_ctx *ctx;
struct vdec_vpu_inst vpu;
struct vdec_vp8_slice_vsi *vsi;
};
static void *vdec_vp8_slice_get_ctrl_ptr(struct mtk_vcodec_dec_ctx *ctx, int id)
{
struct v4l2_ctrl *ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl, id);
if (!ctrl)
return ERR_PTR(-EINVAL);
return ctrl->p_cur.p;
}
static void vdec_vp8_slice_get_pic_info(struct vdec_vp8_slice_inst *inst)
{
struct mtk_vcodec_dec_ctx *ctx = inst->ctx;
unsigned int data[3];
data[0] = ctx->picinfo.pic_w;
data[1] = ctx->picinfo.pic_h;
data[2] = ctx->capture_fourcc;
vpu_dec_get_param(&inst->vpu, data, 3, GET_PARAM_PIC_INFO);
ctx->picinfo.buf_w = ALIGN(ctx->picinfo.pic_w, 64);
ctx->picinfo.buf_h = ALIGN(ctx->picinfo.pic_h, 64);
ctx->picinfo.fb_sz[0] = inst->vpu.fb_sz[0];
ctx->picinfo.fb_sz[1] = inst->vpu.fb_sz[1];
inst->vsi->pic.pic_w = ctx->picinfo.pic_w;
Annotation
- Immediate include surface: `linux/slab.h`, `media/v4l2-mem2mem.h`, `media/videobuf2-dma-contig.h`, `uapi/linux/v4l2-controls.h`, `../mtk_vcodec_dec.h`, `../../common/mtk_vcodec_intr.h`, `../vdec_drv_base.h`, `../vdec_drv_if.h`.
- Detected declarations: `struct vdec_vp8_slice_info`, `struct vdec_vp8_slice_dpb_info`, `struct vdec_vp8_slice_vsi`, `struct vdec_vp8_slice_inst`, `function vdec_vp8_slice_get_pic_info`, `function vdec_vp8_slice_alloc_working_buf`, `function vdec_vp8_slice_free_working_buf`, `function vdec_vp8_slice_get_ref_by_ts`, `function vdec_vp8_slice_get_decode_parameters`, `function vdec_vp8_slice_init`.
- 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.