Repository navigation
pipeline: dai: dw-dma: adjust flow to more scheduler flexible #1125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -353,8 +353,11 @@ int pipeline_prepare(struct pipeline *p, struct comp_dev *dev) | |
| goto out; | ||
| } | ||
|
|
||
| /* pipeline preload needed only for playback streams */ | ||
| p->preload = dev->params.direction == SOF_IPC_STREAM_PLAYBACK; | ||
| /* pipeline preload needed only for playback streams and capture | ||
| * streams scheduled with timer | ||
| */ | ||
| p->preload = dev->params.direction == SOF_IPC_STREAM_PLAYBACK || | ||
| pipeline_is_timer_driven(p); | ||
| p->status = COMP_STATE_PREPARE; | ||
|
|
||
| out: | ||
|
|
@@ -424,12 +427,12 @@ static void pipeline_comp_trigger_sched_comp(struct pipeline *p, | |
| case COMP_TRIGGER_START: | ||
| p->xrun_bytes = 0; | ||
|
|
||
| /* playback pipelines need scheduled now, capture pipelines are | ||
| * scheduled once their initial DMA period is filled by the DAI | ||
| * or in resume process | ||
| /* playback pipelines need to be scheduled now, | ||
| * capture pipelines are scheduled only for | ||
| * timer driven scheduling | ||
| */ | ||
| if (comp->params.direction == SOF_IPC_STREAM_PLAYBACK || | ||
| p->status == COMP_STATE_PAUSED) { | ||
| pipeline_is_timer_driven(p)) { | ||
| /* schedule initial pipeline fill when next idle */ | ||
| pipeline_schedule_copy_idle(p); | ||
| } | ||
|
|
@@ -596,7 +599,7 @@ static int pipeline_comp_copy(struct comp_dev *current, void *data, int dir) | |
| /* copy to downstream immediately */ | ||
| if (dir == PPL_DIR_DOWNSTREAM) { | ||
| err = comp_copy(current); | ||
| if (err < 0) | ||
| if (err < 0 || err > 0) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if (err > 0 ) then it's copy stop (which is not an error). So we probably want to change this to 0 ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For other operations like params and prepare it's not modified back to 0, so I wanted to stay aligned. Anyway maybe some higher level function will need to know this status in the future and that it was stopped intentionally. |
||
| return err; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering (for a future PR), do we want to define a macro for PIPELINE_COPY_FURTHER_STOP to make it obvious for anyone reading the 1 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was thinking about that and it would also be helpful for things like prepare, so probably I will make a PR with something like PIPELINE_OPERATION_FURTHER_STOP.