Skip to content

audio: module-adapter: make generic code compatible with user-space#10950

Open
kv2019i wants to merge 2 commits into
thesofproject:mainfrom
kv2019i:202606-module-adapt-userspace
Open

audio: module-adapter: make generic code compatible with user-space#10950
kv2019i wants to merge 2 commits into
thesofproject:mainfrom
kv2019i:202606-module-adapt-userspace

Conversation

@kv2019i

@kv2019i kv2019i commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Series of patches to make generic module code safe to use from user-space.

Copilot AI review requested due to automatic review settings June 22, 2026 12:53
@kv2019i

kv2019i commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

For context, part of #10558

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make generic module-adapter and data blob handling code safe/usable from user-space contexts by switching allocations to user-safe heap APIs and threading a heap choice through the data blob handler creation path.

Changes:

  • Extend comp_data_blob_handler_new_ext() with an optional struct k_heap *heap parameter and update the default wrapper.
  • Update generic module configuration/runtime allocations to use sof_heap_alloc()/sof_heap_free() (with sof_sys_user_heap_get()).
  • Pass the module allocator heap into comp_data_blob_handler_new_ext() from mod_data_blob_handler_new().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/include/sof/audio/data_blob.h Extends blob handler constructor API with an optional heap parameter and updates the inline wrapper.
src/audio/module_adapter/module/generic.c Replaces config/runtime rballoc/rfree usage with sof_heap_alloc/sof_heap_free and passes allocator heap into blob handler creation.
src/audio/data_blob.c Stores heap in the handler, allocates/frees handler via heap when provided, and adds “default heap” alloc/free helpers.

Comment thread src/audio/data_blob.c Outdated
Comment thread src/include/sof/audio/data_blob.h Outdated
kv2019i added 2 commits June 22, 2026 19:28
Use user-space friendy sof_heap_alloc() for dynamic allocations
in data_blob handler.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Replace direct rballoc() and rfree() calls with sof_heap_alloc()
and sof_heap_free(), and use sof_sys_user_heap_get() as the heap.
This makes the code ready to be used in user-space, including
module prepare and free stages.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i force-pushed the 202606-module-adapt-userspace branch from 82045ae to dfc1660 Compare June 22, 2026 16:29
@kv2019i

kv2019i commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

V2 pushed:

  • simplify the changes to comp_data_blob_handler_new_ext(), the 3rd commit can be dropped

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants