zephyr: buffer: host: dai: Introduction of functions that allocate a buffer from a range#9145
Merged
kv2019i merged 5 commits intothesofproject:mainfrom Jun 25, 2024
Merged
Conversation
lyakh
reviewed
May 22, 2024
29b0422 to
5453feb
Compare
2 tasks
lgirdwood
reviewed
May 22, 2024
c9910d0 to
9ca757c
Compare
kv2019i
reviewed
May 23, 2024
Collaborator
kv2019i
left a comment
There was a problem hiding this comment.
One commit message style comment first, full review coming later.
lyakh
reviewed
May 24, 2024
|
|
||
| /* Align preferred size to a multiple of the minimum size */ | ||
| if (preferred_size % minimum_size) | ||
| preferred_size += minimum_size - preferred_size % minimum_size; |
Collaborator
There was a problem hiding this comment.
in fact wondering, whether it would be better to align down? Doesn't seem important though
Change name of the buffer_init to buffer_init_stream because it is only responsible for initiating a stream. Omit the caps parameter because it is only assigned to a structure field. Assign this field in the function caller. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Move part of the code responsible for initializing the buffer structure to the new function buffer_alloc_struct, which will also be used by a new buffer allocation function. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Add two new buffer allocation functions buffer_set_size_range and buffer_alloc_range dedicated to deep buffering. They try to allocate the largest possible buffer according to the suggested size. If this size cannot be obtained, it will be reduced step by step until it reaches the minimum size. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Change buffer allocation functions to buffer_alloc_range and buffer_set_size_range. This makes it possible to allocate the buffer even if the suggested size given in ipc cannot be met. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Change buffer allocation functions to buffer_alloc_range and buffer_set_size_range. This makes it possible to allocate the buffer even if the suggested size given in ipc cannot be met. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
pjdobrowolski
approved these changes
Jun 18, 2024
Collaborator
Author
|
SOFCI TEST |
tobonex
approved these changes
Jun 25, 2024
kv2019i
approved these changes
Jun 25, 2024
Collaborator
kv2019i
left a comment
There was a problem hiding this comment.
Thanks, looks good to me.
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.
For the needs of deep buffering, a new functions
buffer_alloc_rangeandbuffer_set_size_rangehave been added that allocate a buffer with a size given as a range. The suggested buffer size coming from ipc doesn't have to be met if there is not enough memory. It is then reduced step by step until it reaches its minimum size. These functions were used in dai and host.