topology: refine scheduling period and add time domain for pipelines

Rename 'deadline' to 'period' to indicate pipeline scheduling period,
and add time domain to indicate the pipeline scheduling domain (e.g. DMA
interrupt, timer interrupt).

Please be noticed that this might introduce an abi change so consequent
abi changes in both FW and driver side are needed.

Haven't set the flag in topology/sof/sof-xxx.m4 yet, that means it will
use io/interrupt scheduling for those topologies/pipelines at the
moment, if wanna to change them, please change them specific there.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Keyon Jie 2019-03-14 22:34:17 +08:00 committed by Liam Girdwood
parent 44705dfc09
commit 0da78d7236
8 changed files with 36 additions and 21 deletions

View File

@ -167,7 +167,7 @@ define(`DAI_CONFIG',
dnl DAI_ADD(pipeline,
dnl pipe id, dai type, dai_index, dai_be,
dnl buffer, periods, format,
dnl frames, deadline, priority, core)
dnl frames, deadline, priority, core, time_domain)
define(`DAI_ADD',
`undefine(`PIPELINE_ID')'
`undefine(`DAI_TYPE')'
@ -180,6 +180,7 @@ define(`DAI_ADD',
`undefine(`SCHEDULE_DEADLINE')'
`undefine(`SCHEDULE_PRIORITY')'
`undefine(`SCHEDULE_CORE')'
`undefine(`SCHEDULE_TIME_DOMAIN')'
`define(`PIPELINE_ID', $2)'
`define(`DAI_TYPE', STR($3))'
`define(`DAI_INDEX', STR($4))'
@ -192,6 +193,7 @@ define(`DAI_ADD',
`define(`SCHEDULE_DEADLINE', $10)'
`define(`SCHEDULE_PRIORITY', $11)'
`define(`SCHEDULE_CORE', $12)'
`define(`SCHEDULE_TIME_DOMAIN', $13)'
`include($1)'
`DEBUG_DAI($3, $4)'
)

View File

@ -1,20 +1,24 @@
divert(-1)
# list of generic scheduling time domains
define(`SCHEDULE_TIME_DOMAIN_DMA', 0)
define(`SCHEDULE_TIME_DOMAIN_TIMER', 1)
dnl Define macro for pipeline widget
dnl Pipeline name)
define(`N_PIPELINE', `PIPELINE.'PIPELINE_ID`.'$1)
dnl W_PIPELINE(stream, deadline, priority, frames, core, timer, platform)
dnl W_PIPELINE(stream, period, priority, frames, core, initiator, platform)
define(`W_PIPELINE',
`SectionVendorTuples."'N_PIPELINE($1)`_tuples" {'
` tokens "sof_sched_tokens"'
` tuples."word" {'
` SOF_TKN_SCHED_DEADLINE' STR($2)
` SOF_TKN_SCHED_PERIOD' STR($2)
` SOF_TKN_SCHED_PRIORITY' STR($3)
` SOF_TKN_SCHED_CORE' STR($5)
` SOF_TKN_SCHED_FRAMES' STR($4)
` SOF_TKN_SCHED_TIMER' STR($6)
` SOF_TKN_SCHED_TIME_DOMAIN' STR($6)
` }'
`}'
`SectionData."'N_PIPELINE($1)`_data" {'
@ -33,24 +37,27 @@ define(`W_PIPELINE',
dnl PIPELINE_PCM_ADD(pipeline,
dnl pipe id, pcm, max channels, format,
dnl frames, deadline, priority, core)
dnl frames, period, priority, core,
dnl time_domain)
define(`PIPELINE_PCM_ADD',
`undefine(`PCM_ID')'
`undefine(`PIPELINE_ID')'
`undefine(`PIPELINE_CHANNELS')'
`undefine(`PIPELINE_FORMAT')'
`undefine(`SCHEDULE_FRAMES')'
`undefine(`SCHEDULE_DEADLINE')'
`undefine(`SCHEDULE_PERIOD')'
`undefine(`SCHEDULE_PRIORITY')'
`undefine(`SCHEDULE_CORE')'
`undefine(`SCHEDULE_TIME_DOMAIN')'
`define(`PIPELINE_ID', $2)'
`define(`PCM_ID', $3)'
`define(`PIPELINE_CHANNELS', $4)'
`define(`PIPELINE_FORMAT', $5)'
`define(`SCHEDULE_FRAMES', $6)'
`define(`SCHEDULE_DEADLINE', $7)'
`define(`SCHEDULE_PERIOD', $7)'
`define(`SCHEDULE_PRIORITY', $8)'
`define(`SCHEDULE_CORE', $9)'
`define(`SCHEDULE_TIME_DOMAIN', $10)'
`define(`DAI_FORMAT', $5)'
`include($1)'
`DEBUG_PCM_ADD($1, $3)'
@ -58,17 +65,19 @@ define(`PIPELINE_PCM_ADD',
dnl PIPELINE_PCM_DAI_ADD(pipeline,
dnl pipe id, pcm, max channels, format,
dnl frames, deadline, priority, core,
dnl dai type, dai_index, dai format, periods)
dnl frames, period, priority, core,
dnl dai type, dai_index, dai format,
dnl periods, time_domain)
define(`PIPELINE_PCM_DAI_ADD',
`undefine(`PCM_ID')'
`undefine(`PIPELINE_ID')'
`undefine(`PIPELINE_CHANNELS')'
`undefine(`PIPELINE_FORMAT')'
`undefine(`SCHEDULE_FRAMES')'
`undefine(`SCHEDULE_DEADLINE')'
`undefine(`SCHEDULE_PERIOD')'
`undefine(`SCHEDULE_PRIORITY')'
`undefine(`SCHEDULE_CORE')'
`undefine(`SCHEDULE_TIME_DOMAIN')'
`undefine(`DAI_TYPE')'
`undefine(`DAI_INDEX')'
`undefine(`DAI_FORMAT')'
@ -78,9 +87,10 @@ define(`PIPELINE_PCM_DAI_ADD',
`define(`PIPELINE_CHANNELS', $4)'
`define(`PIPELINE_FORMAT', $5)'
`define(`SCHEDULE_FRAMES', $6)'
`define(`SCHEDULE_DEADLINE', $7)'
`define(`SCHEDULE_PERIOD', $7)'
`define(`SCHEDULE_PRIORITY', $8)'
`define(`SCHEDULE_CORE', $9)'
`define(`SCHEDULE_TIME_DOMAIN', $14)'
`define(`DAI_TYPE', STR($10))'
`define(`DAI_INDEX', STR($11))'
`define(`DAI_FORMAT', $12)'
@ -91,22 +101,25 @@ define(`PIPELINE_PCM_DAI_ADD',
dnl PIPELINE_ADD(pipeline,
dnl pipe id, max channels, format,
dnl frames, deadline, priority, core, sched_comp)
dnl frames, period, priority, core,
dnl sched_comp, time_domain)
define(`PIPELINE_ADD',
`undefine(`PIPELINE_ID')'
`undefine(`PIPELINE_CHANNELS')'
`undefine(`PIPELINE_FORMAT')'
`undefine(`SCHEDULE_FRAMES')'
`undefine(`SCHEDULE_DEADLINE')'
`undefine(`SCHEDULE_PERIOD')'
`undefine(`SCHEDULE_PRIORITY')'
`undefine(`SCHEDULE_CORE')'
`undefine(`SCHEDULE_TIME_DOMAIN')'
`define(`PIPELINE_ID', $2)'
`define(`PIPELINE_CHANNELS', $3)'
`define(`PIPELINE_FORMAT', $4)'
`define(`SCHEDULE_FRAMES', $5)'
`define(`SCHEDULE_DEADLINE', $6)'
`define(`SCHEDULE_PERIOD', $6)'
`define(`SCHEDULE_PRIORITY', $7)'
`define(`SCHEDULE_CORE', $8)'
`define(`SCHEDULE_TIME_DOMAIN', $10)'
`define(`SCHED_COMP', $9)'
`include($1)'
)

View File

@ -13,7 +13,7 @@ W_DAI_IN(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 2, 0, 0)
#
# DAI pipeline - always use 0 for DAIs
#
W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
W_PIPELINE(N_DAI_IN, SCHEDULE_PERIOD, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, SCHEDULE_TIME_DOMAIN, pipe_dai_schedule_plat)
#
# Graph connections to pipelines

View File

@ -13,7 +13,7 @@ W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2)
#
# DAI pipeline - always use 0 for DAIs
#
W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
W_PIPELINE(N_DAI_OUT, SCHEDULE_PERIOD, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, SCHEDULE_TIME_DOMAIN, pipe_dai_schedule_plat)
#
# Graph connections to pipelines

View File

@ -62,7 +62,7 @@ VIRTUAL_WIDGET(DETECT SINK PIPELINE_ID, out_drv, PIPELINE_ID)
# Pipeline
dnl W_PIPELINE(stream, deadline, priority, frames, core, timer, platform)
W_PIPELINE(SCHED_COMP, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_media_schedule_plat)
W_PIPELINE(SCHED_COMP, SCHEDULE_PERIOD, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, SCHEDULE_TIME_DOMAIN, pipe_media_schedule_plat)
#
# Pipeline Graph

View File

@ -86,7 +86,7 @@ indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2))
# Pipeline Configuration.
#
W_PIPELINE(N_SRC(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 1, pipe_media_schedule_plat)
W_PIPELINE(N_SRC(0), SCHEDULE_PERIOD, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, SCHEDULE_TIME_DOMAIN, pipe_media_schedule_plat)
#
# PCM Configuration

View File

@ -77,4 +77,4 @@ indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1))
# Pipeline Configuration.
#
W_PIPELINE(N_TONE(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_tone_schedule_plat)
W_PIPELINE(N_TONE(0), SCHEDULE_DEADLINE, SCHEDULE_PERIOD, SCHEDULE_FRAMES, SCHEDULE_CORE, SCHEDULE_TIME_DOMAIN, pipe_tone_schedule_plat)

View File

@ -23,12 +23,12 @@ SectionVendorTokens."sof_dai_tokens" {
}
SectionVendorTokens."sof_sched_tokens" {
SOF_TKN_SCHED_DEADLINE "200"
SOF_TKN_SCHED_PERIOD "200"
SOF_TKN_SCHED_PRIORITY "201"
SOF_TKN_SCHED_MIPS "202"
SOF_TKN_SCHED_CORE "203"
SOF_TKN_SCHED_FRAMES "204"
SOF_TKN_SCHED_TIMER "205"
SOF_TKN_SCHED_TIME_DOMAIN "205"
}
SectionVendorTokens."sof_volume_tokens" {