Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: ipc4-topology: Account for different ChainDMA host buffer size

For ChainDMA the firmware allocates 5ms host buffer instead of the standard
4ms which should be taken into account when setting the constraint on the
buffer size.

Fixes: 842bb8b62cc6 ("ASoC: SOF: ipc4-topology: Save the DMA maximum burst size for PCMs")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20251002135752.2430-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Peter Ujfalusi and committed by
Mark Brown
3dcf683b a7fe5ff8

+10 -2
+7 -2
sound/soc/sof/ipc4-topology.c
··· 666 666 swidget->tuples, 667 667 swidget->num_tuples, sizeof(u32), 1); 668 668 /* Set default DMA buffer size if it is not specified in topology */ 669 - if (!sps->dsp_max_burst_size_in_ms) 670 - sps->dsp_max_burst_size_in_ms = SOF_IPC4_MIN_DMA_BUFFER_SIZE; 669 + if (!sps->dsp_max_burst_size_in_ms) { 670 + struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget; 671 + struct sof_ipc4_pipeline *pipeline = pipe_widget->private; 672 + 673 + sps->dsp_max_burst_size_in_ms = pipeline->use_chain_dma ? 674 + SOF_IPC4_CHAIN_DMA_BUFFER_SIZE : SOF_IPC4_MIN_DMA_BUFFER_SIZE; 675 + } 671 676 } else { 672 677 /* Capture data is copied from DSP to host in 1ms bursts */ 673 678 spcm->stream[dir].dsp_max_burst_size_in_ms = 1;
+3
sound/soc/sof/ipc4-topology.h
··· 73 73 /* FW requires minimum 4ms DMA buffer size */ 74 74 #define SOF_IPC4_MIN_DMA_BUFFER_SIZE 4 75 75 76 + /* ChainDMA in fw uses 5ms DMA buffer */ 77 + #define SOF_IPC4_CHAIN_DMA_BUFFER_SIZE 5 78 + 76 79 /* 77 80 * The base of multi-gateways. Multi-gateways addressing starts from 78 81 * ALH_MULTI_GTW_BASE and there are ALH_MULTI_GTW_COUNT multi-sources