dma: dma_sg: allocate on specific heap#10729
Open
kv2019i wants to merge 1 commit intothesofproject:mainfrom
Open
dma: dma_sg: allocate on specific heap#10729kv2019i wants to merge 1 commit intothesofproject:mainfrom
kv2019i wants to merge 1 commit intothesofproject:mainfrom
Conversation
Add a heap parameter to DMA scatter-gather allocation interface. This makes it possible to control how allocations are done for the DMA buffers. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Collaborator
Author
|
For context, this is part of #10558 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the DMA scatter-gather (SG) allocation/free interface to accept an explicit Zephyr heap pointer, enabling callers to control which heap backs SG element allocations.
Changes:
- Add
struct k_heap *heapparameter todma_sg_alloc()/dma_sg_free()declarations and definitions. - Switch SG element allocation/free to
sof_heap_alloc()/sof_heap_free()and explicitly zero-initialize the allocated element array. - Update all current call sites to pass
NULLfor the heap (default heap behavior).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
zephyr/include/sof/lib/dma.h |
Updates SG API prototypes to include a heap parameter. |
posix/include/sof/lib/dma.h |
Mirrors the SG API prototype changes for the POSIX build. |
src/lib/dma.c |
Implements heap-aware SG allocation/free using sof_heap_alloc/free and adds explicit zeroing. |
src/trace/dma-trace.c |
Adjusts SG free call to pass NULL heap. |
src/probe/probe.c |
Adjusts SG alloc/free calls to pass NULL heap. |
src/ipc/ipc3/host-page-table.c |
Adjusts SG free call to pass NULL heap on error path. |
src/ipc/ipc3/handler.c |
Adjusts SG free call to pass NULL heap on error path. |
src/audio/host-zephyr.c |
Adjusts SG alloc/free calls to pass NULL heap. |
src/audio/host-legacy.c |
Adjusts SG alloc/free calls to pass NULL heap. |
src/audio/dai-zephyr.c |
Adjusts SG alloc/free calls to pass NULL heap. |
src/audio/dai-legacy.c |
Adjusts SG alloc/free calls to pass NULL heap. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a heap parameter to DMA scatter-gather allocation interface. This makes it possible to control how allocations are done for the DMA buffers.