Skip to contentSkip to conversation

ASoC: SOF: ipc: update sof_ipc_stream_params

PATCH In review Keyon Jie 2 participants 4 messages Jul 2, 2019 – Jul 3, 2019

Subsystems (3)
lore
Share & tools
lore

Keyon Jie

author
#0 lore raw

PATCH 1/2 ASoC: SOF: ipc: update sof_ipc_stream_params

From: Marcin Rajwa <[email protected]>

The host period bytes needs to be passed to firmware. Currently this field is used as notification for host about period copy completion. Therefore we need to split these two informations.

---
 include/sound/sof/stream.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/sound/sof/stream.h +2 -2
index 643f175cb479..44acfa62fa69 100644
@@ -83,10 +83,10 @@ struct sof_ipc_stream_params {
 	uint16_t sample_valid_bytes;
 	uint16_t sample_container_bytes;
 
-	/* for notifying host period has completed - 0 means no period IRQ */
 	uint32_t host_period_bytes;
+	uint16_t no_period_irq; /* 1 means period IRQ mode OFF */
 
-	uint32_t reserved[2];
+	uint16_t reserved[3];
 	uint16_t chmap[SOF_IPC_MAX_CHANNELS];	/**< channel map - SOF_CHMAP_ */
 } __packed;
 
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH 2/2 ASoC: SOF: Intel: fix reset of host_period_bytes

From: Marcin Rajwa <[email protected]>

This patch prevents the reset of host period bytes. The parameter has been used to keep information about completion of period copy. Right now we keep this information in period_irq.

---
 sound/soc/sof/intel/hda-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sof/intel/hda-pcm.c +2 -2
index 9b730f183529..c7022346aba0 100644
@@ -116,9 +116,9 @@ int hda_dsp_pcm_hw_params(struct snd_sof_dev *sdev,
 	/* disable SPIB, to enable buffer wrap for stream */
 	hda_dsp_stream_spib_config(sdev, stream, HDA_DSP_SPIB_DISABLE, 0);
 
-	/* set host_period_bytes to 0 if no IPC position */
+	/* update no_period_irq flag for ipc params */
 	if (hda && hda->no_ipc_position)
-		ipc_params->host_period_bytes = 0;
+		ipc_params->no_period_irq = 1;
 
 	ipc_params->stream_tag = hstream->stream_tag;
 
Signature · 1 line
2.20.1
#2 lore raw
In reply to Keyon Jie
Quoted 6 lines · Keyon Jie

From: Marcin Rajwa <[email protected]>

The host period bytes needs to be passed to firmware. Currently this field is used as notification for host about period copy completion. Therefore we need to split these two informations.

Keyon/Marcin,

Could you please add a bit more context in the commit message on the need to split these two fields ie.. what usecases need this?

Thanks,
Ranjani

Quoted 26 lines
---
 include/sound/sof/stream.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/sound/sof/stream.h +0 -1
index 643f175cb479..44acfa62fa69 100644
@@ -83,10 +83,10 @@ struct sof_ipc_stream_params {
 	uint16_t sample_valid_bytes;
 	uint16_t sample_container_bytes;
 
-	/* for notifying host period has completed - 0 means no period

IRQ */

include/sound/sof/stream.h +2 -1
 	uint32_t host_period_bytes;
+	uint16_t no_period_irq; /* 1 means period IRQ mode OFF */
 
-	uint32_t reserved[2];
+	uint16_t reserved[3];
 	uint16_t chmap[SOF_IPC_MAX_CHANNELS];	/**< channel map -

SOF_CHMAP_ */
} __packed;

author
#3 lore raw
Quoted 11 lines · Ranjani Sridharan
Quoted 6 lines · Keyon Jie

From: Marcin Rajwa <[email protected]>

The host period bytes needs to be passed to firmware. Currently this field is used as notification for host about period copy completion. Therefore we need to split these two informations.

Keyon/Marcin,

Could you please add a bit more context in the commit message on the need to split these two fields ie.. what usecases need this?

Sure, previously I wrote the commit message like this:

ASoC: SOF: add flag for position update ipc

In some cases, FW might need use the host_period_bytes even no position update ipc reqiured from driver, here add another flag for position update, and preserve host_period_bytes for FW to use.

This might require corresponding FW change and ABI alignment.

Thanks,
~Keyon

Quoted 23 lines

Thanks,
Ranjani

Quoted 20 lines
---
  include/sound/sof/stream.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
include/sound/sof/stream.h +0 -1
index 643f175cb479..44acfa62fa69 100644
@@ -83,10 +83,10 @@ struct sof_ipc_stream_params {
  	uint16_t sample_valid_bytes;
  	uint16_t sample_container_bytes;
 
-	/* for notifying host period has completed - 0 means no period

IRQ */
uint32_t host_period_bytes;

include/sound/sof/stream.h +1 -0
+	uint16_t no_period_irq; /* 1 means period IRQ mode OFF */
Quoted 8 lines
Quoted 6 lines
include/sound/sof/stream.h +1 -1
-	uint32_t reserved[2];
+	uint16_t reserved[3];
  	uint16_t chmap[SOF_IPC_MAX_CHANNELS];	/**< channel map -

SOF_CHMAP_ */
} __packed;

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel