drivers/media/platform/amphion/vpu_rpc.h

Source file repositories/reference/linux-study-clean/drivers/media/platform/amphion/vpu_rpc.h

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/amphion/vpu_rpc.h
Extension
.h
Size
12130 bytes
Lines
467
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_rpc_buffer_desc {
	u32 wptr;
	u32 rptr;
	u32 start;
	u32 end;
};

struct vpu_shared_addr {
	void *iface;
	struct vpu_rpc_buffer_desc *cmd_desc;
	void *cmd_mem_vir;
	struct vpu_rpc_buffer_desc *msg_desc;
	void *msg_mem_vir;

	unsigned long boot_addr;
	struct vpu_core *core;
	void *priv;
};

struct vpu_rpc_event_header {
	u32 index;
	u32 id;
	u32 num;
};

struct vpu_rpc_event {
	struct vpu_rpc_event_header hdr;
	u32 data[128];
};

struct vpu_iface_ops {
	bool (*check_codec)(enum vpu_core_type type);
	bool (*check_fmt)(enum vpu_core_type type, u32 pixelfmt);
	u32 (*get_data_size)(void);
	int (*check_memory_region)(dma_addr_t base, dma_addr_t addr, u32 size);
	int (*boot_core)(struct vpu_core *core);
	int (*shutdown_core)(struct vpu_core *core);
	int (*restore_core)(struct vpu_core *core);
	int (*get_power_state)(struct vpu_core *core);
	int (*on_firmware_loaded)(struct vpu_core *core);
	void (*init_rpc)(struct vpu_shared_addr *shared,
			 struct vpu_buffer *rpc, dma_addr_t boot_addr);
	void (*set_log_buf)(struct vpu_shared_addr *shared,
			    struct vpu_buffer *log);
	void (*set_system_cfg)(struct vpu_shared_addr *shared,
			       u32 regs_base, void __iomem *regs, u32 index);
	void (*set_stream_cfg)(struct vpu_shared_addr *shared, u32 index);
	u32 (*get_version)(struct vpu_shared_addr *shared);
	u32 (*get_max_instance_count)(struct vpu_shared_addr *shared);
	int (*get_stream_buffer_size)(struct vpu_shared_addr *shared);
	int (*send_cmd_buf)(struct vpu_shared_addr *shared,
			    struct vpu_rpc_event *cmd);
	int (*receive_msg_buf)(struct vpu_shared_addr *shared,
			       struct vpu_rpc_event *msg);
	int (*pack_cmd)(struct vpu_rpc_event *pkt, u32 index, u32 id, void *data);
	int (*convert_msg_id)(u32 msg_id);
	int (*unpack_msg_data)(struct vpu_rpc_event *pkt, void *data);
	int (*input_frame)(struct vpu_shared_addr *shared,
			   struct vpu_inst *inst, struct vb2_buffer *vb);
	int (*config_memory_resource)(struct vpu_shared_addr *shared,
				      u32 instance,
				      u32 type,
				      u32 index,
				      struct vpu_buffer *buf);
	int (*config_stream_buffer)(struct vpu_shared_addr *shared,
				    u32 instance,
				    struct vpu_buffer *buf);
	int (*update_stream_buffer)(struct vpu_shared_addr *shared,
				    u32 instance, u32 ptr, bool write);
	int (*get_stream_buffer_desc)(struct vpu_shared_addr *shared,
				      u32 instance,
				      struct vpu_rpc_buffer_desc *desc);
	int (*set_encode_params)(struct vpu_shared_addr *shared,
				 u32 instance,
				 struct vpu_encode_params *params,
				 u32 update);
	int (*set_decode_params)(struct vpu_shared_addr *shared,
				 u32 instance,
				 struct vpu_decode_params *params,
				 u32 update);
	int (*add_scode)(struct vpu_shared_addr *shared,
			 u32 instance,
			 struct vpu_buffer *stream_buffer,
			 u32 pixelformat,
			 u32 scode_type);
	int (*pre_send_cmd)(struct vpu_shared_addr *shared, u32 instance);
	int (*post_send_cmd)(struct vpu_shared_addr *shared, u32 instance);
	int (*init_instance)(struct vpu_shared_addr *shared, u32 instance);
};

Annotation

Implementation Notes