get/set_configuration from DP "application" context - #11199
Conversation
Make ipc4_process_large_config_get() static, it's only called once in the same file where it's defined. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Remove "const" from the "param" argument of scheduler_dp_thread_ipc() - some of the wrapped methods have to modify it. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
No need to split module freeing code between module_free() and module_adapter_free(), merge it back together. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use MAILBOX_HOSTBOX_SIZE to map the mailbox. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
3d8aed0 to
00a1c82
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical configuration dispatch, pointer-type, and allocation-error issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (3)
What changed in this PR
Adds application-context DP support for module get_configuration()/set_configuration() operations, including IPC, buffering, and memory-allocation updates.
Changes:
- Adds DP configuration IPC payloads and buffering.
- Routes configuration and lifecycle operations through the DP scheduler.
- Updates data-blob allocation contexts and userspace large-config handling.
| File | Summary |
|---|---|
src/schedule/zephyr_dp_schedule.h |
Adds DP configuration buffer state. |
src/schedule/zephyr_dp_schedule_application.c |
Implements configuration IPC and buffering; contains pointer-type and allocation-error handling issues. |
src/ipc/ipc4/handler-user.c |
Restricts large-configuration handling to LL userspace. |
src/include/sof/schedule/dp_schedule.h |
Defines configuration IPC parameters. |
src/include/sof/audio/data_blob.h |
Updates allocator callback signatures. |
src/include/ipc4/handler.h |
Removes the obsolete handler declaration. |
src/audio/module_adapter/module/generic.c |
Routes DP lifecycle operations. |
src/audio/module_adapter/module_adapter.c |
Updates DP cleanup handling. |
src/audio/module_adapter/module_adapter_ipc4.c |
Routes large configuration through DP; GET dispatch and return handling require correction. |
src/audio/data_blob.c |
Uses module-context allocation and freeing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
With the "application" version of the DP scheduler individual module adapter methods are offloaded to the userspace thread context. Add two more methods to the offloaded set: get_configuration() and set_configuration(). Note, thet get_configuration() also requires copying data back to the coller, which until now wasn't done. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
It is unclear in which context buffer binding should be executed when an LL and a DP modules are being bound with both running in userspace context. Since DP modules have limited visibility into the system and the userspace LL context on the other hand has access to most DP assets, perform binding and unbinding in LL thread context. Add comments to explain that. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
DP modules cannot access the common userspace heap, to fix data blob allocations for them those allocations have to use sof_ctx_alloc() and sof_ctx_free() to eventually allocate memory on module accessible vregion. Note, that we cannot use mod_alloc() and mod_free() because data-blob allocations are already accounted as module resources, so doing so would lead to double accounting and eventual double freeing. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
kv2019i
left a comment
There was a problem hiding this comment.
One question inline, but not a blocker and rest seems good.
| comp_dbg(dev, "start"); | ||
|
|
||
| #if CONFIG_SOF_USERSPACE_APPLICATION | ||
| if (dev->task) |
There was a problem hiding this comment.
Hmm, this "if (dev->task)" check is removed. On purpose?
There was a problem hiding this comment.
@kv2019i yes, the freeing is moved / consolidated above. And there it's guaranteed that it's a DP task. And DP tasks always have their dev->task pointers set. In fact here it was indeed a crude check for a DP task.

Add support for
get_configuration()andset_configuration()for DP modules when run by the "application" DP implementation