audio: buffer: replace notifier events with direct probe callbacks#10720
audio: buffer: replace notifier events with direct probe callbacks#10720kv2019i wants to merge 1 commit intothesofproject:mainfrom
Conversation
Replace the generic notifier dispatch for buffer produce, consume, and free events with direct function pointer callbacks on struct comp_buffer. The only consumer of this notifier event has been probe.c, so there is really no need to use the notifier framework for this. This change allows to run more audio modules in user-space, where the notifier framework is not available. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
|
Tested as part of bigger #10558 |
jsarha
left a comment
There was a problem hiding this comment.
I think this is quite Ok, It actually makes the functionality easier to understand. But I would still remove the idle cast.
| &probe_cb_produce, 0); | ||
| notifier_register(&new_buf_id->full_id, dev->cb, NOTIFIER_ID_BUFFER_FREE, | ||
| &probe_cb_free, 0); | ||
| struct comp_buffer *probe_buf = (struct comp_buffer *)dev->cb; |
There was a problem hiding this comment.
This cast should not be needed. struct ipc_comp_dev ->cb should be already of struct comp_buffer type. Actually the cast makes the code harder to understand. For awhile I was thinking that some call-back is used in hackis way for something else.
|
|
||
| void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes) | ||
| { | ||
| struct buffer_cb_transact cb_data = { |
There was a problem hiding this comment.
If I am not mistaken, here was some piece of code for injection points. That was never functional, so I guess it can go.
lyakh
left a comment
There was a problem hiding this comment.
you could also mention in the commit message, that this is valid, because the notification currently is always directed to the same core
Replace the generic notifier dispatch for buffer produce, consume, and free events with direct function pointer callbacks on struct comp_buffer. The only consumer of this notifier event has been probe.c, so there is really no need to use the notifier framework for this.
This change allows to run more audio modules in user-space, where the notifier framework is not available.