-
Notifications
You must be signed in to change notification settings - Fork 142
ASoC: SOF: use FW based aggregation on ACE2.x #4790
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
Changes from all commits
7dc06d5
c6235d9
24170d1
590f70d
462c0a7
21bb3b9
9949349
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -601,7 +601,11 @@ static int sof_ipc4_widget_setup_comp_dai(struct snd_sof_widget *swidget) | |
| } | ||
|
|
||
| ipc4_copier->copier_config = (uint32_t *)blob; | ||
| ipc4_copier->data.gtw_cfg.config_length = sizeof(*blob) >> 2; | ||
| /* set data.gtw_cfg.config_length based on device_count */ | ||
| ipc4_copier->data.gtw_cfg.config_length = (sizeof(blob->gw_attr) + | ||
| sizeof(blob->alh_cfg.device_count) + | ||
| sizeof(*blob->alh_cfg.mapping) * | ||
| blob->alh_cfg.device_count) >> 2; | ||
bardliao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| break; | ||
| } | ||
| case SOF_DAI_INTEL_SSP: | ||
|
|
@@ -1463,6 +1467,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, | |
| u32 deep_buffer_dma_ms = 0; | ||
| int output_fmt_index; | ||
| bool single_output_format; | ||
| int i; | ||
|
|
||
| dev_dbg(sdev->dev, "copier %s, type %d", swidget->widget->name, swidget->id); | ||
|
|
||
|
|
@@ -1680,6 +1685,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, | |
| */ | ||
| if (ipc4_copier->dai_type == SOF_DAI_INTEL_ALH) { | ||
| struct sof_ipc4_alh_configuration_blob *blob; | ||
| struct sof_ipc4_dma_config *dma_config; | ||
| struct sof_ipc4_copier_data *alh_data; | ||
| struct sof_ipc4_copier *alh_copier; | ||
| struct snd_sof_widget *w; | ||
|
|
@@ -1688,7 +1694,6 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, | |
| u32 ch_map; | ||
| u32 step; | ||
| u32 mask; | ||
| int i; | ||
|
|
||
| blob = (struct sof_ipc4_alh_configuration_blob *)ipc4_copier->copier_config; | ||
|
|
||
|
|
@@ -1720,6 +1725,18 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, | |
| alh_copier = (struct sof_ipc4_copier *)dai->private; | ||
| alh_data = &alh_copier->data; | ||
| blob->alh_cfg.mapping[i].device = alh_data->gtw_cfg.node_id; | ||
|
|
||
| /* | ||
| * The mapping[i] device in ALH blob should be the same as the | ||
| * dma_config_tlv[i] mapping device if a dma_config_tlv is present. | ||
|
Member
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. Is this really a requirement? this isn't something we discussed? I don't mind setting it to the same value as the DMA config TLV if the goal was to align with the other OS, but I would be surprised if the firmware used this value. |
||
| * The device id will be used for DMA tlv mapping purposes. | ||
| */ | ||
| if (ipc4_copier->dma_config_tlv[i].length) { | ||
| dma_config = &ipc4_copier->dma_config_tlv[i].dma_config; | ||
| blob->alh_cfg.mapping[i].device = | ||
| dma_config->dma_stream_channel_map.mapping[0].device; | ||
|
Member
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. I don't understand this part. Do we actually care about the alh_cfg mapping? It seems completely redundant. @iganakov do you actually use this for the aggregation or do you rely on the DMA TLV only? |
||
| } | ||
|
|
||
| /* | ||
| * Set the same channel mask for playback as the audio data is | ||
| * duplicated for all speakers. For capture, split the channels | ||
|
|
@@ -1798,19 +1815,18 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, | |
| gtw_cfg_config_length = copier_data->gtw_cfg.config_length * 4; | ||
| ipc_size = sizeof(*copier_data) + gtw_cfg_config_length; | ||
|
|
||
| if (ipc4_copier->dma_config_tlv.type == SOF_IPC4_GTW_DMA_CONFIG_ID && | ||
| ipc4_copier->dma_config_tlv.length) { | ||
| dma_config_tlv_size = sizeof(ipc4_copier->dma_config_tlv) + | ||
| ipc4_copier->dma_config_tlv.dma_config.dma_priv_config_size; | ||
|
|
||
| /* paranoia check on TLV size/length */ | ||
| if (dma_config_tlv_size != ipc4_copier->dma_config_tlv.length + | ||
| sizeof(uint32_t) * 2) { | ||
| dev_err(sdev->dev, "Invalid configuration, TLV size %d length %d\n", | ||
| dma_config_tlv_size, ipc4_copier->dma_config_tlv.length); | ||
| return -EINVAL; | ||
| } | ||
| dma_config_tlv_size = 0; | ||
| for (i = 0; i < SOF_IPC4_DMA_DEVICE_MAX_COUNT; i++) { | ||
| if (ipc4_copier->dma_config_tlv[i].type != SOF_IPC4_GTW_DMA_CONFIG_ID) | ||
| continue; | ||
| dma_config_tlv_size += ipc4_copier->dma_config_tlv[i].length; | ||
bardliao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| dma_config_tlv_size += | ||
| ipc4_copier->dma_config_tlv[i].dma_config.dma_priv_config_size; | ||
| dma_config_tlv_size += (sizeof(ipc4_copier->dma_config_tlv[i]) - | ||
| sizeof(ipc4_copier->dma_config_tlv[i].dma_config)); | ||
| } | ||
|
|
||
| if (dma_config_tlv_size) { | ||
| ipc_size += dma_config_tlv_size; | ||
|
|
||
| /* we also need to increase the size at the gtw level */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.