Commit 617e49d
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 6f4ce36 commit 617e49d
4 files changed
Lines changed: 50 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 | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
199 | | - | |
| 205 | + | |
| 206 | + | |
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
| |||
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
254 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
255 | 280 | | |
256 | 281 | | |
257 | 282 | | |
| |||
310 | 335 | | |
311 | 336 | | |
312 | 337 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | 338 | | |
317 | | - | |
318 | | - | |
319 | 339 | | |
320 | 340 | | |
321 | 341 | | |
| |||
| 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 | + | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
| |||
337 | 348 | | |
338 | 349 | | |
339 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
340 | 355 | | |
341 | 356 | | |
342 | 357 | | |
| |||
| 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