Uh oh!
There was an error while loading. Please reload this page.
forked from torvalds/linux
- Notifications
You must be signed in to change notification settings - Fork 150
ASoC: SOF: ipc4-loader/topology: Query the module's CPC from firmware manifest only#4338
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
Merged
plbossart
merged 5 commits into
thesofproject:topic/sof-dev
from
ujfalusi:peter/sof/pr/ipc4_cpc_from_manifest_02May 11, 2023
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
71fe0a3
ASoC: SOF: ipc4-loader: Drop unused bss_size from struct sof_ipc4_fw_…
ujfalusi 180955c
ASoC: SOF: ipc4-loader: Save a a pointer to fm_config in sof_ipc4_fw_…
ujfalusi 6bb9f78
ASoC: SOF: ipc4-topology: Rename sof_ipc4_update_pipeline_mem_usage()…
ujfalusi d8bf981
ASoC: SOF: ipc4-topology: Do not use the CPC value from topology
ujfalusi dd24b70
ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest
ujfalusi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -39,8 +39,6 @@ static const struct sof_topology_token pipeline_tokens[] = { | ||
| }; | ||
| static const struct sof_topology_token ipc4_comp_tokens[] = { | ||
| {SOF_TKN_COMP_CPC, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, | ||
| offsetof(struct sof_ipc4_base_module_cfg, cpc)}, | ||
| {SOF_TKN_COMP_IS_PAGES, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, | ||
| offsetof(struct sof_ipc4_base_module_cfg, is_pages)}, | ||
| }; | ||
| @@ -235,7 +233,7 @@ static int sof_ipc4_get_audio_fmt(struct snd_soc_component *scomp, | ||
| "Number of input audio formats: %d. Number of output audio formats: %d\n", | ||
| available_fmt->num_input_formats, available_fmt->num_output_formats); | ||
| /* set cpc and is_pages in the module's base_config */ | ||
| /* set is_pages in the module's base_config */ | ||
| ret = sof_update_ipc_object(scomp, module_base_cfg, SOF_COMP_TOKENS, swidget->tuples, | ||
| swidget->num_tuples, sizeof(*module_base_cfg), 1); | ||
| if (ret) { | ||
| @@ -244,8 +242,8 @@ static int sof_ipc4_get_audio_fmt(struct snd_soc_component *scomp, | ||
| return ret; | ||
| } | ||
| dev_dbg(scomp->dev, "widget %s cpc: %d is_pages: %d\n", | ||
| swidget->widget->name, module_base_cfg->cpc, module_base_cfg->is_pages); | ||
| dev_dbg(scomp->dev, "widget %s: is_pages: %d\n", swidget->widget->name, | ||
| module_base_cfg->is_pages); | ||
| if (available_fmt->num_input_formats) { | ||
| in_format = kcalloc(available_fmt->num_input_formats, | ||
| @@ -723,9 +721,9 @@ static int sof_ipc4_widget_setup_comp_pga(struct snd_sof_widget *swidget) | ||
| } | ||
| dev_dbg(scomp->dev, | ||
| "pga widget %s: ramp type: %d, ramp duration %d, initial gain value: %#x, cpc %d\n", | ||
| "pga widget %s: ramp type: %d, ramp duration %d, initial gain value: %#x\n", | ||
| swidget->widget->name, gain->data.curve_type, gain->data.curve_duration_l, | ||
| gain->data.init_val, gain->base_config.cpc); | ||
| gain->data.init_val); | ||
| ret = sof_ipc4_widget_setup_msg(swidget, &gain->msg); | ||
| if (ret) | ||
| @@ -936,8 +934,8 @@ static void sof_ipc4_widget_free_comp_process(struct snd_sof_widget *swidget) | ||
| } | ||
| static void | ||
| sof_ipc4_update_pipeline_mem_usage(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget, | ||
| struct sof_ipc4_base_module_cfg *base_config) | ||
| sof_ipc4_update_resource_usage(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget, | ||
| struct sof_ipc4_base_module_cfg *base_config) | ||
| { | ||
| struct sof_ipc4_fw_module *fw_module = swidget->module_info; | ||
| struct snd_sof_widget *pipe_widget; | ||
| @@ -968,6 +966,13 @@ sof_ipc4_update_pipeline_mem_usage(struct snd_sof_dev *sdev, struct snd_sof_widg | ||
| pipe_widget = swidget->spipe->pipe_widget; | ||
| pipeline = pipe_widget->private; | ||
| pipeline->mem_usage += total; | ||
| /* Update base_config->cpc from the module manifest */ | ||
| sof_ipc4_update_cpc_from_manifest(sdev, fw_module, base_config); | ||
| dev_dbg(sdev->dev, "%s: ibs / obs / cpc: %u / %u / %u\n", | ||
| swidget->widget->name, base_config->ibs, base_config->obs, | ||
| base_config->cpc); | ||
plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| static int sof_ipc4_widget_assign_instance_id(struct snd_sof_dev *sdev, | ||
| @@ -1739,7 +1744,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, | ||
| &ipc4_copier->dma_config_tlv, dma_config_tlv_size); | ||
| /* update pipeline memory usage */ | ||
| sof_ipc4_update_pipeline_mem_usage(sdev, swidget, &copier_data->base_config); | ||
| sof_ipc4_update_resource_usage(sdev, swidget, &copier_data->base_config); | ||
| return 0; | ||
| } | ||
| @@ -1776,7 +1781,7 @@ static int sof_ipc4_prepare_gain_module(struct snd_sof_widget *swidget, | ||
| } | ||
| /* update pipeline memory usage */ | ||
| sof_ipc4_update_pipeline_mem_usage(sdev, swidget, &gain->base_config); | ||
| sof_ipc4_update_resource_usage(sdev, swidget, &gain->base_config); | ||
| return 0; | ||
| } | ||
| @@ -1813,7 +1818,7 @@ static int sof_ipc4_prepare_mixer_module(struct snd_sof_widget *swidget, | ||
| } | ||
| /* update pipeline memory usage */ | ||
| sof_ipc4_update_pipeline_mem_usage(sdev, swidget, &mixer->base_config); | ||
| sof_ipc4_update_resource_usage(sdev, swidget, &mixer->base_config); | ||
| return 0; | ||
| } | ||
| @@ -1850,7 +1855,7 @@ static int sof_ipc4_prepare_src_module(struct snd_sof_widget *swidget, | ||
| } | ||
| /* update pipeline memory usage */ | ||
| sof_ipc4_update_pipeline_mem_usage(sdev, swidget, &src->base_config); | ||
| sof_ipc4_update_resource_usage(sdev, swidget, &src->base_config); | ||
| /* update pipeline_params for sink widgets */ | ||
| rate = hw_param_interval(pipeline_params, SNDRV_PCM_HW_PARAM_RATE); | ||
| @@ -1987,7 +1992,7 @@ static int sof_ipc4_prepare_process_module(struct snd_sof_widget *swidget, | ||
| } | ||
| /* update pipeline memory usage */ | ||
| sof_ipc4_update_pipeline_mem_usage(sdev, swidget, &process->base_config); | ||
| sof_ipc4_update_resource_usage(sdev, swidget, &process->base_config); | ||
| /* ipc_config_data is composed of the base_config followed by an optional extension */ | ||
| memcpy(cfg, &process->base_config, sizeof(struct sof_ipc4_base_module_cfg)); | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is that no one looks at warnings, because they are not clear.
In this case, the message makes zero sense for an average user who doesn't even know what the CPC is.
It should really be "Invalid configuration: , the firmware will force the DSP clock to run with fastest clock" or something more meaningful
And I would use dev_err() as a way to catch those errors in CI, we do not track dev_warn, ever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But @plbossart an error would mean we need thesofproject/sof#7574 before we merge this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thesofproject/sof#7575 was merged, it replaced thesofproject/sof#7574
we can add a dev_err() in a follow-up patch later, for our own CI tracking.
I still think the message is far from clear. Put yourself in the shoes of johnny 4-pack, how on earth could they know what CPC is.
Maybe we can deal with this as a fixup, I'll approve to avoid blocking progress (or the new definition of progress).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7575 only went into mtl-005-drop-stable. I dont see anything for main