drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h- Extension
.h- Size
- 11217 bytes
- Lines
- 365
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kref.h../common/mtk_vcodec_cmn_drv.h../common/mtk_vcodec_dbgfs.h../common/mtk_vcodec_fw_priv.h../common/mtk_vcodec_util.hvdec_msg_queue.h
Detected Declarations
struct vdec_pic_infostruct mtk_vcodec_dec_pdatastruct mtk_vcodec_dec_requeststruct mtk_vcodec_dec_ctxstruct mtk_vcodec_dec_devenum mtk_vcodec_dec_chip_nameenum mtk_vdec_format_typesenum mtk_vdec_hw_countenum mtk_vdec_hw_archfunction wake_up_dec_ctx
Annotated Snippet
struct vdec_pic_info {
unsigned int pic_w;
unsigned int pic_h;
unsigned int buf_w;
unsigned int buf_h;
unsigned int fb_sz[VIDEO_MAX_PLANES];
unsigned int cap_fourcc;
unsigned int reserved;
};
/**
* struct mtk_vcodec_dec_pdata - compatible data for each IC
* @init_vdec_params: init vdec params
* @ctrls_setup: init vcodec dec ctrls
* @worker: worker to start a decode job
* @flush_decoder: function that flushes the decoder
* @get_cap_buffer: get capture buffer from capture queue
* @cap_to_disp: put capture buffer to disp list for lat and core arch
* @vdec_vb2_ops: struct vb2_ops
*
* @vdec_formats: supported video decoder formats
* @num_formats: count of video decoder formats
* @default_out_fmt: default output buffer format
* @default_cap_fmt: default capture buffer format
*
* @hw_arch: hardware arch is used to separate pure_sin_core and lat_sin_core
*
* @is_subdev_supported: whether support parent-node architecture(subdev)
* @uses_stateless_api: whether the decoder uses the stateless API with requests
*/
struct mtk_vcodec_dec_pdata {
void (*init_vdec_params)(struct mtk_vcodec_dec_ctx *ctx);
int (*ctrls_setup)(struct mtk_vcodec_dec_ctx *ctx);
void (*worker)(struct work_struct *work);
int (*flush_decoder)(struct mtk_vcodec_dec_ctx *ctx);
struct vdec_fb *(*get_cap_buffer)(struct mtk_vcodec_dec_ctx *ctx);
void (*cap_to_disp)(struct mtk_vcodec_dec_ctx *ctx, int error,
struct media_request *src_buf_req);
const struct vb2_ops *vdec_vb2_ops;
const struct mtk_video_fmt *vdec_formats;
const int *num_formats;
const struct mtk_video_fmt *default_out_fmt;
const struct mtk_video_fmt *default_cap_fmt;
enum mtk_vdec_hw_arch hw_arch;
bool is_subdev_supported;
bool uses_stateless_api;
};
/**
* struct mtk_vcodec_dec_request - Media request private data.
* @refcount: Used to ensure we don't complete the request too soon
* @req: Media Request structure
*/
struct mtk_vcodec_dec_request {
struct kref refcount;
struct media_request req;
};
/**
* struct mtk_vcodec_dec_ctx - Context (instance) private data.
*
* @type: type of decoder instance
* @dev: pointer to the mtk_vcodec_dec_dev of the device
* @list: link to ctx_list of mtk_vcodec_dec_dev
*
* @fh: struct v4l2_fh
* @m2m_ctx: pointer to the v4l2_m2m_ctx of the context
* @q_data: store information of input and output queue of the context
* @id: index of the context that this structure describes
* @state: state of the context
*
* @dec_if: hooked decoder driver interface
* @drv_handle: driver handle for specific decode/encode instance
*
* @picinfo: store picture info after header parsing
* @dpb_size: store dpb count after header parsing
*
* @int_cond: variable used by the waitqueue
* @int_type: type of the last interrupt
* @queue: waitqueue that can be used to wait for this context to finish
* @irq_status: irq status
*
* @ctrl_hdl: handler for v4l2 framework
* @decode_work: worker for the decoding
* @last_decoded_picinfo: pic information get from latest decode
* @empty_flush_buf: a fake size-0 capture buffer that indicates flush. Used
Annotation
- Immediate include surface: `linux/kref.h`, `../common/mtk_vcodec_cmn_drv.h`, `../common/mtk_vcodec_dbgfs.h`, `../common/mtk_vcodec_fw_priv.h`, `../common/mtk_vcodec_util.h`, `vdec_msg_queue.h`.
- Detected declarations: `struct vdec_pic_info`, `struct mtk_vcodec_dec_pdata`, `struct mtk_vcodec_dec_request`, `struct mtk_vcodec_dec_ctx`, `struct mtk_vcodec_dec_dev`, `enum mtk_vcodec_dec_chip_name`, `enum mtk_vdec_format_types`, `enum mtk_vdec_hw_count`, `enum mtk_vdec_hw_arch`, `function wake_up_dec_ctx`.
- 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.