|
Sound Open Firmware
|


Go to the source code of this file.
Functions | |
| void * | comp_get_data_blob (struct comp_data_blob_handler *blob_handler, size_t *size, uint32_t *crc) |
| Returns data blob. | |
| bool | comp_is_new_data_blob_available (struct comp_data_blob_handler *blob_handler) |
| Checks whether new data blob is available. | |
| bool | comp_is_current_data_blob_valid (struct comp_data_blob_handler *blob_handler) |
| Checks whether there is a valid data blob is available. | |
| int | comp_init_data_blob (struct comp_data_blob_handler *blob_handler, uint32_t size, const void *init_data) |
| Initializes data blob with given value. | |
| int | comp_data_blob_set_cmd (struct comp_data_blob_handler *blob_handler, struct sof_ipc_ctrl_data *cdata) |
| Handles IPC set command. | |
| int | comp_data_blob_set (struct comp_data_blob_handler *blob_handler, enum module_cfg_fragment_position pos, uint32_t data_offset_size, const uint8_t *fragment, size_t fragment_size) |
| Handles IPC set command. | |
| int | ipc4_comp_data_blob_set (struct comp_data_blob_handler *blob_handler, bool first_block, bool last_block, uint32_t data_offset, const char *data) |
| Handles IPC4 set large config. | |
| int | comp_data_blob_get_cmd (struct comp_data_blob_handler *blob_handler, struct sof_ipc_ctrl_data *cdata, int size) |
| Handles IPC get command. | |
| struct comp_data_blob_handler * | comp_data_blob_handler_new_ext (struct comp_dev *dev, bool single_blob, void *(*alloc)(size_t size), void(*free)(void *buf)) |
| Returns new data blob handler. | |
| static struct comp_data_blob_handler * | comp_data_blob_handler_new (struct comp_dev *dev) |
| Returns new data blob handler. | |
| void | comp_data_blob_handler_free (struct comp_data_blob_handler *blob_handler) |
| Free data blob handler. | |
| void | comp_data_blob_set_validator (struct comp_data_blob_handler *blob_handler, int(*validator)(struct comp_dev *dev, void *new_data, uint32_t new_data_size)) |
| Add a validator to check that the new data blob is valid for the given component. | |
| int comp_data_blob_get_cmd | ( | struct comp_data_blob_handler * | blob_handler, |
| struct sof_ipc_ctrl_data * | cdata, | ||
| int | size ) |
Handles IPC get command.
| blob_handler | Data blob handler |
| cdata | IPC ctrl data |
| size | Required size |
| void comp_data_blob_handler_free | ( | struct comp_data_blob_handler * | blob_handler | ) |
Free data blob handler.
| blob_handler | Data blob handler |
|
inlinestatic |
Returns new data blob handler.
This is a simplified version of comp_data_blob_handler_new_ext() using default memory allocator and double blob mode for on the fly updates.
| dev | Component device |
| struct comp_data_blob_handler * comp_data_blob_handler_new_ext | ( | struct comp_dev * | dev, |
| bool | single_blob, | ||
| void *(* | alloc )(size_t size), | ||
| void(* | free )(void *buf) ) |
Returns new data blob handler.
Data blob handler has two modes of operation, single_blob == false stands for double blob mode that allow seamless configuration updates on the fly. In single_blob == true mode there is at most one blob allocated at one time and configuration update is not allowed if the component is active. The single blob mode should be used with components with very big configuration blobs to save DSP memory.
| dev | Component device |
| single_blob | Set true for single configuration blob operation |
| alloc | Optional blob memory allocator function pointer |
| free | Optional blob memory free function pointer |
| int comp_data_blob_set | ( | struct comp_data_blob_handler * | blob_handler, |
| enum module_cfg_fragment_position | pos, | ||
| uint32_t | data_offset_size, | ||
| const uint8_t * | fragment, | ||
| size_t | fragment_size ) |
Handles IPC set command.
| blob_handler | Data blob handler |
| pos | position: of the data fragment |
| data_offset_size | offset of the fragment in the whole data |
| fragment | pointer to the fragment data |
| fragment_size | size of the fragment data |
| int comp_data_blob_set_cmd | ( | struct comp_data_blob_handler * | blob_handler, |
| struct sof_ipc_ctrl_data * | cdata ) |
Handles IPC set command.
| blob_handler | Data blob handler |
| cdata | IPC ctrl data |
| void comp_data_blob_set_validator | ( | struct comp_data_blob_handler * | blob_handler, |
| int(* | validator )(struct comp_dev *dev, void *new_data, uint32_t new_data_size) ) |
Add a validator to check that the new data blob is valid for the given component.
If the given validator is null (the default value), then any data blob will be considered valid.
| blob_handler | Data blob handler |
| validator | Function used to validate the new data blob |
| void * comp_get_data_blob | ( | struct comp_data_blob_handler * | blob_handler, |
| size_t * | size, | ||
| uint32_t * | crc ) |
Returns data blob.
In case when new data blob is available it returns new one. Function returns also data blob size in case when size pointer is given.
| blob_handler | Data blob handler |
| size | Pointer to data blob size variable |
| crc | Pointer to data blolb crc value |
| int comp_init_data_blob | ( | struct comp_data_blob_handler * | blob_handler, |
| uint32_t | size, | ||
| const void * | init_data ) |
Initializes data blob with given value.
If init_data is not specified, function will zero data blob.
| blob_handler | Data blob handler |
| size | Data blob size |
| init_data | Initial data blob values |
| bool comp_is_current_data_blob_valid | ( | struct comp_data_blob_handler * | blob_handler | ) |
Checks whether there is a valid data blob is available.
| blob_handler | Data blob handler |
| bool comp_is_new_data_blob_available | ( | struct comp_data_blob_handler * | blob_handler | ) |
Checks whether new data blob is available.
Function allows to check (even during streaming - in copy() function) whether new config is available and if it is, component can perform reconfiguration.
| blob_handler | Data blob handler |
| int ipc4_comp_data_blob_set | ( | struct comp_data_blob_handler * | blob_handler, |
| bool | first_block, | ||
| bool | last_block, | ||
| uint32_t | data_offset, | ||
| const char * | data ) |
Handles IPC4 set large config.
| blob_handler | Data blob handler |
| first_block | Flag indicates it is a first block of data |
| last_block | Flag indicates it is a last block of data |
| data_offset | Size/offset of the data being sent |
| data | Pointer to the data array |