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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
media/videobuf2-core.hvpu_codec.h
Detected Declarations
struct vpu_rpc_buffer_descstruct vpu_shared_addrstruct vpu_rpc_event_headerstruct vpu_rpc_eventstruct vpu_iface_opsstruct vpu_rpc_region_tfunction vpu_iface_check_codecfunction vpu_iface_check_formatfunction vpu_iface_boot_corefunction vpu_iface_get_power_statefunction vpu_iface_shutdown_corefunction vpu_iface_restore_corefunction vpu_iface_on_firmware_loadedfunction vpu_iface_get_data_sizefunction vpu_iface_initfunction vpu_iface_set_log_buffunction vpu_iface_config_systemfunction vpu_iface_get_stream_buffer_sizefunction vpu_iface_config_streamfunction vpu_iface_send_cmdfunction vpu_iface_receive_msgfunction vpu_iface_pack_cmdfunction vpu_iface_convert_msg_idfunction vpu_iface_unpack_msg_datafunction vpu_iface_input_framefunction vpu_iface_config_memory_resourcefunction vpu_iface_config_stream_bufferfunction vpu_iface_update_stream_bufferfunction vpu_iface_get_stream_buffer_descfunction vpu_iface_get_versionfunction vpu_iface_get_max_instance_countfunction vpu_iface_set_encode_paramsfunction vpu_iface_set_decode_paramsfunction vpu_iface_add_scodefunction vpu_iface_pre_send_cmdfunction vpu_iface_post_send_cmdfunction vpu_iface_init_instance
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
- Immediate include surface: `media/videobuf2-core.h`, `vpu_codec.h`.
- Detected declarations: `struct vpu_rpc_buffer_desc`, `struct vpu_shared_addr`, `struct vpu_rpc_event_header`, `struct vpu_rpc_event`, `struct vpu_iface_ops`, `struct vpu_rpc_region_t`, `function vpu_iface_check_codec`, `function vpu_iface_check_format`, `function vpu_iface_boot_core`, `function vpu_iface_get_power_state`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.