mirror of https://github.com/thesofproject/sof.git
dai: fix getting DW-DMA copy size for DMA_CB_TYPE_LLIST
Fixes DW-DMA copy size calculations for transfers, which are not using auto reloadable linked lists. They require manual linked list reload to update current position, so it should happen before call to DMA copy. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
parent
4aee58f6cb
commit
7b7e15d678
|
@ -100,8 +100,9 @@ static void dai_buffer_process(struct comp_dev *dev, struct dma_sg_elem *next)
|
|||
|
||||
tracev_dai_with_ids(dev, "dai_buffer_process()");
|
||||
|
||||
/* reload lli by default */
|
||||
next->size = DMA_RELOAD_LLI;
|
||||
/* reload lli if the last callback wasn't of llist type */
|
||||
next->size = dd->cb_type == DMA_CB_TYPE_LLIST ? DMA_RELOAD_IGNORE :
|
||||
DMA_RELOAD_LLI;
|
||||
|
||||
/* stop dma copy for pause/stop/xrun */
|
||||
if (dev->state != COMP_STATE_ACTIVE || dd->xrun) {
|
||||
|
@ -171,11 +172,15 @@ static void dai_dma_cb(void *data, uint32_t type, struct dma_sg_elem *next)
|
|||
|
||||
switch (type) {
|
||||
case DMA_CB_TYPE_BLOCK:
|
||||
case DMA_CB_TYPE_LLIST:
|
||||
dd->cb_type = type;
|
||||
next->size = DMA_RELOAD_IGNORE;
|
||||
pipeline_schedule_copy(dev->pipeline, 0);
|
||||
break;
|
||||
case DMA_CB_TYPE_LLIST:
|
||||
dd->cb_type = type;
|
||||
next->size = DMA_RELOAD_LLI;
|
||||
pipeline_schedule_copy(dev->pipeline, 0);
|
||||
break;
|
||||
case DMA_CB_TYPE_PROCESS:
|
||||
dai_buffer_process(dev, next);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue