Commit ae1199e
Jyri Sarha
pipeline: allocate shared vregion for LL modules
Create a per-pipeline vregion in pipeline_new() when the IPC4 pipeline
extension payload specifies lifetime or interim heap sizes. The vregion
size is the sum of both. Store the vregion pointer in struct pipeline.
In module_adapter_new_ext() resolve the pipeline pointer before
module_adapter_mem_alloc() so the pipeline's vregion can be passed
down. LL modules on a pipeline with a vregion use it as their
allocation backend via vregion_get(), instead of the driver's default
heap. DP modules continue to create their own per-module vregion.
Call vregion_set_interim() for the pipeline vregion in
pipeline_complete() to switch the allocator to interim mode after all
lifetime allocations are done.
Release the pipeline vregion with vregion_put() in ipc_pipeline_free()
before calling pipeline_free(). Warn if the refcount does not reach
zero, indicating a module still holds a reference.
Also fix a pre-existing leak in module_adapter_mem_free(): always free
the per-module mod_alloc_ctx for LL modules regardless of the vregion
refcount, since alloc is allocated from the system heap, not from the
vregion.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>1 parent 7f5fc11 commit ae1199e
4 files changed
Lines changed: 55 additions & 8 deletions
File tree
- src
- audio
- module_adapter
- pipeline
- include/sof/audio
- ipc/ipc4
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
207 | | - | |
| 213 | + | |
| 214 | + | |
208 | 215 | | |
209 | 216 | | |
210 | 217 | | |
| |||
258 | 265 | | |
259 | 266 | | |
260 | 267 | | |
261 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
262 | 287 | | |
263 | 288 | | |
264 | 289 | | |
| |||
317 | 342 | | |
318 | 343 | | |
319 | 344 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | 345 | | |
324 | | - | |
325 | | - | |
326 | 346 | | |
327 | 347 | | |
328 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
138 | 154 | | |
139 | 155 | | |
140 | 156 | | |
| |||
337 | 353 | | |
338 | 354 | | |
339 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
340 | 360 | | |
341 | 361 | | |
342 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
516 | 521 | | |
517 | 522 | | |
518 | 523 | | |
| |||
0 commit comments