@@ -134,54 +134,52 @@ struct comp_buffer {
134134 uint32_t core ;
135135 struct tr_ctx tctx ; /* trace settings */
136136
137- /* connected components */
138- struct comp_dev * source ; /* source component */
139- struct comp_dev * sink ; /* sink component */
140-
141- /* lists */
142- struct list_item source_list ; /* list in comp buffers */
143- struct list_item sink_list ; /* list in comp buffers */
144-
145137 /* list of buffers, to be used i.e. in raw data processing mode*/
146138 struct list_item buffers_list ;
147139};
148140
149141/*
150142 * get a component providing data to the buffer
151143 */
144+ //msz
152145static inline struct comp_dev * comp_buffer_get_source_component (const struct comp_buffer * buffer )
153146{
154- return buffer -> source ;
147+ return audio_buffer_get_source_component ( & buffer -> audio_buffer ) ;
155148}
156149
157150/*
158151 * get a component consuming data from the buffer
159152 */
153+ //msz
160154static inline struct comp_dev * comp_buffer_get_sink_component (const struct comp_buffer * buffer )
161155{
162- return buffer -> sink ;
156+ return audio_buffer_get_sink_component ( & buffer -> audio_buffer ) ;
163157}
164158
159+ //msz
165160static inline
166161void comp_buffer_set_source_component (struct comp_buffer * buffer , struct comp_dev * comp )
167162{
168- buffer -> source = comp ;
163+ audio_buffer_set_source_component ( & buffer -> audio_buffer , comp ) ;
169164}
170165
171166static inline
172- void comp_buffer_set_sink_component ( struct comp_buffer * buffer , struct comp_dev * comp )
167+ struct comp_buffer * comp_buffer_from_audio_buffer ( struct sof_audio_buffer * audio_buffer )
173168{
174- buffer -> sink = comp ;
169+ return container_of ( audio_buffer , struct comp_buffer , audio_buffer ) ;
175170}
176171
177- static inline void comp_buffer_reset_source_list (struct comp_buffer * buffer )
172+ static inline
173+ void comp_buffer_set_sink_component (struct comp_buffer * buffer , struct comp_dev * comp )
178174{
179- list_init (& buffer -> source_list );
175+ audio_buffer_set_sink_component (& buffer -> audio_buffer , comp );
180176}
181177
182- static inline void comp_buffer_reset_sink_list (struct comp_buffer * buffer )
178+ static inline
179+ struct comp_buffer * buffer_from_list (struct list_item * ptr , int dir )
183180{
184- list_init (& buffer -> sink_list );
181+ struct sof_audio_buffer * audio_buffer = audio_buffer_from_list (ptr , dir );
182+ return comp_buffer_from_audio_buffer (audio_buffer );
185183}
186184
187185/* Only to be used for synchronous same-core notifications! */
@@ -195,11 +193,6 @@ struct buffer_cb_free {
195193 struct comp_buffer * buffer ;
196194};
197195
198- #define buffer_from_list (ptr , dir ) \
199- ((dir) == PPL_DIR_DOWNSTREAM ? \
200- container_of(ptr, struct comp_buffer, source_list) : \
201- container_of(ptr, struct comp_buffer, sink_list))
202-
203196#define buffer_set_cb (buffer , func , data , type ) \
204197 do { \
205198 buffer->cb = func; \
@@ -270,23 +263,6 @@ static inline void buffer_stream_writeback(struct comp_buffer *buffer, uint32_t
270263#endif
271264}
272265
273-
274- /*
275- * Attach a new buffer at the beginning of the list. Note, that "head" must
276- * really be the head of the list, not a list head within another buffer. We
277- * don't synchronise its cache, so it must not be embedded in an object, using
278- * the coherent API. The caller takes care to protect list heads.
279- */
280- void buffer_attach (struct comp_buffer * buffer , struct list_item * head , int dir );
281-
282- /*
283- * Detach a buffer from anywhere in the list. "head" is again the head of the
284- * list, we need it to verify, whether this buffer was the first or the last on
285- * the list. Again it is assumed that the head's cache doesn't need to be
286- * synchronized. The caller takes care to protect list heads.
287- */
288- void buffer_detach (struct comp_buffer * buffer , struct list_item * head , int dir );
289-
290266static inline struct comp_dev * buffer_get_comp (struct comp_buffer * buffer , int dir )
291267{
292268 struct comp_dev * comp = (dir == PPL_DIR_DOWNSTREAM ) ?
0 commit comments