drivers/media/platform/rockchip/rkvdec/rkvdec.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rkvdec/rkvdec.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rkvdec/rkvdec.h- Extension
.h- Size
- 5309 bytes
- Lines
- 200
- 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.
- 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/platform_device.hlinux/videodev2.hlinux/wait.hlinux/clk.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-ioctl.hmedia/v4l2-mem2mem.hmedia/videobuf2-core.hmedia/videobuf2-dma-contig.h
Detected Declarations
struct rkvdec_ctxstruct rkvdec_rcb_configstruct rkvdec_ctrl_descstruct rkvdec_ctrlsstruct rkvdec_runstruct rkvdec_vp9_decoded_buffer_infostruct rkvdec_decoded_bufferstruct rkvdec_variant_opsstruct rkvdec_variantstruct rkvdec_coded_fmt_opsstruct rkvdec_decoded_fmt_descstruct rkvdec_coded_fmt_descstruct rkvdec_devstruct rkvdec_ctxstruct rkvdec_aux_bufenum rkvdec_image_fmtenum rkvdec_alloc_typefunction vb2_to_rkvdec_decoded_buf
Annotated Snippet
struct rkvdec_ctrl_desc {
struct v4l2_ctrl_config cfg;
};
struct rkvdec_ctrls {
const struct rkvdec_ctrl_desc *ctrls;
unsigned int num_ctrls;
};
struct rkvdec_run {
struct {
struct vb2_v4l2_buffer *src;
struct vb2_v4l2_buffer *dst;
} bufs;
};
struct rkvdec_vp9_decoded_buffer_info {
/* Info needed when the decoded frame serves as a reference frame. */
unsigned short width;
unsigned short height;
unsigned int bit_depth : 4;
};
struct rkvdec_decoded_buffer {
/* Must be the first field in this struct. */
struct v4l2_m2m_buffer base;
union {
struct rkvdec_vp9_decoded_buffer_info vp9;
};
};
static inline struct rkvdec_decoded_buffer *
vb2_to_rkvdec_decoded_buf(struct vb2_buffer *buf)
{
return container_of(buf, struct rkvdec_decoded_buffer,
base.vb.vb2_buf);
}
struct rkvdec_variant_ops {
irqreturn_t (*irq_handler)(struct rkvdec_ctx *ctx);
u32 (*colmv_size)(u16 width, u16 height);
void (*flatten_matrices)(u8 *output, const u8 *input, int matrices, int row_length);
};
struct rkvdec_variant {
unsigned int num_regs;
const struct rkvdec_coded_fmt_desc *coded_fmts;
size_t num_coded_fmts;
const struct rcb_size_info *rcb_sizes;
size_t num_rcb_sizes;
const struct rkvdec_variant_ops *ops;
bool has_single_reg_region;
unsigned int quirks;
};
struct rkvdec_coded_fmt_ops {
int (*adjust_fmt)(struct rkvdec_ctx *ctx,
struct v4l2_format *f);
int (*start)(struct rkvdec_ctx *ctx);
void (*stop)(struct rkvdec_ctx *ctx);
int (*run)(struct rkvdec_ctx *ctx);
void (*done)(struct rkvdec_ctx *ctx, struct vb2_v4l2_buffer *src_buf,
struct vb2_v4l2_buffer *dst_buf,
enum vb2_buffer_state result);
int (*try_ctrl)(struct rkvdec_ctx *ctx, struct v4l2_ctrl *ctrl);
enum rkvdec_image_fmt (*get_image_fmt)(struct rkvdec_ctx *ctx,
struct v4l2_ctrl *ctrl);
};
enum rkvdec_image_fmt {
RKVDEC_IMG_FMT_ANY = 0,
RKVDEC_IMG_FMT_420_8BIT,
RKVDEC_IMG_FMT_420_10BIT,
RKVDEC_IMG_FMT_422_8BIT,
RKVDEC_IMG_FMT_422_10BIT,
};
struct rkvdec_decoded_fmt_desc {
u32 fourcc;
enum rkvdec_image_fmt image_fmt;
};
struct rkvdec_coded_fmt_desc {
u32 fourcc;
struct v4l2_frmsize_stepwise frmsize;
const struct rkvdec_ctrls *ctrls;
const struct rkvdec_coded_fmt_ops *ops;
unsigned int num_decoded_fmts;
const struct rkvdec_decoded_fmt_desc *decoded_fmts;
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/videodev2.h`, `linux/wait.h`, `linux/clk.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`, `media/v4l2-ioctl.h`, `media/v4l2-mem2mem.h`.
- Detected declarations: `struct rkvdec_ctx`, `struct rkvdec_rcb_config`, `struct rkvdec_ctrl_desc`, `struct rkvdec_ctrls`, `struct rkvdec_run`, `struct rkvdec_vp9_decoded_buffer_info`, `struct rkvdec_decoded_buffer`, `struct rkvdec_variant_ops`, `struct rkvdec_variant`, `struct rkvdec_coded_fmt_ops`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- 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.