mirror of https://github.com/thesofproject/sof.git
ll_schedule: use domain property instead of sync/async flags
Changes ll scheduler implementation to use synchronous property of domain to check if given task should be scheduled synchronously or asynchronously. It makes sense, since it's heavily dependent on particular domain functionality. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
parent
95ba01ebd2
commit
6ffcd61c19
|
@ -57,8 +57,9 @@ struct ll_schedule_domain {
|
|||
|
||||
#define ll_sch_domain_get_pdata(domain) ((domain)->private)
|
||||
|
||||
static inline struct ll_schedule_domain *domain_init(int type, int clk,
|
||||
const struct ll_schedule_domain_ops *ops)
|
||||
static inline struct ll_schedule_domain *domain_init
|
||||
(int type, int clk, bool synchronous,
|
||||
const struct ll_schedule_domain_ops *ops)
|
||||
{
|
||||
struct ll_schedule_domain *domain;
|
||||
|
||||
|
@ -66,6 +67,7 @@ static inline struct ll_schedule_domain *domain_init(int type, int clk,
|
|||
sizeof(*domain));
|
||||
domain->type = type;
|
||||
domain->clk = clk;
|
||||
domain->synchronous = synchronous;
|
||||
domain->ticks_per_ms = clock_ms_to_ticks(clk, 1);
|
||||
domain->ops = ops;
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ struct ll_schedule_domain *dma_multi_chan_domain_init(struct dma *dma_array,
|
|||
trace_ll("dma_multi_chan_domain_init(): num_dma %d, clk %d, "
|
||||
"aggregated_irq %d", num_dma, clk, aggregated_irq);
|
||||
|
||||
domain = domain_init(SOF_SCHEDULE_LL_DMA, clk,
|
||||
domain = domain_init(SOF_SCHEDULE_LL_DMA, clk, true,
|
||||
&dma_multi_chan_domain_ops);
|
||||
|
||||
dma_domain = rzalloc(RZONE_SYS | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
|
||||
|
|
|
@ -494,7 +494,7 @@ struct ll_schedule_domain *dma_single_chan_domain_init(struct dma *dma_array,
|
|||
trace_ll("dma_single_chan_domain_init(): num_dma %d, clk %d", num_dma,
|
||||
clk);
|
||||
|
||||
domain = domain_init(SOF_SCHEDULE_LL_DMA, clk,
|
||||
domain = domain_init(SOF_SCHEDULE_LL_DMA, clk, false,
|
||||
&dma_single_chan_domain_ops);
|
||||
|
||||
dma_domain = rzalloc(RZONE_SYS | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
|
||||
|
|
|
@ -64,7 +64,7 @@ static void schedule_ll_task_update_start(struct ll_schedule_data *sch,
|
|||
|
||||
next = sch->domain->ticks_per_ms * pdata->period / 1000;
|
||||
|
||||
if (task->flags & SOF_SCHEDULE_FLAG_SYNC)
|
||||
if (sch->domain->synchronous)
|
||||
task->start += next;
|
||||
else
|
||||
task->start = next + last_tick;
|
||||
|
@ -275,7 +275,7 @@ static void schedule_ll_task(void *data, struct task *task, uint64_t start,
|
|||
|
||||
task->start = sch->domain->ticks_per_ms * start / 1000;
|
||||
|
||||
if (task->flags & SOF_SCHEDULE_FLAG_SYNC)
|
||||
if (sch->domain->synchronous)
|
||||
task->start += platform_timer_get(platform_timer);
|
||||
else
|
||||
task->start += sch->domain->last_tick;
|
||||
|
@ -362,7 +362,7 @@ static void reschedule_ll_task(void *data, struct task *task, uint64_t start)
|
|||
|
||||
time = sch->domain->ticks_per_ms * start / 1000;
|
||||
|
||||
if (task->flags & SOF_SCHEDULE_FLAG_SYNC)
|
||||
if (sch->domain->synchronous)
|
||||
time += platform_timer_get(platform_timer);
|
||||
else
|
||||
time += sch->domain->last_tick;
|
||||
|
|
|
@ -126,7 +126,8 @@ struct ll_schedule_domain *timer_domain_init(struct timer *timer, int clk,
|
|||
|
||||
trace_ll("timer_domain_init(): clk %d, timeout %u", clk, timeout);
|
||||
|
||||
domain = domain_init(SOF_SCHEDULE_LL_TIMER, clk, &timer_domain_ops);
|
||||
domain = domain_init(SOF_SCHEDULE_LL_TIMER, clk, false,
|
||||
&timer_domain_ops);
|
||||
|
||||
timer_domain = rzalloc(RZONE_SYS | RZONE_FLAG_UNCACHED,
|
||||
SOF_MEM_CAPS_RAM, sizeof(*timer_domain));
|
||||
|
|
Loading…
Reference in New Issue