All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	tiwai@suse.de, Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Rander Wang <rander.wang@intel.com>,
	broonie@kernel.org, Daniel Baluta <daniel.baluta@nxp.com>
Subject: [PATCH 02/10] ASoC: SOF: amd: acp-pcm: Take buffer information directly from runtime
Date: Fri,  4 Mar 2022 14:57:25 -0600	[thread overview]
Message-ID: <20220304205733.62233-3-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20220304205733.62233-1-pierre-louis.bossart@linux.intel.com>

From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

Instead of using the values from ipc_params, take them directly from
substream->runtime.

This is in preparation of making the platform hw_params callback to be
IPC agnostic.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/amd/acp-pcm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/amd/acp-pcm.c b/sound/soc/sof/amd/acp-pcm.c
index 5b23830cb1f3..b49cc55980ae 100644
--- a/sound/soc/sof/amd/acp-pcm.c
+++ b/sound/soc/sof/amd/acp-pcm.c
@@ -19,13 +19,14 @@
 int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
 		      struct snd_pcm_hw_params *params, struct sof_ipc_stream_params *ipc_params)
 {
-	struct acp_dsp_stream *stream = substream->runtime->private_data;
+	struct snd_pcm_runtime *runtime = substream->runtime;
+	struct acp_dsp_stream *stream = runtime->private_data;
 	unsigned int buf_offset, index;
 	u32 size;
 	int ret;
 
-	size = ipc_params->buffer.size;
-	stream->num_pages = ipc_params->buffer.pages;
+	size = runtime->dma_bytes;
+	stream->num_pages = PFN_UP(runtime->dma_bytes);
 	stream->dmab = substream->runtime->dma_buffer_p;
 
 	ret = acp_dsp_stream_config(sdev, stream);
-- 
2.30.2


  parent reply	other threads:[~2022-03-04 20:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 20:57 [PATCH 00/10] ASoC: SOF: updates for 5.18 Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 01/10] ASoC: SOF: Intel: pci-tgl: add RPL-S support Pierre-Louis Bossart
2022-03-04 20:57 ` Pierre-Louis Bossart [this message]
2022-03-04 20:57 ` [PATCH 03/10] ASoC: SOF: amd: Do not set ipc_pcm_params ops as it is optional Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 04/10] ASoC: SOF: amd: Flush cache after ATU_BASE_ADDR_GRP register update Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 05/10] ASoC: SOF: amd: Use semaphore register to synchronize ipc's irq Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 06/10] ASoC: SOF: amd: Move group register configuration to acp-loader Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 07/10] ASoC: SOF: amd: Increase ACP_HW_SEM_RETRY_COUNT value Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 08/10] ASoC: SOF: fix 32 signed bit overflow Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 09/10] ASoC: SOF: debug: clarify operator precedence Pierre-Louis Bossart
2022-03-04 20:57 ` [PATCH 10/10] ASoC: SOF: Intel: hda: " Pierre-Louis Bossart
2022-03-07 20:39 ` [PATCH 00/10] ASoC: SOF: updates for 5.18 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=20220304205733.62233-3-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=rander.wang@intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.de \
    /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 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.