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.

Dependency Surface

Detected Declarations

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

Implementation Notes