drivers/staging/media/meson/vdec/vdec.h
Source file repositories/reference/linux-study-clean/drivers/staging/media/meson/vdec/vdec.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/meson/vdec/vdec.h- Extension
.h- Size
- 8864 bytes
- Lines
- 293
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/irqreturn.hlinux/regmap.hlinux/list.hmedia/videobuf2-v4l2.hmedia/v4l2-ctrls.hmedia/v4l2-device.hlinux/soc/amlogic/meson-canvas.hvdec_platform.h
Detected Declarations
struct amvdec_bufferstruct amvdec_timestampstruct amvdec_sessionstruct amvdec_corestruct amvdec_opsstruct amvdec_codec_opsstruct amvdec_formatstruct amvdec_sessionenum amvdec_status
Annotated Snippet
struct amvdec_buffer {
struct list_head list;
struct vb2_buffer *vb;
};
/**
* struct amvdec_timestamp - stores a src timestamp along with a VIFIFO offset
*
* @list: used to make lists out of this struct
* @tc: timecode from the v4l2 buffer
* @ts: timestamp from the VB2 buffer
* @offset: offset in the VIFIFO where the associated packet was written
* @flags: flags from the v4l2 buffer
* @used_count: times this timestamp was checked for a match with a dst buffer
*/
struct amvdec_timestamp {
struct list_head list;
struct v4l2_timecode tc;
u64 ts;
u32 offset;
u32 flags;
u32 used_count;
};
struct amvdec_session;
/**
* struct amvdec_core - device parameters, singleton
*
* @dos_base: DOS memory base address
* @esparser_base: PARSER memory base address
* @regmap_ao: regmap for the AO bus
* @dev: core device
* @dev_dec: decoder device
* @platform: platform-specific data
* @canvas: canvas provider reference
* @dos_parser_clk: DOS_PARSER clock
* @dos_clk: DOS clock
* @vdec_1_clk: VDEC_1 clock
* @vdec_hevc_clk: VDEC_HEVC clock
* @vdec_hevcf_clk: VDEC_HEVCF clock
* @esparser_reset: RESET for the PARSER
* @vdev_dec: video device for the decoder
* @v4l2_dev: v4l2 device
* @cur_sess: current decoding session
* @lock: video device lock
*/
struct amvdec_core {
void __iomem *dos_base;
void __iomem *esparser_base;
struct regmap *regmap_ao;
struct device *dev;
struct device *dev_dec;
const struct vdec_platform *platform;
struct meson_canvas *canvas;
struct clk *dos_parser_clk;
struct clk *dos_clk;
struct clk *vdec_1_clk;
struct clk *vdec_hevc_clk;
struct clk *vdec_hevcf_clk;
struct reset_control *esparser_reset;
struct video_device *vdev_dec;
struct v4l2_device v4l2_dev;
struct amvdec_session *cur_sess;
struct mutex lock;
};
/**
* struct amvdec_ops - vdec operations
*
* @start: mandatory call when the vdec needs to initialize
* @stop: mandatory call when the vdec needs to stop
* @conf_esparser: mandatory call to let the vdec configure the ESPARSER
* @vififo_level: mandatory call to get the current amount of data
* in the VIFIFO
*/
struct amvdec_ops {
int (*start)(struct amvdec_session *sess);
int (*stop)(struct amvdec_session *sess);
void (*conf_esparser)(struct amvdec_session *sess);
u32 (*vififo_level)(struct amvdec_session *sess);
};
/**
Annotation
- Immediate include surface: `linux/irqreturn.h`, `linux/regmap.h`, `linux/list.h`, `media/videobuf2-v4l2.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`, `linux/soc/amlogic/meson-canvas.h`, `vdec_platform.h`.
- Detected declarations: `struct amvdec_buffer`, `struct amvdec_timestamp`, `struct amvdec_session`, `struct amvdec_core`, `struct amvdec_ops`, `struct amvdec_codec_ops`, `struct amvdec_format`, `struct amvdec_session`, `enum amvdec_status`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.