Skip to content

Commit 9a37637

Browse files
committed
hda-dma: wait for buffer full after starting render
Host DMA should wait for buffer full after starting render to avoid empty samples at the beginning. Temporary solution until DMA unified flow will be implemented. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
1 parent fa48c42 commit 9a37637

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/drivers/hda-dma.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ static int hda_dma_start(struct dma *dma, int channel)
212212

213213
/* full buffer is copied at startup */
214214
p->chan[channel].desc_avail = p->chan[channel].desc_count;
215+
216+
/* for render let's wait for buffer full */
217+
if (p->chan[channel].direction == DMA_DIR_HMEM_TO_LMEM) {
218+
do {
219+
idelay(PLATFORM_DEFAULT_DELAY);
220+
dgcs = host_dma_reg_read(dma, channel, DGCS);
221+
} while (!(dgcs & DGCS_BF));
222+
}
215223
out:
216224
spin_unlock_irq(&dma->lock, flags);
217225
return ret;

0 commit comments

Comments
 (0)