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.

Dependency Surface

Detected Declarations

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

Implementation Notes