Skip to content

Commit b18bc95

Browse files
author
Jyri Sarha
committed
vregions: mod_alloc: get vregions type from mod_alloc_ctx
Get mod_alloc() vregions vregion_mem_type from struct mod_alloc_ctx. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 1649120 commit b18bc95

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/audio/module_adapter/module/generic.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,18 @@ void *z_impl_mod_alloc_ext(struct processing_module *mod, uint32_t flags, size_t
251251
return NULL;
252252
}
253253

254-
/* Allocate memory for module */
254+
/* Allocate memory for module. Before init completes, use
255+
* lifetime partition so allocations persist across prepare/reset.
256+
*/
255257
void *ptr;
256258

257259
if (!res->alloc->vreg)
258260
ptr = sof_heap_alloc(res->alloc->heap, flags, size, alignment);
259261
else if (flags & SOF_MEM_FLAG_COHERENT)
260-
ptr = vregion_alloc_coherent_align(res->alloc->vreg, VREGION_MEM_TYPE_INTERIM,
262+
ptr = vregion_alloc_coherent_align(res->alloc->vreg, res->alloc->vregion_type,
261263
size, alignment);
262264
else
263-
ptr = vregion_alloc_align(res->alloc->vreg, VREGION_MEM_TYPE_INTERIM,
265+
ptr = vregion_alloc_align(res->alloc->vreg, res->alloc->vregion_type,
264266
size, alignment);
265267

266268
if (!ptr) {

0 commit comments

Comments
 (0)