audio: host-zephyr: add HOST_DMA_IPC_POSITION_UPDATES Kconfig#10849
audio: host-zephyr: add HOST_DMA_IPC_POSITION_UPDATES Kconfig#10849kv2019i wants to merge 1 commit into
Conversation
|
For context, part of #10558 |
There was a problem hiding this comment.
Pull request overview
Adds a Kconfig option to control whether host DMA stream position updates are reported via IPC messages, and uses it to compile-time disable the IPC notification path in the Zephyr host implementation.
Changes:
- Introduce
HOST_DMA_IPC_POSITION_UPDATESKconfig (default enabled for IPC3). - Guard IPC position-update sending (and
ipc_msgallocation/free) inhost-zephyr.cbehind the new Kconfig. - Make
struct host_data::msgconditional onCONFIG_HOST_DMA_IPC_POSITION_UPDATES.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/audio/Kconfig | Adds the new Kconfig switch controlling IPC-based position updates. |
| src/audio/host-zephyr.c | Wraps IPC position update logic and message lifecycle with the new config option. |
| src/audio/copier/host_copier.h | Makes the ipc_msg *msg member conditional on the new config. |
be41a4b to
143d6c2
Compare
|
V2 pushed:
|
| dma_sg_init(&hd->local.elem_array); | ||
|
|
||
| ipc_build_stream_posn(&hd->posn, SOF_IPC_STREAM_POSITION, config_id); | ||
| hd->chan_index = -EINVAL; |
There was a problem hiding this comment.
moving this seems unrelated, any special reason for this?
There was a problem hiding this comment.
Yes, looks like the place after next #endif whould be equivalent to this. I see no reason for moving it either.
jsarha
left a comment
There was a problem hiding this comment.
The moving the chan_index initialization looks unnecessary, but also harmless.
| dma_sg_init(&hd->local.elem_array); | ||
|
|
||
| ipc_build_stream_posn(&hd->posn, SOF_IPC_STREAM_POSITION, config_id); | ||
| hd->chan_index = -EINVAL; |
There was a problem hiding this comment.
Yes, looks like the place after next #endif whould be equivalent to this. I see no reason for moving it either.
Add a built option HOST_DMA_IPC_POSITION_UPDATES to control whether functionality to send IPC stream position updates is enabled or not. Most platforms provide more efficient means for host to monitor DMA state, so this code is in most cases unncessary. The current IPC sending code (from audio context) also assume kernel context, so making this functionality user-space compatible will require extra work. Enable DMA IPC position updates by default for IPC3 as the feature can be controlled by host with sof_ipc_stream_params.no_stream_position IPC interface. Disable the feature by default for IPC4, as there is no host IPC interface to control this and copier_update_params() unconditionally disables IPC updates for IPC4 now, so this code is never used. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
143d6c2 to
7730ace
Compare
|
V3 pushed:
|
Add a built option HOST_DMA_IPC_POSITION_UPDATES to control whether functionality to send IPC stream position updates is enabled or not. Most platforms provide more efficient means for host to monitor DMA state, so this code is in most cases unncessary.
The current IPC sending code (from audio context) also assume kernel context, so making this functionality user-space compatible will require extra work.
Enable DMA IPC position updates by default for IPC3 as the feature can be controlled by host with sof_ipc_stream_params.no_stream_position IPC interface. Disable the feature by default for IPC4, as there is no host IPC interface to control this and copier_update_params() unconditionally disables IPC updates for IPC4 now, so this code is never used.