alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Keyon Jie <yang.jie@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 1/4] ASoC: SOF: pcm: skip DMA buffer pre-allocation
Date: Fri, 28 Feb 2020 17:18:47 -0600	[thread overview]
Message-ID: <20200228231850.9226-2-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20200228231850.9226-1-pierre-louis.bossart@linux.intel.com>

From: Keyon Jie <yang.jie@linux.intel.com>

As discussion in ALSA https://patchwork.kernel.org/patch/11336023/, it
is suggested to skip DMA buffer pre-allocation with passing size=0 when
calling snd_pcm_set_managed_buffer(), to make the full buffer_bytes
range configured in topology file selectable from user space, here do
the corresponding change in SOF PCM driver to implement it.

This change doesn't have dependency to the change that Takashi will do
in the ALSA core by adding total_pcm_alloc_bytes limitation to the
struct snd_card, it passes tests both with or without Takashi's coming
change on SOF CML platform.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/pcm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c
index b239bbff4b5c..f4769e19965a 100644
--- a/sound/soc/sof/pcm.c
+++ b/sound/soc/sof/pcm.c
@@ -601,8 +601,7 @@ static int sof_pcm_new(struct snd_soc_component *component,
 
 	snd_pcm_set_managed_buffer(pcm->streams[stream].substream,
 				   SNDRV_DMA_TYPE_DEV_SG, sdev->dev,
-				   le32_to_cpu(caps->buffer_size_min),
-				   le32_to_cpu(caps->buffer_size_max));
+				   0, le32_to_cpu(caps->buffer_size_max));
 capture:
 	stream = SNDRV_PCM_STREAM_CAPTURE;
 
@@ -624,8 +623,7 @@ static int sof_pcm_new(struct snd_soc_component *component,
 
 	snd_pcm_set_managed_buffer(pcm->streams[stream].substream,
 				   SNDRV_DMA_TYPE_DEV_SG, sdev->dev,
-				   le32_to_cpu(caps->buffer_size_min),
-				   le32_to_cpu(caps->buffer_size_max));
+				   0, le32_to_cpu(caps->buffer_size_max));
 
 	return 0;
 }
-- 
2.20.1


  reply	other threads:[~2020-02-28 23:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 23:18 [PATCH 0/4] ASoC: SOF: updates for 5.7 Pierre-Louis Bossart
2020-02-28 23:18 ` Pierre-Louis Bossart [this message]
2020-03-02 14:37   ` Applied "ASoC: SOF: pcm: skip DMA buffer pre-allocation" to the asoc tree Mark Brown
2020-02-28 23:18 ` [PATCH 2/4] ASoC: SOF: ipc: check ipc return value before data copy Pierre-Louis Bossart
2020-03-02 14:37   ` Applied "ASoC: SOF: ipc: check ipc return value before data copy" to the asoc tree Mark Brown
2020-02-28 23:18 ` [PATCH 3/4] ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done Pierre-Louis Bossart
2020-03-02 14:37   ` Applied "ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done" to the asoc tree Mark Brown
2020-02-28 23:18 ` [PATCH 4/4] ASoC: SOF: add core id to sof_ipc_comp Pierre-Louis Bossart
2020-03-02 14:37   ` Applied "ASoC: SOF: add core id to sof_ipc_comp" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200228231850.9226-2-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=tiwai@suse.de \
    --cc=yang.jie@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).