Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305800
b: refs/heads/master
c: 92b862c
h: refs/heads/master
v: v3
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed May 14, 2012
1 parent 6a04f98 commit a5bc6e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9148dddc3c7b6121300319c3e31f9380d459be8
refs/heads/master: 92b862c7d685f5971a954e6ded51891d4adc412b
8 changes: 7 additions & 1 deletion trunk/sound/firewire/amdtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s)
tasklet_kill(&s->period_tasklet);
s->pcm_buffer_pointer = 0;
s->pcm_period_pointer = 0;
s->pointer_flush = true;
}
EXPORT_SYMBOL(amdtp_out_stream_pcm_prepare);

Expand Down Expand Up @@ -393,6 +394,7 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle)
s->pcm_period_pointer += data_blocks;
if (s->pcm_period_pointer >= pcm->runtime->period_size) {
s->pcm_period_pointer -= pcm->runtime->period_size;
s->pointer_flush = false;
tasklet_hi_schedule(&s->period_tasklet);
}
}
Expand Down Expand Up @@ -539,7 +541,11 @@ EXPORT_SYMBOL(amdtp_out_stream_start);
*/
unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s)
{
fw_iso_context_flush_completions(s->context);
/* this optimization is allowed to be racy */
if (s->pointer_flush)
fw_iso_context_flush_completions(s->context);
else
s->pointer_flush = true;

return ACCESS_ONCE(s->pcm_buffer_pointer);
}
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/firewire/amdtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct amdtp_out_stream {

unsigned int pcm_buffer_pointer;
unsigned int pcm_period_pointer;
bool pointer_flush;
};

int amdtp_out_stream_init(struct amdtp_out_stream *s, struct fw_unit *unit,
Expand Down

0 comments on commit a5bc6e3

Please sign in to comment.