drivers/media/platform/amphion/vpu.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/amphion/vpu.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/amphion/vpu.h- Extension
.h- Size
- 8889 bytes
- Lines
- 373
- 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
media/v4l2-device.hmedia/v4l2-ctrls.hmedia/v4l2-mem2mem.hlinux/mailbox_client.hlinux/mailbox_controller.hlinux/kfifo.h
Detected Declarations
struct vpu_devstruct vpu_resourcesstruct vpu_bufferstruct vpu_funcstruct vpu_devstruct vpu_formatstruct vpu_core_resourcesstruct vpu_mboxstruct vpu_corestruct vpu_frame_infostruct vpu_inststruct vpu_inst_opsstruct vpu_inststruct vpu_vb2_bufferenum imx_plat_typeenum vpu_core_typeenum vpu_core_stateenum vpu_codec_state
Annotated Snippet
struct vpu_resources {
enum imx_plat_type plat_type;
u32 mreg_base;
int (*setup)(struct vpu_dev *vpu);
int (*setup_encoder)(struct vpu_dev *vpu);
int (*setup_decoder)(struct vpu_dev *vpu);
int (*reset)(struct vpu_dev *vpu);
};
struct vpu_buffer {
void *virt;
dma_addr_t phys;
u32 length;
u32 bytesused;
struct device *dev;
};
struct vpu_func {
struct video_device *vfd;
struct v4l2_m2m_dev *m2m_dev;
enum vpu_core_type type;
int function;
};
struct vpu_dev {
void __iomem *base;
struct platform_device *pdev;
struct device *dev;
struct mutex lock; /* protect vpu device */
const struct vpu_resources *res;
struct list_head cores;
struct v4l2_device v4l2_dev;
struct vpu_func encoder;
struct vpu_func decoder;
struct media_device mdev;
struct delayed_work watchdog_work;
void (*get_vpu)(struct vpu_dev *vpu);
void (*put_vpu)(struct vpu_dev *vpu);
void (*get_enc)(struct vpu_dev *vpu);
void (*put_enc)(struct vpu_dev *vpu);
void (*get_dec)(struct vpu_dev *vpu);
void (*put_dec)(struct vpu_dev *vpu);
atomic_t ref_vpu;
atomic_t ref_enc;
atomic_t ref_dec;
struct dentry *debugfs;
};
struct vpu_format {
u32 pixfmt;
u32 mem_planes;
u32 comp_planes;
u32 type;
u32 flags;
u32 width;
u32 height;
u32 sizeimage[VIDEO_MAX_PLANES];
u32 bytesperline[VIDEO_MAX_PLANES];
u32 field;
u32 sibling;
};
struct vpu_core_resources {
enum vpu_core_type type;
const char *fwname;
u32 stride;
u32 max_width;
u32 min_width;
u32 step_width;
u32 max_height;
u32 min_height;
u32 step_height;
u32 rpc_size;
u32 fwlog_size;
u32 act_size;
};
struct vpu_mbox {
char name[20];
struct mbox_client cl;
struct mbox_chan *ch;
bool block;
};
enum vpu_core_state {
VPU_CORE_DEINIT = 0,
VPU_CORE_ACTIVE,
Annotation
- Immediate include surface: `media/v4l2-device.h`, `media/v4l2-ctrls.h`, `media/v4l2-mem2mem.h`, `linux/mailbox_client.h`, `linux/mailbox_controller.h`, `linux/kfifo.h`.
- Detected declarations: `struct vpu_dev`, `struct vpu_resources`, `struct vpu_buffer`, `struct vpu_func`, `struct vpu_dev`, `struct vpu_format`, `struct vpu_core_resources`, `struct vpu_mbox`, `struct vpu_core`, `struct vpu_frame_info`.
- 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.