buf: remove buffer_acquire/release from buffer.c

remove unnecessary calls from buffer.c/h

this is a continuation of changes
from commit 4a03699911

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
This commit is contained in:
Marcin Szkudlinski 2023-09-07 11:49:44 +02:00 committed by Kai Vehmanen
parent c9e0fc8c9a
commit e4447e272a
2 changed files with 7 additions and 13 deletions

View File

@ -31,7 +31,6 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u
bool is_shared)
{
struct comp_buffer *buffer;
struct comp_buffer *buffer_c;
void *stream_addr;
tr_dbg(&buffer_tr, "buffer_alloc()");
@ -65,14 +64,11 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u
}
/* From here no more uncached access to the buffer object, except its list headers */
buffer_c = buffer_acquire(buffer);
audio_stream_set_addr(&buffer_c->stream, stream_addr);
buffer_init(buffer_c, size, caps);
audio_stream_set_addr(&buffer->stream, stream_addr);
buffer_init(buffer, size, caps);
audio_stream_set_underrun(&buffer_c->stream, !!(flags & SOF_BUF_UNDERRUN_PERMITTED));
audio_stream_set_overrun(&buffer_c->stream, !!(flags & SOF_BUF_OVERRUN_PERMITTED));
buffer_release(buffer_c);
audio_stream_set_underrun(&buffer->stream, !!(flags & SOF_BUF_UNDERRUN_PERMITTED));
audio_stream_set_overrun(&buffer->stream, !!(flags & SOF_BUF_OVERRUN_PERMITTED));
list_init(&buffer->source_list);
list_init(&buffer->sink_list);
@ -203,7 +199,7 @@ void buffer_free(struct comp_buffer *buffer)
notifier_unregister_all(NULL, buffer);
rfree(buffer->stream.addr);
coherent_free_thread(buffer, c);
rfree(buffer);
}
void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes)

View File

@ -249,10 +249,8 @@ void buffer_detach(struct comp_buffer *buffer, struct list_item *head, int dir);
static inline struct comp_dev *buffer_get_comp(struct comp_buffer *buffer, int dir)
{
struct comp_buffer *buffer_c = buffer_acquire(buffer);
struct comp_dev *comp = dir == PPL_DIR_DOWNSTREAM ? buffer_c->sink :
buffer_c->source;
buffer_release(buffer_c);
struct comp_dev *comp = dir == PPL_DIR_DOWNSTREAM ? buffer->sink :
buffer->source;
return comp;
}