|
Sound Open Firmware
|


Go to the source code of this file.
Data Structures | |
| struct | module_param |
| Module TLV parameters container - used for both config types. More... | |
| struct | module_resources |
| module resources block - used for module allocation records The allocations are recorded so that they can be automatically freed when the module unloads. More... | |
| struct | module_resource |
| module memory container - used for every memory allocated by module More... | |
| struct | module_processing_data |
| Processing data shared between particular module & module_adapter. More... | |
Macros | |
| #define | IS_PROCESSING_MODE_AUDIO_STREAM(mod) ((mod)->proc_type == MODULE_PROCESS_TYPE_STREAM) |
| #define | IS_PROCESSING_MODE_RAW_DATA(mod) ((mod)->proc_type == MODULE_PROCESS_TYPE_RAW) |
| #define | IS_PROCESSING_MODE_SINK_SOURCE(mod) ((mod)->proc_type == MODULE_PROCESS_TYPE_SOURCE_SINK) |
| #define | IPC_MOD_CMD(v) |
| #define | SET_MODULE_ADAPTER_TCTX(tr) .tctx = &(tr), |
| #define | DECLARE_MODULE_ADAPTER(adapter, uuid, tr) |
| #define | SOF_MODULE_API_PRIVATE |
Enumerations | |
| enum | module_state { MODULE_DISABLED , MODULE_INITIALIZED , MODULE_IDLE , MODULE_PROCESSING } |
| Module-specific states. More... | |
| enum | mod_resource_type { MOD_RES_UNINITIALIZED = 0 , MOD_RES_HEAP , MOD_RES_BLOB_HANDLER , MOD_RES_FAST_GET } |
Functions | |
| int | module_load_config (struct comp_dev *dev, const void *cfg, size_t size) |
| int | module_init (struct processing_module *mod) |
| void * | mod_balloc_align (struct processing_module *mod, size_t size, size_t alignment) |
| Allocate aligned stream buffer memory for a processing module. | |
| void | mod_resource_init (struct processing_module *mod) |
| Initialize module resource management locks and containers. | |
| void | mod_heap_info (struct processing_module *mod, size_t *size, uintptr_t *start) |
| Query module memory heap boundary and size. | |
| void * | mod_alloc_ext (struct processing_module *mod, uint32_t flags, size_t size, size_t alignment) |
| Allocate memory for a module with explicit flags and alignment. | |
| int | mod_free (struct processing_module *mod, const void *ptr) |
| Free a memory block previously allocated for a module. | |
| void | mod_free_all (struct processing_module *mod) |
| Free all heap resources currently tracked for a module. | |
| static void * | mod_alloc_align (struct processing_module *mod, size_t size, size_t alignment) |
| Allocate aligned memory block for module with user privileges. | |
| static void * | mod_balloc (struct processing_module *mod, size_t size) |
| Allocate stream buffer memory for module with natural alignment. | |
| static void * | mod_alloc (struct processing_module *mod, size_t size) |
| Allocate memory block for module with default natural alignment. | |
| static void * | mod_zalloc (struct processing_module *mod, size_t size) |
| Allocate zero-initialized memory block for module. | |
| static struct ipc_msg * | mod_ipc_msg_w_ext_init (struct processing_module *mod, uint32_t header, uint32_t extension, uint32_t size) |
| Initialize a new IPC message using the module allocator. | |
| static struct ipc_msg * | mod_ipc_msg_init (struct processing_module *mod, uint32_t header, uint32_t size) |
| static void | mod_ipc_msg_free (struct processing_module *mod, struct ipc_msg *msg) |
| Free an IPC message allocated with mod_ipc_msg_init() or mod_ipc_msg_w_ext_init(). | |
| int | module_prepare (struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) |
| static bool | generic_module_is_ready_to_process (struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) |
| static bool | module_is_ready_to_process (struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) |
| int | module_process_sink_src (struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) |
| int | module_process_legacy (struct processing_module *mod, struct input_stream_buffer *input_buffers, int num_input_buffers, struct output_stream_buffer *output_buffers, int num_output_buffers) |
| int | module_reset (struct processing_module *mod) |
| int | module_free (struct processing_module *mod) |
| int | module_set_configuration (struct processing_module *mod, uint32_t config_id, enum module_cfg_fragment_position pos, size_t data_offset_size, const uint8_t *fragment, size_t fragment_size, uint8_t *response, size_t response_size) |
| int | module_bind (struct processing_module *mod, const struct bind_info *bind_data) |
| int | module_unbind (struct processing_module *mod, const struct bind_info *unbind_data) |
| struct comp_dev * | module_adapter_new (const struct comp_driver *drv, const struct comp_ipc_config *config, const void *spec) |
| struct comp_dev * | module_adapter_new_ext (const struct comp_driver *drv, const struct comp_ipc_config *config, const void *spec, void *mod_priv, struct userspace_context *user_ctx, const struct module_interface *ops) |
| int | module_adapter_prepare (struct comp_dev *dev) |
| int | module_adapter_params (struct comp_dev *dev, struct sof_ipc_stream_params *params) |
| int | module_adapter_copy (struct comp_dev *dev) |
| int | module_adapter_cmd (struct comp_dev *dev, int cmd, void *data, int max_data_size) |
| int | module_adapter_trigger (struct comp_dev *dev, int cmd) |
| void | module_adapter_free (struct comp_dev *dev) |
| int | module_adapter_reset (struct comp_dev *dev) |
| size_t | module_adapter_heap_usage (struct processing_module *mod, size_t *hwm) |
| static int | module_adapter_get_attribute (struct comp_dev *dev, uint32_t type, void *value) |
| static int | module_adapter_set_attribute (struct comp_dev *dev, uint32_t type, void *value) |
| static int | module_set_large_config (struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t data_offset, const char *data) |
| static int | module_get_large_config (struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t *data_offset, char *data) |
| static int | module_adapter_bind (struct comp_dev *dev, const struct bind_info *bind_data) |
| static int | module_adapter_unbind (struct comp_dev *dev, const struct bind_info *unbind_data) |
| static uint64_t | module_adapter_get_total_data_processed (struct comp_dev *dev, uint32_t stream_no, bool input) |
| static int | module_process_endpoint (struct processing_module *mod, struct input_stream_buffer *input_buffers, int num_input_buffers, struct output_stream_buffer *output_buffers, int num_output_buffers) |
| int | module_adapter_get_hw_params (struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir) |
| int | module_adapter_position (struct comp_dev *dev, struct sof_ipc_stream_posn *posn) |
| int | module_adapter_ts_config_op (struct comp_dev *dev) |
| int | module_adapter_ts_start_op (struct comp_dev *dev) |
| int | module_adapter_ts_stop_op (struct comp_dev *dev) |
| int | module_adapter_ts_get_op (struct comp_dev *dev, struct timestamp_data *tsd) |
| void | module_update_buffer_position (struct input_stream_buffer *input_buffers, struct output_stream_buffer *output_buffers, uint32_t frames) |
| int | module_ext_init_decode (const struct comp_driver *drv, struct module_ext_init_data *ext_data, struct ipc_config_process *spec) |
| int | module_adapter_init_data (struct comp_dev *dev, struct module_config *dst, const struct comp_ipc_config *config, const void *spec) |
| void | module_adapter_reset_data (struct module_config *dst) |
| void | module_adapter_check_data (struct processing_module *mod, struct comp_dev *dev, struct comp_buffer *sink) |
| void | module_adapter_set_params (struct processing_module *mod, struct sof_ipc_stream_params *params) |
| int | module_adapter_set_state (struct processing_module *mod, struct comp_dev *dev, int cmd) |
| int | module_adapter_sink_src_prepare (struct comp_dev *dev) |
| uint32_t | module_get_deadline (struct processing_module *mod) |
| Get a deadline based on current LFT reported by all sinks it returns a value >= UINT32_MAX / 2 in case the deadline cannot be calculated: | |
| static uint32_t | module_get_lpt (struct processing_module *mod) |
| Get a Longest Processing Time estimation for the module, in us It is either. | |
| #define DECLARE_MODULE_ADAPTER | ( | adapter, | |
| uuid, | |||
| tr | |||
| ) |
| #define IPC_MOD_CMD | ( | v | ) |
| #define IS_PROCESSING_MODE_AUDIO_STREAM | ( | mod | ) | ((mod)->proc_type == MODULE_PROCESS_TYPE_STREAM) |
| #define IS_PROCESSING_MODE_RAW_DATA | ( | mod | ) | ((mod)->proc_type == MODULE_PROCESS_TYPE_RAW) |
| #define IS_PROCESSING_MODE_SINK_SOURCE | ( | mod | ) | ((mod)->proc_type == MODULE_PROCESS_TYPE_SOURCE_SINK) |
| #define SET_MODULE_ADAPTER_TCTX | ( | tr | ) | .tctx = &(tr), |
| #define SOF_MODULE_API_PRIVATE |
| enum mod_resource_type |
| enum module_state |
|
inlinestatic |
|
inlinestatic |
Allocate memory block for module with default natural alignment.
| mod | Pointer to processing module. |
| size | Size in bytes. |
|
inlinestatic |
Allocate aligned memory block for module with user privileges.
| mod | Pointer to processing module. |
| size | Size in bytes. |
| alignment | Alignment in bytes. |
The allocated memory is automatically freed when the module is unloaded.
| void * mod_alloc_ext | ( | struct processing_module * | mod, |
| uint32_t | flags, | ||
| size_t | size, | ||
| size_t | alignment | ||
| ) |
Allocate memory for a module with explicit flags and alignment.
Allocates memory from the module's allocation context (mod_alloc_ctx). Automatically registered in module resources and released on module removal.
| mod | Pointer to processing module. |
| flags | Memory allocation flags (SOF_MEM_FLAG_...). |
| size | Size in bytes to allocate. |
| alignment | Required alignment in bytes. |
|
inlinestatic |
Allocate stream buffer memory for module with natural alignment.
| mod | Pointer to processing module. |
| size | Size in bytes. |
| void * mod_balloc_align | ( | struct processing_module * | mod, |
| size_t | size, | ||
| size_t | alignment | ||
| ) |
Allocate aligned stream buffer memory for a processing module.
Allocates buffer memory via the module's allocation context using SOF_MEM_FLAG_USER and SOF_MEM_FLAG_LARGE_BUFFER. Tracked in module resources and automatically freed on module teardown.
| mod | Pointer to processing module. |
| size | Buffer size in bytes. |
| alignment | Required alignment in bytes. |
| int mod_free | ( | struct processing_module * | mod, |
| const void * | ptr | ||
| ) |
Free a memory block previously allocated for a module.
| mod | Pointer to processing module. |
| ptr | Pointer to memory to free. |
| void mod_free_all | ( | struct processing_module * | mod | ) |
Free all heap resources currently tracked for a module.
| mod | Pointer to processing module. |
| void mod_heap_info | ( | struct processing_module * | mod, |
| size_t * | size, | ||
| uintptr_t * | start | ||
| ) |
Query module memory heap boundary and size.
| mod | Pointer to processing module. |
| size | Pointer to receive heap size in bytes. |
| start | Pointer to receive heap start address. |
|
inlinestatic |
Free an IPC message allocated with mod_ipc_msg_init() or mod_ipc_msg_w_ext_init().
| mod | Module that owns the message. |
| msg | Message to free (may be NULL). |
|
inlinestatic |
|
inlinestatic |
Initialize a new IPC message using the module allocator.
| mod | Module to allocate from |
| header | Message header metadata |
| extension | Message header extension metadata |
| size | Message data size in bytes. |
| void mod_resource_init | ( | struct processing_module * | mod | ) |
Initialize module resource management locks and containers.
| mod | Pointer to processing module. |
|
inlinestatic |
Allocate zero-initialized memory block for module.
| mod | Pointer to processing module. |
| size | Size in bytes. |
|
inlinestatic |
| void module_adapter_check_data | ( | struct processing_module * | mod, |
| struct comp_dev * | dev, | ||
| struct comp_buffer * | sink | ||
| ) |
| int module_adapter_cmd | ( | struct comp_dev * | dev, |
| int | cmd, | ||
| void * | data, | ||
| int | max_data_size | ||
| ) |
| int module_adapter_copy | ( | struct comp_dev * | dev | ) |
| void module_adapter_free | ( | struct comp_dev * | dev | ) |
|
inlinestatic |
| int module_adapter_get_hw_params | ( | struct comp_dev * | dev, |
| struct sof_ipc_stream_params * | params, | ||
| int | dir | ||
| ) |
|
inlinestatic |
| size_t module_adapter_heap_usage | ( | struct processing_module * | mod, |
| size_t * | hwm | ||
| ) |
| int module_adapter_init_data | ( | struct comp_dev * | dev, |
| struct module_config * | dst, | ||
| const struct comp_ipc_config * | config, | ||
| const void * | spec | ||
| ) |
| struct comp_dev * module_adapter_new | ( | const struct comp_driver * | drv, |
| const struct comp_ipc_config * | config, | ||
| const void * | spec | ||
| ) |
| struct comp_dev * module_adapter_new_ext | ( | const struct comp_driver * | drv, |
| const struct comp_ipc_config * | config, | ||
| const void * | spec, | ||
| void * | mod_priv, | ||
| struct userspace_context * | user_ctx, | ||
| const struct module_interface * | ops | ||
| ) |
| int module_adapter_params | ( | struct comp_dev * | dev, |
| struct sof_ipc_stream_params * | params | ||
| ) |
| int module_adapter_position | ( | struct comp_dev * | dev, |
| struct sof_ipc_stream_posn * | posn | ||
| ) |
| int module_adapter_prepare | ( | struct comp_dev * | dev | ) |
| int module_adapter_reset | ( | struct comp_dev * | dev | ) |
| void module_adapter_reset_data | ( | struct module_config * | dst | ) |
|
inlinestatic |
| void module_adapter_set_params | ( | struct processing_module * | mod, |
| struct sof_ipc_stream_params * | params | ||
| ) |
| int module_adapter_set_state | ( | struct processing_module * | mod, |
| struct comp_dev * | dev, | ||
| int | cmd | ||
| ) |
| int module_adapter_sink_src_prepare | ( | struct comp_dev * | dev | ) |
| int module_adapter_trigger | ( | struct comp_dev * | dev, |
| int | cmd | ||
| ) |
| int module_adapter_ts_config_op | ( | struct comp_dev * | dev | ) |
| int module_adapter_ts_get_op | ( | struct comp_dev * | dev, |
| struct timestamp_data * | tsd | ||
| ) |
| int module_adapter_ts_start_op | ( | struct comp_dev * | dev | ) |
| int module_adapter_ts_stop_op | ( | struct comp_dev * | dev | ) |
|
inlinestatic |
| int module_bind | ( | struct processing_module * | mod, |
| const struct bind_info * | bind_data | ||
| ) |
| int module_ext_init_decode | ( | const struct comp_driver * | drv, |
| struct module_ext_init_data * | ext_data, | ||
| struct ipc_config_process * | spec | ||
| ) |
| int module_free | ( | struct processing_module * | mod | ) |
| uint32_t module_get_deadline | ( | struct processing_module * | mod | ) |
Get a deadline based on current LFT reported by all sinks it returns a value >= UINT32_MAX / 2 in case the deadline cannot be calculated:
|
inlinestatic |
|
inlinestatic |
Get a Longest Processing Time estimation for the module, in us It is either.
| int module_init | ( | struct processing_module * | mod | ) |
|
inlinestatic |
| int module_load_config | ( | struct comp_dev * | dev, |
| const void * | cfg, | ||
| size_t | size | ||
| ) |
| int module_prepare | ( | struct processing_module * | mod, |
| struct sof_source ** | sources, | ||
| int | num_of_sources, | ||
| struct sof_sink ** | sinks, | ||
| int | num_of_sinks | ||
| ) |
|
inlinestatic |
| int module_process_legacy | ( | struct processing_module * | mod, |
| struct input_stream_buffer * | input_buffers, | ||
| int | num_input_buffers, | ||
| struct output_stream_buffer * | output_buffers, | ||
| int | num_output_buffers | ||
| ) |
| int module_process_sink_src | ( | struct processing_module * | mod, |
| struct sof_source ** | sources, | ||
| int | num_of_sources, | ||
| struct sof_sink ** | sinks, | ||
| int | num_of_sinks | ||
| ) |
| int module_reset | ( | struct processing_module * | mod | ) |
| int module_set_configuration | ( | struct processing_module * | mod, |
| uint32_t | config_id, | ||
| enum module_cfg_fragment_position | pos, | ||
| size_t | data_offset_size, | ||
| const uint8_t * | fragment, | ||
| size_t | fragment_size, | ||
| uint8_t * | response, | ||
| size_t | response_size | ||
| ) |
|
inlinestatic |
| int module_unbind | ( | struct processing_module * | mod, |
| const struct bind_info * | unbind_data | ||
| ) |
| void module_update_buffer_position | ( | struct input_stream_buffer * | input_buffers, |
| struct output_stream_buffer * | output_buffers, | ||
| uint32_t | frames | ||
| ) |