Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 150
ASoC: SOF: ipc4: Fetch CPC from tplg mod_cfg or from manifest#4262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
367c54e290399269ec53d3e8e8c68f3b2d33d59f1989d16abc7e53556c4fc21File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -112,16 +112,13 @@ static ssize_t sof_ipc4_fw_parse_ext_man(struct snd_sof_dev *sdev, | ||
| return -EINVAL; | ||
| } | ||
| /* a module's config is always the same size */ | ||
| fw_module->bss_size = fm_config[fm_entry->cfg_offset].is_bytes; | ||
| fw_module->fw_mod_cfg = &fm_config[fm_entry->cfg_offset]; | ||
| dev_dbg(sdev->dev, | ||
| "module %s: UUID %pUL cfg_count: %u, bss_size: %#x\n", | ||
| fm_entry->name, &fm_entry->uuid, fm_entry->cfg_count, | ||
| fw_module->bss_size); | ||
| fm_config[fm_entry->cfg_offset].is_bytes); | ||
| } else { | ||
| fw_module->bss_size = 0; | ||
| dev_dbg(sdev->dev, "module %s: UUID %pUL\n", fm_entry->name, | ||
| &fm_entry->uuid); | ||
| } | ||
| @@ -426,6 +423,58 @@ int sof_ipc4_reload_fw_libraries(struct snd_sof_dev *sdev) | ||
| return ret; | ||
| } | ||
| /** | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where are we doing the "use the ibs*obs/1000 formula" in this patch? | ||
| * sof_ipc4_update_cpc_from_manifest - Update the cpc in base config from manifest | ||
| * @sdev: SOF device | ||
| * @fw_module: pointer struct sof_ipc4_fw_module to parse | ||
| * @basecfg: Pointer to the base_config to update | ||
| * @exact_match: Only consider exact matches based on obs/ibs | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stale line about the removed CPC fallback calculation, needs to be removed. | ||
| */ | ||
| void sof_ipc4_update_cpc_from_manifest(struct snd_sof_dev *sdev, | ||
| struct sof_ipc4_fw_module *fw_module, | ||
| struct sof_ipc4_base_module_cfg *basecfg, | ||
| bool exact_match) | ||
| { | ||
| const struct sof_man4_module_config *fw_mod_cfg; | ||
| u32 cpc_pick = 0; | ||
| u32 max_cpc = 0; | ||
| int i; | ||
| /* The CPC is set from topology, ignoring manifest */ | ||
| if (basecfg->cpc) | ||
| return; | ||
| if (!fw_module || !fw_module->fw_mod_cfg) | ||
| return; | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happens in this case? Why don't we use the ibs*obs/1000 in this case? CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the new version we are going to use that at the end. | ||
| fw_mod_cfg = fw_module->fw_mod_cfg; | ||
| for (i = 0; i < fw_module->man4_module_entry.cfg_count; i++) { | ||
| if (basecfg->obs == fw_mod_cfg[i].obs && | ||
| basecfg->ibs == fw_mod_cfg[i].ibs && | ||
| cpc_pick < fw_mod_cfg[i].cpc) | ||
| cpc_pick = fw_mod_cfg[i].cpc; | ||
| if (max_cpc < fw_mod_cfg[i].cpc) | ||
| max_cpc = fw_mod_cfg[i].cpc; | ||
| } | ||
| if (!cpc_pick) { | ||
| if (exact_match) | ||
| return; | ||
| dev_dbg(sdev->dev, | ||
| "%s: No exact CPC match from manifest (ibs/obs: %u/%u)\n", | ||
| fw_module->man4_module_entry.name, basecfg->ibs, basecfg->obs); | ||
| cpc_pick = max_cpc; | ||
| } | ||
| dev_dbg(sdev->dev, "%s: CPC from manifest: %u\n", | ||
| fw_module->man4_module_entry.name, cpc_pick); | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stale line about the removed CPC fallback calculation, needs to be removed. | ||
| basecfg->cpc = cpc_pick; | ||
| } | ||
| const struct sof_ipc_fw_loader_ops ipc4_loader_ops = { | ||
| .validate = sof_ipc4_validate_firmware, | ||
| .parse_ext_manifest = sof_ipc4_fw_parse_basefw_ext_man, | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -465,9 +465,9 @@ static int sof_ipc4_pcm_dai_link_fixup_rate(struct snd_sof_dev *sdev, | ||
| struct snd_pcm_hw_params *params, | ||
| struct sof_ipc4_copier *ipc4_copier) | ||
| { | ||
| struct sof_ipc4_pin_format *pin_fmts = ipc4_copier->available_fmt.input_pin_fmts; | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo in commit "renmae" | ||
| struct sof_ipc4_pin_format *pin_fmts = ipc4_copier->module_params.input_pin_fmts; | ||
| struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); | ||
| int num_input_formats = ipc4_copier->available_fmt.num_input_formats; | ||
| int num_input_formats = ipc4_copier->module_params.num_input_formats; | ||
| unsigned int fe_rate = params_rate(params); | ||
| bool fe_be_rate_match = false; | ||
| bool single_be_rate = true; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -28,14 +28,14 @@ enum sof_ipc4_mtrace_type { | ||
| /** | ||
| * struct sof_ipc4_fw_module - IPC4 module info | ||
| * @sof_man4_module: Module info | ||
| * @fw_mod_cfg: Pointer to the module config start of the module | ||
| * @m_ida: Module instance identifier | ||
| * @bss_size: Module object size | ||
| * @private: Module private data | ||
| */ | ||
| struct sof_ipc4_fw_module { | ||
| struct sof_man4_module man4_module_entry; | ||
| const struct sof_man4_module_config *fw_mod_cfg; | ||
| struct ida m_ida; | ||
| u32 bss_size; | ||
| void *private; | ||
| }; | ||
| @@ -69,6 +69,7 @@ struct sof_ipc4_fw_library { | ||
| * @max_num_pipelines: max number of pipelines | ||
| * @max_libs_count: Maximum number of libraries support by the FW including the | ||
| * base firmware | ||
| * @max_kcps: maximum cycles per second * 1000, iow the maximum core frequency | ||
RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| * | ||
| * @load_library: Callback function for platform dependent library loading | ||
| * @pipeline_state_mutex: Mutex to protect pipeline triggers, ref counts, states and deletion | ||
| @@ -81,6 +82,7 @@ struct sof_ipc4_fw_data { | ||
| u32 mtrace_log_bytes; | ||
| int max_num_pipelines; | ||
| u32 max_libs_count; | ||
| u32 max_kcps; | ||
| int (*load_library)(struct snd_sof_dev *sdev, | ||
| struct sof_ipc4_fw_library *fw_lib, bool reload); | ||
| @@ -114,4 +116,11 @@ int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev); | ||
| int sof_ipc4_reload_fw_libraries(struct snd_sof_dev *sdev); | ||
| struct sof_ipc4_fw_module *sof_ipc4_find_module_by_uuid(struct snd_sof_dev *sdev, | ||
| const guid_t *uuid); | ||
| struct sof_ipc4_base_module_cfg; | ||
| void sof_ipc4_update_cpc_from_manifest(struct snd_sof_dev *sdev, | ||
| struct sof_ipc4_fw_module *fw_module, | ||
| struct sof_ipc4_base_module_cfg *basecfg, | ||
| bool exact_match); | ||
| #endif | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.