* [PATCH 1/3] ASoC: Intel: Skylake: Add deep buffer support
2017-06-12 11:40 [PATCH 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
@ 2017-06-12 11:40 ` Subhransu S. Prusty
2017-06-12 11:40 ` [PATCH 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation Subhransu S. Prusty
2017-06-12 11:40 ` [PATCH 3/3] ASoC: skl_rt286: Add deepbuffer dai link Subhransu S. Prusty
2 siblings, 0 replies; 6+ messages in thread
From: Subhransu S. Prusty @ 2017-06-12 11:40 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 | 7 +++++--
sound/soc/intel/skylake/skl-topology.c | 4 ++++
sound/soc/intel/skylake/skl-topology.h | 1 +
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/uapi/sound/snd_sst_tokens.h b/include/uapi/sound/snd_sst_tokens.h
index 89b82f6256ad..f1c9416294a5 100644
--- a/include/uapi/sound/snd_sst_tokens.h
+++ b/include/uapi/sound/snd_sst_tokens.h
@@ -152,7 +152,7 @@
* %SKL_TKN_U32_CAPS_SIZE: Caps size
*
* %SKL_TKN_U32_PROC_DOMAIN: Specify processing domain
- *
+
* %SKL_TKN_U32_LIB_COUNT: Specifies the number of libraries
*
* %SKL_TKN_STR_LIB_NAME: Specifies the library name
@@ -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 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation
2017-06-12 11:40 [PATCH 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
2017-06-12 11:40 ` [PATCH 1/3] " Subhransu S. Prusty
@ 2017-06-12 11:40 ` Subhransu S. Prusty
2017-06-19 16:23 ` Applied "ASoC: Intel: Skylake: Fix dma buffer size calculation" to the asoc tree Mark Brown
2017-06-12 11:40 ` [PATCH 3/3] ASoC: skl_rt286: Add deepbuffer dai link Subhransu S. Prusty
2 siblings, 1 reply; 6+ messages in thread
From: Subhransu S. Prusty @ 2017-06-12 11:40 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* Applied "ASoC: Intel: Skylake: Fix dma buffer size calculation" to the asoc tree
2017-06-12 11:40 ` [PATCH 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation Subhransu S. Prusty
@ 2017-06-19 16:23 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2017-06-19 16:23 UTC (permalink / raw)
To: Ramesh Babu
Cc: alsa-devel, tiwai, lgirdwood, patches.audio, broonie,
Subhransu S. Prusty
The patch
ASoC: Intel: Skylake: Fix dma buffer size calculation
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 f6e6ab1d16ec9dafa65557b5637f5217b32702ef Mon Sep 17 00:00:00 2001
From: Ramesh Babu <ramesh.babu@intel.com>
Date: Mon, 19 Jun 2017 11:59:20 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix dma buffer size calculation
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>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
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 5a465020ebd8..eca85827dbd2 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;
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] ASoC: skl_rt286: Add deepbuffer dai link
2017-06-12 11:40 [PATCH 0/3] ASoC: Intel: Skylake: Add deep buffer support Subhransu S. Prusty
2017-06-12 11:40 ` [PATCH 1/3] " Subhransu S. Prusty
2017-06-12 11:40 ` [PATCH 2/3] ASoC: Intel: Skylake: Fix dma buffer size calculation Subhransu S. Prusty
@ 2017-06-12 11:40 ` Subhransu S. Prusty
2017-06-19 16:23 ` Applied "ASoC: skl_rt286: Add deepbuffer dai link" to the asoc tree Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Subhransu S. Prusty @ 2017-06-12 11:40 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* Applied "ASoC: skl_rt286: Add deepbuffer dai link" to the asoc tree
2017-06-12 11:40 ` [PATCH 3/3] ASoC: skl_rt286: Add deepbuffer dai link Subhransu S. Prusty
@ 2017-06-19 16:23 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2017-06-19 16:23 UTC (permalink / raw)
Cc: alsa-devel, tiwai, lgirdwood, patches.audio, broonie,
Subhransu S. Prusty
The patch
ASoC: skl_rt286: Add deepbuffer dai link
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 1f0f8bde45a7ea843bb2e7a8f45f255b23cdc2e7 Mon Sep 17 00:00:00 2001
From: "Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Date: Mon, 19 Jun 2017 11:59:21 +0530
Subject: [PATCH] ASoC: skl_rt286: Add deepbuffer dai link
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>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
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 e08c71625fd0..2bc4cfca594e 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 struct snd_soc_dai_link skylake_rt286_dais[] = {
.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",
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread