* [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support
@ 2017-06-19 6:29 Subhransu S. Prusty
2017-06-19 6:29 ` [PATCH v2 1/3] " Subhransu S. Prusty
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Subhransu S. Prusty @ 2017-06-19 6:29 UTC (permalink / raw)
To: alsa-devel; +Cc: tiwai, patches.audio, broonie, Subhransu S. Prusty, lgirdwood
Now that we can configure DSP dma buffer size, the device can support deep
buffer playback. DSP fetches large buffer and can result fewer wakes, which
helps in power reduction.
So this series first adds a token in topology to get dma_buffer_size and
sends to firmware after conversion. Also ads a deepbuffer device to use
this support.
v1->v2
Remove an unrelated change.
Ramesh Babu (2):
ASoC: Intel: Skylake: Add deep buffer support
ASoC: Intel: Skylake: Fix dma buffer size calculation
Subhransu S. Prusty (1):
ASoC: skl_rt286: Add deepbuffer dai link
include/uapi/sound/snd_sst_tokens.h | 5 ++++-
sound/soc/intel/boards/skl_rt286.c | 18 ++++++++++++++++++
sound/soc/intel/skylake/skl-messages.c | 29 +++++++++++++++++++++++++----
sound/soc/intel/skylake/skl-topology.c | 4 ++++
sound/soc/intel/skylake/skl-topology.h | 1 +
5 files changed, 52 insertions(+), 5 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] ASoC: Intel: Skylake: Add deep buffer support
2017-06-19 6:29 [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
@ 2017-06-19 6:29 ` Subhransu S. Prusty
2017-06-19 16:24 ` Applied "ASoC: Intel: Skylake: Add deep buffer support" to the asoc tree Mark Brown
2017-06-19 6:29 ` [PATCH v2 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation Subhransu S. Prusty
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Subhransu S. Prusty @ 2017-06-19 6:29 UTC (permalink / raw)
To: alsa-devel
Cc: tiwai, lgirdwood, Ramesh Babu, patches.audio, broonie,
Subhransu S. Prusty
From: Ramesh Babu <ramesh.babu@intel.com>
With this patch, the dma buffer size is fetched from topology binary. This
buffer size is applicable for gateway copier modules.
Now that we can configure DSP dma buffer size, the device can support deep
buffer playback. DSP fetches large buffer and can result fewer wakes,
which helps in power reduction.
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
include/uapi/sound/snd_sst_tokens.h | 5 ++++-
sound/soc/intel/skylake/skl-topology.c | 4 ++++
sound/soc/intel/skylake/skl-topology.h | 1 +
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/uapi/sound/snd_sst_tokens.h b/include/uapi/sound/snd_sst_tokens.h
index 89b82f6256ad..dedb2056160d 100644
--- a/include/uapi/sound/snd_sst_tokens.h
+++ b/include/uapi/sound/snd_sst_tokens.h
@@ -161,6 +161,8 @@
*
* %SKL_TKL_U32_D0I3_CAPS: Specifies the D0i3 capability for module
*
+ * %SKL_TKN_U32_DMA_BUF_SIZE: DMA buffer size in millisec
+ *
* module_id and loadable flags dont have tokens as these values will be
* read from the DSP FW manifest
*/
@@ -215,7 +217,8 @@ enum SKL_TKNS {
SKL_TKN_U32_PMODE,
SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
- SKL_TKN_MAX = SKL_TKN_U32_D0I3_CAPS,
+ SKL_TKN_U32_DMA_BUF_SIZE,
+ SKL_TKN_MAX = SKL_TKN_U32_DMA_BUF_SIZE,
};
#endif
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index b687ae455a61..2cadfa74438b 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -2086,6 +2086,10 @@ static int skl_tplg_get_token(struct device *dev,
break;
+ case SKL_TKN_U32_DMA_BUF_SIZE:
+ mconfig->dma_buffer_size = tkn_elem->value;
+ break;
+
case SKL_TKN_U8_IN_PIN_TYPE:
case SKL_TKN_U8_OUT_PIN_TYPE:
case SKL_TKN_U8_CONN_TYPE:
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index cc64d6bdb4f6..e760e835b885 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -314,6 +314,7 @@ struct skl_module_cfg {
u32 vbus_id;
u32 mem_pages;
enum d0i3_capability d0i3_caps;
+ u32 dma_buffer_size; /* in milli seconds */
struct skl_module_pin *m_in_pin;
struct skl_module_pin *m_out_pin;
enum skl_module_type m_type;
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation
2017-06-19 6:29 [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
2017-06-19 6:29 ` [PATCH v2 1/3] " Subhransu S. Prusty
@ 2017-06-19 6:29 ` Subhransu S. Prusty
2017-06-19 6:29 ` [PATCH v2 3/3] ASoC: skl_rt286: Add deepbuffer dai link Subhransu S. Prusty
2017-06-19 8:00 ` [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Vinod Koul
3 siblings, 0 replies; 6+ messages in thread
From: Subhransu S. Prusty @ 2017-06-19 6:29 UTC (permalink / raw)
To: alsa-devel
Cc: tiwai, lgirdwood, Ramesh Babu, patches.audio, broonie,
Subhransu S. Prusty
From: Ramesh Babu <ramesh.babu@intel.com>
DMA buffer size for gateway copier will be calculated based on:
For host DMA copier:
Input buffer size (ibs) for output direction (playback)
Output buffer size (obs) for input direction (capture)
For link DMA copier:
IBS for input direction (capture)
OBS for output direction (playback)
Update the driver to use the above.
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
sound/soc/intel/skylake/skl-messages.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index ab1adc0c9cc3..7063b451b109 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -507,6 +507,8 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx,
struct skl_module_cfg *mconfig,
struct skl_cpr_cfg *cpr_mconfig)
{
+ u32 dma_io_buf;
+
cpr_mconfig->gtw_cfg.node_id = skl_get_node_id(ctx, mconfig);
if (cpr_mconfig->gtw_cfg.node_id == SKL_NON_GATEWAY_CPR_NODE_ID) {
@@ -514,10 +516,29 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx,
return;
}
- if (SKL_CONN_SOURCE == mconfig->hw_conn_type)
- cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs;
- else
- cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->ibs;
+ switch (mconfig->hw_conn_type) {
+ case SKL_CONN_SOURCE:
+ if (mconfig->dev_type == SKL_DEVICE_HDAHOST)
+ dma_io_buf = mconfig->ibs;
+ else
+ dma_io_buf = mconfig->obs;
+ break;
+
+ case SKL_CONN_SINK:
+ if (mconfig->dev_type == SKL_DEVICE_HDAHOST)
+ dma_io_buf = mconfig->obs;
+ else
+ dma_io_buf = mconfig->ibs;
+ break;
+
+ default:
+ dev_warn(ctx->dev, "wrong connection type: %d\n",
+ mconfig->hw_conn_type);
+ return;
+ }
+
+ cpr_mconfig->gtw_cfg.dma_buffer_size =
+ mconfig->dma_buffer_size * dma_io_buf;
cpr_mconfig->cpr_feature_mask = 0;
cpr_mconfig->gtw_cfg.config_length = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] ASoC: skl_rt286: Add deepbuffer dai link
2017-06-19 6:29 [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
2017-06-19 6:29 ` [PATCH v2 1/3] " Subhransu S. Prusty
2017-06-19 6:29 ` [PATCH v2 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation Subhransu S. Prusty
@ 2017-06-19 6:29 ` Subhransu S. Prusty
2017-06-19 8:00 ` [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Vinod Koul
3 siblings, 0 replies; 6+ messages in thread
From: Subhransu S. Prusty @ 2017-06-19 6:29 UTC (permalink / raw)
To: alsa-devel; +Cc: tiwai, patches.audio, broonie, Subhransu S. Prusty, lgirdwood
This patch adds the deepbuffer device which can be opened with a bigger
buffer size. The application can disable interrupts and sleep for longer
duration.
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
sound/soc/intel/boards/skl_rt286.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sound/soc/intel/boards/skl_rt286.c b/sound/soc/intel/boards/skl_rt286.c
index f5ab7b8d51d1..453826ea1367 100644
--- a/sound/soc/intel/boards/skl_rt286.c
+++ b/sound/soc/intel/boards/skl_rt286.c
@@ -43,6 +43,7 @@ struct skl_rt286_private {
enum {
SKL_DPCM_AUDIO_PB = 0,
+ SKL_DPCM_AUDIO_DB_PB,
SKL_DPCM_AUDIO_CP,
SKL_DPCM_AUDIO_REF_CP,
SKL_DPCM_AUDIO_DMIC_CP,
@@ -310,6 +311,23 @@ static int skylake_dmic_startup(struct snd_pcm_substream *substream)
.dpcm_playback = 1,
.ops = &skylake_rt286_fe_ops,
},
+ [SKL_DPCM_AUDIO_DB_PB] = {
+ .name = "Skl Deepbuffer Port",
+ .stream_name = "Deep Buffer Audio",
+ .cpu_dai_name = "Deepbuffer Pin",
+ .platform_name = "0000:00:1f.3",
+ .nonatomic = 1,
+ .dynamic = 1,
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .trigger = {
+ SND_SOC_DPCM_TRIGGER_POST,
+ SND_SOC_DPCM_TRIGGER_POST
+ },
+ .dpcm_playback = 1,
+ .ops = &skylake_rt286_fe_ops,
+
+ },
[SKL_DPCM_AUDIO_CP] = {
.name = "Skl Audio Capture Port",
.stream_name = "Audio Record",
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support
2017-06-19 6:29 [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
` (2 preceding siblings ...)
2017-06-19 6:29 ` [PATCH v2 3/3] ASoC: skl_rt286: Add deepbuffer dai link Subhransu S. Prusty
@ 2017-06-19 8:00 ` Vinod Koul
3 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2017-06-19 8:00 UTC (permalink / raw)
To: Subhransu S. Prusty; +Cc: tiwai, patches.audio, alsa-devel, broonie, lgirdwood
On Mon, Jun 19, 2017 at 11:59:18AM +0530, Subhransu S. Prusty wrote:
> Now that we can configure DSP dma buffer size, the device can support deep
> buffer playback. DSP fetches large buffer and can result fewer wakes, which
> helps in power reduction.
>
> So this series first adds a token in topology to get dma_buffer_size and
> sends to firmware after conversion. Also ads a deepbuffer device to use
> this support.
Acked-By: Vinod Koul <vinod.koul@intel.com>
--
~Vinod
^ permalink raw reply [flat|nested] 6+ messages in thread
* Applied "ASoC: Intel: Skylake: Add deep buffer support" to the asoc tree
2017-06-19 6:29 ` [PATCH v2 1/3] " Subhransu S. Prusty
@ 2017-06-19 16:24 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2017-06-19 16:24 UTC (permalink / raw)
To: Ramesh Babu
Cc: alsa-devel, tiwai, lgirdwood, patches.audio, broonie,
Subhransu S. Prusty
The patch
ASoC: Intel: Skylake: Add deep buffer support
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 939df3ada789ccd61a01721df8fc7955aab3aad7 Mon Sep 17 00:00:00 2001
From: Ramesh Babu <ramesh.babu@intel.com>
Date: Mon, 19 Jun 2017 11:59:19 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Add deep buffer support
With this patch, the dma buffer size is fetched from topology binary. This
buffer size is applicable for gateway copier modules.
Now that we can configure DSP dma buffer size, the device can support deep
buffer playback. DSP fetches large buffer and can result fewer wakes,
which helps in power reduction.
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
include/uapi/sound/snd_sst_tokens.h | 5 ++++-
sound/soc/intel/skylake/skl-topology.c | 4 ++++
sound/soc/intel/skylake/skl-topology.h | 1 +
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/uapi/sound/snd_sst_tokens.h b/include/uapi/sound/snd_sst_tokens.h
index 89b82f6256ad..dedb2056160d 100644
--- a/include/uapi/sound/snd_sst_tokens.h
+++ b/include/uapi/sound/snd_sst_tokens.h
@@ -161,6 +161,8 @@
*
* %SKL_TKL_U32_D0I3_CAPS: Specifies the D0i3 capability for module
*
+ * %SKL_TKN_U32_DMA_BUF_SIZE: DMA buffer size in millisec
+ *
* module_id and loadable flags dont have tokens as these values will be
* read from the DSP FW manifest
*/
@@ -215,7 +217,8 @@ enum SKL_TKNS {
SKL_TKN_U32_PMODE,
SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
- SKL_TKN_MAX = SKL_TKN_U32_D0I3_CAPS,
+ SKL_TKN_U32_DMA_BUF_SIZE,
+ SKL_TKN_MAX = SKL_TKN_U32_DMA_BUF_SIZE,
};
#endif
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 212cee71d586..9569f118e97e 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -2212,6 +2212,10 @@ static int skl_tplg_get_token(struct device *dev,
break;
+ case SKL_TKN_U32_DMA_BUF_SIZE:
+ mconfig->dma_buffer_size = tkn_elem->value;
+ break;
+
case SKL_TKN_U8_IN_PIN_TYPE:
case SKL_TKN_U8_OUT_PIN_TYPE:
case SKL_TKN_U8_CONN_TYPE:
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index 3f51a0a00093..c25e8868b84e 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -321,6 +321,7 @@ struct skl_module_cfg {
u32 vbus_id;
u32 mem_pages;
enum d0i3_capability d0i3_caps;
+ u32 dma_buffer_size; /* in milli seconds */
struct skl_module_pin *m_in_pin;
struct skl_module_pin *m_out_pin;
enum skl_module_type m_type;
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-06-19 16:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-19 6:29 [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
2017-06-19 6:29 ` [PATCH v2 1/3] " Subhransu S. Prusty
2017-06-19 16:24 ` Applied "ASoC: Intel: Skylake: Add deep buffer support" to the asoc tree Mark Brown
2017-06-19 6:29 ` [PATCH v2 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation Subhransu S. Prusty
2017-06-19 6:29 ` [PATCH v2 3/3] ASoC: skl_rt286: Add deepbuffer dai link Subhransu S. Prusty
2017-06-19 8:00 ` [PATCH v2 0/3] ASoC: Intel: Skylake: Add deep buffer support Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.