Skip to content

Commit

Permalink
module_adapter: Remove BASE_CONFIG_EXT attribute
Browse files Browse the repository at this point in the history
There was only ever one consumer for this attribute, and it didn't
actually work.  Just remove it, the ipc4 connection code is now using
values directly out of module config.

The BASE_CONFIG attribute does have a few components that are
implementing their own version, so it can't be immediately removed.

Signed-off-by: Andy Ross <[email protected]>
  • Loading branch information
andyross committed Jan 3, 2024
1 parent 4988bb3 commit 37f784f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 44 deletions.
16 changes: 0 additions & 16 deletions src/audio/module_adapter/module_adapter_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,22 +167,6 @@ int module_adapter_get_attribute(struct comp_dev *dev, uint32_t type, void *valu
memcpy_s(value, sizeof(struct ipc4_base_module_cfg),
&mod->priv.cfg.base_cfg, sizeof(mod->priv.cfg.base_cfg));
break;
case COMP_ATTR_BASE_CONFIG_EXT:
{
struct ipc4_base_module_cfg_ext *basecfg_ext = mod->priv.cfg.basecfg_ext;
size_t size;

if (!basecfg_ext) {
comp_err(mod->dev, "No base config extn set for module");
return -EINVAL;
}

size = basecfg_ext->nb_input_pins * sizeof(struct ipc4_input_pin_format) +
basecfg_ext->nb_output_pins * sizeof(struct ipc4_output_pin_format);
memcpy_s(value, sizeof(*basecfg_ext) + size,
basecfg_ext, sizeof(*basecfg_ext) + size);
break;
}
default:
return -EINVAL;
}
Expand Down
2 changes: 0 additions & 2 deletions src/include/module/module/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ struct module_config {
uint8_t nb_output_pins;
struct ipc4_input_pin_format *input_pins;
struct ipc4_output_pin_format *output_pins;
struct ipc4_base_module_cfg_ext *basecfg_ext; /* legacy API */

#endif
};

Expand Down
1 change: 0 additions & 1 deletion src/include/sof/audio/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ enum {
#define COMP_ATTR_COPY_DIR 2 /**< Comp copy direction */
#define COMP_ATTR_VDMA_INDEX 3 /**< Comp index of the virtual DMA at the gateway. */
#define COMP_ATTR_BASE_CONFIG 4 /**< Component base config */
#define COMP_ATTR_BASE_CONFIG_EXT 5 /**< Component base config extension */
/** @}*/

/** \name Trace macros
Expand Down
15 changes: 1 addition & 14 deletions src/include/sof/audio/component_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ static inline int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t
payload.type = type;

/*
* Only COMP_ATTR_BASE_CONFIG and COMP_ATTR_BASE_CONFIG_EXT are supported for
* remote access
* Only COMP_ATTR_BASE_CONFIG is supported for remote access
*/
switch (type) {
case COMP_ATTR_BASE_CONFIG:
Expand All @@ -242,14 +241,6 @@ static inline int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t

payload.value = base_cfg;
break;
case COMP_ATTR_BASE_CONFIG_EXT:
basecfg_ext = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
sizeof(*basecfg_ext) + size);
if (!basecfg_ext)
return -ENOMEM;

payload.value = basecfg_ext;
break;
default:
return -EINVAL;
}
Expand All @@ -263,10 +254,6 @@ static inline int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t
base_cfg, sizeof(struct ipc4_base_module_cfg));
rfree(base_cfg);
break;
case COMP_ATTR_BASE_CONFIG_EXT:
memcpy_s(value, size, basecfg_ext, size);
rfree(basecfg_ext);
break;
}
}

Expand Down
11 changes: 0 additions & 11 deletions src/samples/audio/smart_amp_test_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ static int smart_amp_init(struct processing_module *mod)
*(struct ipc4_output_pin_format *)(base_cfg->base_cfg_ext.pin_formats
+ sizeof(sad->ipc4_cfg.input_pins));

/* save the base config extension */
size = sizeof(struct ipc4_base_module_cfg_ext) + in_size + out_size;
mod_data->cfg.basecfg_ext = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, size);
if (!mod_data->cfg.basecfg_ext) {
ret = -ENOMEM;
goto sad_fail;
}

memcpy_s(mod_data->cfg.basecfg_ext, size, &base_cfg->base_cfg_ext, size);

return 0;

sad_fail:
Expand Down Expand Up @@ -172,7 +162,6 @@ static int smart_amp_free(struct processing_module *mod)
struct module_data *mod_data = &mod->priv;
struct comp_dev *dev = mod->dev;

rfree(mod_data->cfg.basecfg_ext);
rfree(sad);
#endif

Expand Down

0 comments on commit 37f784f

Please sign in to comment.