Skip to content

Commit 3dcf683

Browse files
ujfalusibroonie
authored andcommitted
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: 842bb8b ("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>
1 parent a7fe5ff commit 3dcf683

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,13 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget)
666666
swidget->tuples,
667667
swidget->num_tuples, sizeof(u32), 1);
668668
/* 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+
}
671676
} else {
672677
/* Capture data is copied from DSP to host in 1ms bursts */
673678
spcm->stream[dir].dsp_max_burst_size_in_ms = 1;

sound/soc/sof/ipc4-topology.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373
/* FW requires minimum 4ms DMA buffer size */
7474
#define SOF_IPC4_MIN_DMA_BUFFER_SIZE 4
7575

76+
/* ChainDMA in fw uses 5ms DMA buffer */
77+
#define SOF_IPC4_CHAIN_DMA_BUFFER_SIZE 5
78+
7679
/*
7780
* The base of multi-gateways. Multi-gateways addressing starts from
7881
* ALH_MULTI_GTW_BASE and there are ALH_MULTI_GTW_COUNT multi-sources

0 commit comments

Comments
 (0)