Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ec178af authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: compr: wake up drain only if it's the last buffer" into audio-drivers.lnx.4.0

parents ea67d09c 7b51a258
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -826,7 +826,10 @@ static void compr_event_handler(uint32_t opcode,
			 */
			if ((prtd->copied_total == prtd->bytes_sent) &&
					atomic_read(&prtd->drain)) {
				pr_debug("RUN ack, wake up & continue pending drain\n");
				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;
@@ -834,6 +837,11 @@ static void compr_event_handler(uint32_t opcode,
					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);