diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2021-05-20 13:01:53 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-05-20 14:01:06 +0200 |
commit | 9b1fcd9bf802062c1b6c325b7762f4ecdc59f309 (patch) | |
tree | b5d054aea0bf162ced0657ce8f27c814253113df /sound/firewire/motu | |
parent | bd165079dedb40b8a8334beae304a128a8269831 (diff) | |
download | linux-9b1fcd9bf802062c1b6c325b7762f4ecdc59f309.tar.bz2 |
ALSA: firewire-lib: start processing content of packet at the same cycle in several IT contexts
DICE ASICs support several pairs of isochronous packet streaming and
expect software to queue packets with the same timing information into
the same isochronous cycle.
This commit adds structure member to manage the cycle to start
processing packet in several IT contexts. The cycle is decided when
batch of isochronous cycle is skipped in callback to isochronous context
for IRQ target.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210520040154.80450-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu')
-rw-r--r-- | sound/firewire/motu/amdtp-motu.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/firewire/motu/amdtp-motu.c b/sound/firewire/motu/amdtp-motu.c index edb31ac26868..9ccde07d6295 100644 --- a/sound/firewire/motu/amdtp-motu.c +++ b/sound/firewire/motu/amdtp-motu.c @@ -377,8 +377,8 @@ static inline void compute_next_elapse_from_start(struct amdtp_motu *p) p->next_seconds -= 128; } -static void write_sph(struct amdtp_stream *s, __be32 *buffer, - unsigned int data_blocks) +static void write_sph(struct amdtp_stream *s, __be32 *buffer, unsigned int data_blocks, + const unsigned int rx_start_cycle) { struct amdtp_motu *p = s->protocol; unsigned int next_cycles; @@ -386,7 +386,7 @@ static void write_sph(struct amdtp_stream *s, __be32 *buffer, u32 sph; for (i = 0; i < data_blocks; i++) { - next_cycles = (s->start_cycle + p->next_cycles) % 8000; + next_cycles = (rx_start_cycle + p->next_cycles) % 8000; sph = ((next_cycles << 12) | p->next_ticks) & 0x01ffffff; *buffer = cpu_to_be32(sph); @@ -401,6 +401,7 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, unsigned int packets, struct snd_pcm_substream *pcm) { + const unsigned int rx_start_cycle = s->domain->processing_cycle.rx_start; struct amdtp_motu *p = s->protocol; unsigned int pcm_frames = 0; int i; @@ -423,7 +424,7 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, // TODO: how to interact control messages between userspace? - write_sph(s, buf, data_blocks); + write_sph(s, buf, data_blocks, rx_start_cycle); } // For tracepoints. |