ASoC: SOF: topology: Add new token for dynamic pipeline
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Mon, 27 Sep 2021 12:05:08 +0000 (15:05 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 1 Oct 2021 19:48:22 +0000 (20:48 +0100)
commit2c28ecad0d099ff914a0675f064db6e5b75e0756
treeb78461a31a47e0c252d5edf53c22c3702793ca21
parent199a3754f2736808d7bfa4c962eaf89e1d17e462
ASoC: SOF: topology: Add new token for dynamic pipeline

Today, we set up all widgets required for all PCM streams
at the time of topology parsing even if they are not
used. An optimization would be to only set up the widgets
required for currently active PCM streams. This would give
the FW the opportunity to power gate unused memory blocks,
thereby saving power.

For dynamic pipelines, the widgets in the connected DAPM path
for each PCM will need to be set up at runtime. This patch
introduces a new token, DYNAMIC_PIPELINE, for scheduler type
widgets that indicate whether a pipeline should be set up
statically during topology load or at runtime when the PCM is
opened. Introduce a new field called dynamic_pipeline_widget
in struct snd_sof_widget to save the value of the parsed token.

The token is set only for the pipeline (scheduler type)
widget and must be propagated to all widgets in the same
pipeline during topology load. Introduce another field called
pipe_widget in struct snd_sof_widget that saves the pointer to
the scheduler widget with the same pipeline ID as that of the
widget. This field is populated when the pipeline completion
callback is invoked during topology loading.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/uapi/sound/sof/tokens.h
sound/soc/sof/sof-audio.h
sound/soc/sof/topology.c