-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zephyr: buffer: host: dai: Introduction of functions that allocate a buffer from a range #9145
Conversation
29b0422
to
5453feb
Compare
c9910d0
to
9ca757c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One commit message style comment first, full review coming later.
|
||
/* Align preferred size to a multiple of the minimum size */ | ||
if (preferred_size % minimum_size) | ||
preferred_size += minimum_size - preferred_size % minimum_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
SOFCI TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me.
For the needs of deep buffering, a new functions
buffer_alloc_range
andbuffer_set_size_range
have 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.