Skip to content

Commit 875620a

Browse files
committed
WIP: pipeline: pacovr: Add support for pacovr allocations per pipeline
Allocate a PACOVR on pipeline construction and destroy PACOVR on pipeline destruction. TODO: get the static/dynamic heap sizes from topology. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 7821809 commit 875620a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/audio/pipeline/pipeline-graph.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <rtos/interrupt.h>
1313
#include <rtos/symbol.h>
1414
#include <sof/lib/mm_heap.h>
15+
#include <sof/lib/pacovr.h>
1516
#include <sof/lib/uuid.h>
1617
#include <sof/compiler_attributes.h>
1718
#include <sof/list.h>
@@ -127,6 +128,18 @@ struct pipeline *pipeline_new(uint32_t pipeline_id, uint32_t priority, uint32_t
127128
return NULL;
128129
}
129130

131+
#if CONFIG_SOF_PACOVR
132+
/* create a pacovr region for all resources */
133+
// TODO: make batch and scratch sizes configurable from topology
134+
size_t scratch_size = 0x4000; /* 16kB scratch */
135+
size_t batch_size = 0x20000; /* 128kB batch */
136+
p->pacovr = pacovr_create(batch_size, scratch_size);
137+
if (!p->pacovr) {
138+
pipe_err(p, "pipeline_new(): pacovr_create() failed.");
139+
goto free;
140+
}
141+
#endif
142+
130143
/* init pipeline */
131144
p->comp_id = comp_id;
132145
p->priority = priority;
@@ -236,6 +249,10 @@ int pipeline_free(struct pipeline *p)
236249

237250
pipeline_posn_offset_put(p->posn_offset);
238251

252+
#if CONFIG_SOF_PACOVR
253+
/* free pacovr region */
254+
pacovr_destroy(p->pacovr);
255+
#endif
239256
/* now free the pipeline */
240257
rfree(p);
241258

src/include/sof/audio/pipeline.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <sof/lib/cpu.h>
1212
#include <sof/lib/mailbox.h>
13+
#include <sof/lib/pacovr.h>
1314
#include <sof/list.h>
1415
#include <rtos/task.h>
1516
#include <rtos/sof.h>
@@ -64,6 +65,9 @@ struct pipeline {
6465
uint32_t time_domain; /**< scheduling time domain */
6566
uint32_t attributes; /**< pipeline attributes from IPC extension msg/ */
6667

68+
/* pipeline resource management */
69+
struct pacovr *pacovr;
70+
6771
/* runtime status */
6872
int32_t xrun_bytes; /* last xrun length */
6973
uint32_t status; /* pipeline status */

0 commit comments

Comments
 (0)