Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
DP: more preparation for application-level user-space (part 4.2 of #10287)#10446
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
e0c9ca76aab3ad81cc5ec9ed84ffc52447ebc2a3a1399afcbFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -159,7 +159,7 @@ static void comp_buffer_free(struct sof_audio_buffer *audio_buffer) | ||
| notifier_unregister_all(NULL, buffer); | ||
| rfree(buffer->stream.addr); | ||
| rfree(buffer); | ||
| sof_heap_free(buffer->audio_buffer.heap, buffer); | ||
| } | ||
| APP_TASK_DATA static const struct source_ops comp_buffer_source_ops = { | ||
| @@ -189,7 +189,8 @@ static const struct audio_buffer_ops audio_buffer_ops = { | ||
| .set_alignment_constants = comp_buffer_set_alignment_constants, | ||
| }; | ||
| static struct comp_buffer *buffer_alloc_struct(void *stream_addr, size_t size, | ||
| static struct comp_buffer *buffer_alloc_struct(struct k_heap *heap, | ||
| void *stream_addr, size_t size, | ||
| uint32_t flags, bool is_shared) | ||
| { | ||
| struct comp_buffer *buffer; | ||
| @@ -200,13 +201,14 @@ static struct comp_buffer *buffer_alloc_struct(void *stream_addr, size_t size, | ||
| if (is_shared) | ||
| flags |= SOF_MEM_FLAG_COHERENT; | ||
| buffer = rzalloc(flags, sizeof(*buffer)); | ||
| buffer = sof_heap_alloc(heap, flags, sizeof(*buffer), 0); | ||
| if (!buffer) { | ||
| tr_err(&buffer_tr, "could not alloc structure"); | ||
| return NULL; | ||
| } | ||
| memset(buffer, 0, sizeof(*buffer)); | ||
| buffer->flags = flags; | ||
| /* Force channels to 2 for init to prevent bad call to clz in buffer_init_stream */ | ||
| buffer->stream.runtime_stream_params.channels = 2; | ||
| @@ -221,14 +223,15 @@ static struct comp_buffer *buffer_alloc_struct(void *stream_addr, size_t size, | ||
| audio_stream_set_underrun(&buffer->stream, !!(flags & SOF_BUF_UNDERRUN_PERMITTED)); | ||
| audio_stream_set_overrun(&buffer->stream, !!(flags & SOF_BUF_OVERRUN_PERMITTED)); | ||
| buffer->audio_buffer.heap = heap; | ||
| comp_buffer_reset_source_list(buffer); | ||
| comp_buffer_reset_sink_list(buffer); | ||
| return buffer; | ||
| } | ||
| struct comp_buffer *buffer_alloc(size_t size, uint32_t flags, uint32_t align, | ||
| struct comp_buffer *buffer_alloc(struct k_heap *heap, size_t size, uint32_t flags, uint32_t align, | ||
| bool is_shared) | ||
| { | ||
| struct comp_buffer *buffer; | ||
| @@ -249,7 +252,7 @@ struct comp_buffer *buffer_alloc(size_t size, uint32_t flags, uint32_t align, | ||
| return NULL; | ||
| } | ||
| buffer = buffer_alloc_struct(stream_addr, size, flags, is_shared); | ||
| buffer = buffer_alloc_struct(heap, stream_addr, size, flags, is_shared); | ||
| if (!buffer) { | ||
| tr_err(&buffer_tr, "could not alloc buffer structure"); | ||
| rfree(stream_addr); | ||
| @@ -258,7 +261,8 @@ struct comp_buffer *buffer_alloc(size_t size, uint32_t flags, uint32_t align, | ||
| return buffer; | ||
| } | ||
| struct comp_buffer *buffer_alloc_range(size_t preferred_size, size_t minimum_size, | ||
| struct comp_buffer *buffer_alloc_range(struct k_heap *heap, size_t preferred_size, | ||
| size_t minimum_size, | ||
| uint32_t flags, uint32_t align, bool is_shared) | ||
| { | ||
| struct comp_buffer *buffer; | ||
| @@ -292,7 +296,7 @@ struct comp_buffer *buffer_alloc_range(size_t preferred_size, size_t minimum_siz | ||
| return NULL; | ||
| } | ||
| buffer = buffer_alloc_struct(stream_addr, size, flags, is_shared); | ||
| buffer = buffer_alloc_struct(heap, stream_addr, size, flags, is_shared); | ||
| if (!buffer) { | ||
| tr_err(&buffer_tr, "could not alloc buffer structure"); | ||
| rfree(stream_addr); | ||
lyakh marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -376,7 +376,15 @@ static uintptr_t lib_manager_allocate_module(const struct sof_man_module *mod, | ||||||
| return 0; | ||||||
| } | ||||||
| int lib_manager_free_module(const uint32_t component_id) | ||||||
| /* | ||||||
| * \brief Free module | ||||||
| * | ||||||
| * param[in] component_id - component id coming from ipc config. This function reguires valid | ||||||
CopilotAI | ||||||
| *param[in] component_id-componentidcomingfromipcconfig. Thisfunctionreguiresvalid | |
| *param[in] component_id-componentidcomingfromipcconfig. Thisfunctionrequiresvalid |
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.
Lets fix incrementally
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.