[Sound-open-firmware] [PATCH] pipeline: static: move static buffer sizes out of platform header
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/pipeline_static.c | 8 ++++++++ src/platform/baytrail/include/platform/platform.h | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/audio/pipeline_static.c b/src/audio/pipeline_static.c index d52afda..d08bb98 100644 --- a/src/audio/pipeline_static.c +++ b/src/audio/pipeline_static.c @@ -45,6 +45,14 @@ #include <reef/audio/component.h> #include <reef/audio/pipeline.h>
+ +/* 2 * 32 bit*/ +#define PLATFORM_INT_FRAME_SIZE 8 +/* 2 * 16 bit*/ +#define PLATFORM_HOST_FRAME_SIZE 4 +/* 2 * 24 (32) bit*/ +#define PLATFORM_DAI_FRAME_SIZE 8 + /* * Static Buffer Convenience Constructors. */ diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index 8dac653..222ffd2 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -67,13 +67,6 @@ struct reef; #define PLATFORM_MAX_CHANNELS 4 #define PLATFORM_MAX_STREAMS 5
-/* TODO: get this from IPC - 2 * 32 bit*/ -#define PLATFORM_INT_FRAME_SIZE 8 -/* TODO: get this from IPC - 2 * 16 bit*/ -#define PLATFORM_HOST_FRAME_SIZE 4 -/* TODO: get this from IPC - 2 * 24 (32) bit*/ -#define PLATFORM_DAI_FRAME_SIZE 8 - /* Platform Host DMA buffer config - these should align with DMA engine */ #define PLAT_HOST_PERIOD_FRAMES 48 /* must be multiple of DMA burst size */ #define PLAT_HOST_PERIODS 2 /* give enough latency for DMA refill */
Move all the static scheduling params out of the platform headers and into the static pipeline source as they are no longer used by dynamic pipeline code.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/dai.c | 2 +- src/audio/pipeline.c | 6 +++--- src/audio/pipeline_static.c | 13 +++++++++++++ src/include/reef/audio/pipeline.h | 3 +-- src/platform/baytrail/include/platform/platform.h | 13 ------------- 5 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/src/audio/dai.c b/src/audio/dai.c index 8c2f0f5..518836a 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -146,7 +146,7 @@ static void dai_dma_cb(void *data, uint32_t type, struct dma_sg_elem *next) }
/* notify pipeline that DAI needs it's buffer processed */ - pipeline_schedule_copy(dev->pipeline, dev, PLAT_DAI_SCHED, TASK_PRI_HIGH); + pipeline_schedule_copy(dev->pipeline, dev);
next_copy:
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index e3fdff6..5674877 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -703,10 +703,10 @@ static int pipeline_copy_to_downstream(struct comp_dev *start, }
/* notify pipeline that this component requires buffers emptied/filled */ -void pipeline_schedule_copy(struct pipeline *p, struct comp_dev *dev, - uint32_t deadline, uint32_t priority) +void pipeline_schedule_copy(struct pipeline *p, struct comp_dev *dev) { - schedule_task(&p->pipe_task, deadline, priority, dev); + schedule_task(&p->pipe_task, p->ipc_pipe.deadline, + p->ipc_pipe.priority, dev); schedule(); }
diff --git a/src/audio/pipeline_static.c b/src/audio/pipeline_static.c index d08bb98..9723718 100644 --- a/src/audio/pipeline_static.c +++ b/src/audio/pipeline_static.c @@ -53,6 +53,19 @@ /* 2 * 24 (32) bit*/ #define PLATFORM_DAI_FRAME_SIZE 8
+/* Platform Host DMA buffer config - these should align with DMA engine */ +#define PLAT_HOST_PERIOD_FRAMES 48 /* must be multiple of DMA burst size */ +#define PLAT_HOST_PERIODS 2 /* give enough latency for DMA refill */ + +/* Platform Dev DMA buffer config - these should align with DMA engine */ +#define PLAT_DAI_PERIOD_FRAMES 48 /* must be multiple of DMA+DEV burst size */ +#define PLAT_DAI_PERIODS 2 /* give enough latency for DMA refill */ +#define PLAT_DAI_SCHED 1000 /* scheduling time in usecs */ + +/* Platform internal buffer config - these should align with DMA engine */ +#define PLAT_INT_PERIOD_FRAMES 48 /* must be multiple of DMA+DEV burst size */ +#define PLAT_INT_PERIODS 2 /* give enough latency for DMA refill */ + /* * Static Buffer Convenience Constructors. */ diff --git a/src/include/reef/audio/pipeline.h b/src/include/reef/audio/pipeline.h index 37af714..8e029d8 100644 --- a/src/include/reef/audio/pipeline.h +++ b/src/include/reef/audio/pipeline.h @@ -108,8 +108,7 @@ int init_static_pipeline(struct ipc *ipc); /* pipeline creation */ int init_pipeline(void);
-void pipeline_schedule_copy(struct pipeline *p, struct comp_dev *dev, - uint32_t deadline, uint32_t priority); +void pipeline_schedule_copy(struct pipeline *p, struct comp_dev *dev);
void pipeline_schedule(void *arg);
diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index 222ffd2..7eadb8b 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -67,19 +67,6 @@ struct reef; #define PLATFORM_MAX_CHANNELS 4 #define PLATFORM_MAX_STREAMS 5
-/* Platform Host DMA buffer config - these should align with DMA engine */ -#define PLAT_HOST_PERIOD_FRAMES 48 /* must be multiple of DMA burst size */ -#define PLAT_HOST_PERIODS 2 /* give enough latency for DMA refill */ - -/* Platform Dev DMA buffer config - these should align with DMA engine */ -#define PLAT_DAI_PERIOD_FRAMES 48 /* must be multiple of DMA+DEV burst size */ -#define PLAT_DAI_PERIODS 2 /* give enough latency for DMA refill */ -#define PLAT_DAI_SCHED 1000 /* scheduling time in usecs */ - -/* Platform internal buffer config - these should align with DMA engine */ -#define PLAT_INT_PERIOD_FRAMES 48 /* must be multiple of DMA+DEV burst size */ -#define PLAT_INT_PERIODS 2 /* give enough latency for DMA refill */ - #define PLATFORM_SCHED_CLOCK CLK_SSP
#define PLATFORM_NUM_MMAP_POSN 10
Move the platform SSP configs into a the static pipeline
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/pipeline_static.c | 6 ++++++ src/platform/baytrail/include/platform/platform.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/audio/pipeline_static.c b/src/audio/pipeline_static.c index 9723718..b6f17ae 100644 --- a/src/audio/pipeline_static.c +++ b/src/audio/pipeline_static.c @@ -66,6 +66,12 @@ #define PLAT_INT_PERIOD_FRAMES 48 /* must be multiple of DMA+DEV burst size */ #define PLAT_INT_PERIODS 2 /* give enough latency for DMA refill */
+/* default static pipeline SSP port - not used for dynamic pipes */ +#define PLATFORM_SSP_PORT 2 + +/* default SSP stream format - need aligned with codec setting*/ +#define PLATFORM_SSP_STREAM_FORMAT SOF_IPC_FRAME_S24_4LE + /* * Static Buffer Convenience Constructors. */ diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index 7eadb8b..fb1537a 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -38,12 +38,6 @@
struct reef;
-/* default static pipeline SSP port - not used for dynamic pipes */ -#define PLATFORM_SSP_PORT 2 - -/* default SSP stream format - need aligned with codec setting*/ -#define PLATFORM_SSP_STREAM_FORMAT SOF_IPC_FRAME_S24_4LE - /* IPC Interrupt */ #define PLATFORM_IPC_INTERUPT IRQ_NUM_EXT_IA
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/platform/baytrail/include/platform/platform.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index fb1537a..493afd8 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -61,12 +61,10 @@ struct reef; #define PLATFORM_MAX_CHANNELS 4 #define PLATFORM_MAX_STREAMS 5
+/* clock source used by scheduler for deadline calculations */ #define PLATFORM_SCHED_CLOCK CLK_SSP
-#define PLATFORM_NUM_MMAP_POSN 10 -#define PLATFORM_NUM_MMAP_VOL 10 - -/* DMA channel drain timeout in microseconds */ +/* DMA channel drain timeout in microseconds - TODO: caclulate based on topology */ #define PLATFORM_DMA_TIMEOUT 1333
/* IPC page data copy timeout */ @@ -75,12 +73,6 @@ struct reef; /* WorkQ window size in microseconds */ #define PLATFORM_WORKQ_WINDOW 2000
-/* Host finish work schedule delay in microseconds */ -#define PLATFORM_HOST_FINISH_DELAY 100 - -/* Host finish work(drain from host to dai) timeout in microseconds */ -#define PLATFORM_HOST_FINISH_TIMEOUT 50000 - /* Platform defined panic code */ #define platform_panic(__x) \ shim_write(SHIM_IPCXL, ((shim_read(SHIM_IPCXL) & 0xc0000000) |\
Host DMA needs it's own timeout as its not bound to any synchronous data transfer timings.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/host.c | 2 +- src/ipc/intel-ipc.c | 2 +- src/platform/baytrail/include/platform/platform.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/audio/host.c b/src/audio/host.c index c1c7485..944edfe 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -451,7 +451,7 @@ static int host_preload(struct comp_dev *dev) wait_init(&hd->complete);
/* do DMA transfer */ - hd->complete.timeout = PLATFORM_DMA_TIMEOUT; + hd->complete.timeout = PLATFORM_HOST_DMA_TIMEOUT; dma_set_config(hd->dma, hd->chan, &hd->config); dma_start(hd->dma, hd->chan);
diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index f1e06e9..d122b30 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -140,7 +140,7 @@ static int get_page_descriptors(struct intel_ipc_data *iipc, dma_start(dma, chan);
/* wait for DMA to complete */ - iipc->complete.timeout = PLATFORM_IPC_DMA_TIMEOUT; + iipc->complete.timeout = PLATFORM_HOST_DMA_TIMEOUT; ret = wait_for_completion_timeout(&iipc->complete);
/* compressed page tables now in buffer at _ipc->page_table */ diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index 493afd8..d083479 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -67,8 +67,8 @@ struct reef; /* DMA channel drain timeout in microseconds - TODO: caclulate based on topology */ #define PLATFORM_DMA_TIMEOUT 1333
-/* IPC page data copy timeout */ -#define PLATFORM_IPC_DMA_TIMEOUT 2000 +/* DMA host transfer timeouts in microseconds */ +#define PLATFORM_HOST_DMA_TIMEOUT 50
/* WorkQ window size in microseconds */ #define PLATFORM_WORKQ_WINDOW 2000
participants (1)
-
Liam Girdwood