mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
Merge "ASoC: compr: wake up drain only if it's the last buffer" into audio-drivers.lnx.4.0
This commit is contained in:
commit
2ec178af46
1 changed files with 17 additions and 9 deletions
|
|
@ -825,15 +825,23 @@ static void compr_event_handler(uint32_t opcode,
|
|||
* RESUME
|
||||
*/
|
||||
if ((prtd->copied_total == prtd->bytes_sent) &&
|
||||
atomic_read(&prtd->drain)) {
|
||||
pr_debug("RUN ack, wake up & continue pending drain\n");
|
||||
atomic_read(&prtd->drain)) {
|
||||
bytes_available = prtd->bytes_received - prtd->copied_total;
|
||||
if (bytes_available < cstream->runtime->fragment_size) {
|
||||
pr_debug("%s: RUN ack, wake up & continue pending drain\n",
|
||||
__func__);
|
||||
|
||||
if (prtd->last_buffer)
|
||||
prtd->last_buffer = 0;
|
||||
if (prtd->last_buffer)
|
||||
prtd->last_buffer = 0;
|
||||
|
||||
prtd->drain_ready = 1;
|
||||
wake_up(&prtd->drain_wait);
|
||||
atomic_set(&prtd->drain, 0);
|
||||
prtd->drain_ready = 1;
|
||||
wake_up(&prtd->drain_wait);
|
||||
atomic_set(&prtd->drain, 0);
|
||||
} else if (atomic_read(&prtd->xrun)) {
|
||||
pr_debug("%s: RUN ack, continue write cycle\n", __func__);
|
||||
atomic_set(&prtd->xrun, 0);
|
||||
msm_compr_send_buffer(prtd);
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&prtd->lock, flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue