Skip to content

Commit 6c29ad3

Browse files
marcinszkudlinskikv2019i
authored andcommitted
buf: fixes for CONFIG_INCOHERENT=0 builds
there's no point with cache writeback/invalidate for coherent architectures. Also the buffer may be set as "shared" at any moment, not only at creation time Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
1 parent 19872fb commit 6c29ad3

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/include/sof/audio/buffer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,18 @@ bool buffer_params_match(struct comp_buffer *buffer,
249249

250250
static inline void buffer_stream_invalidate(struct comp_buffer *buffer, uint32_t bytes)
251251
{
252+
#if CONFIG_INCOHERENT
252253
if (buffer->is_shared)
253254
audio_stream_invalidate(&buffer->stream, bytes);
255+
#endif
254256
}
255257

256258
static inline void buffer_stream_writeback(struct comp_buffer *buffer, uint32_t bytes)
257259
{
260+
#if CONFIG_INCOHERENT
258261
if (buffer->is_shared)
259262
audio_stream_writeback(&buffer->stream, bytes);
263+
#endif
260264
}
261265

262266

src/ipc/ipc-helper.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,12 @@ int comp_buffer_connect(struct comp_dev *comp, uint32_t comp_core,
184184
{
185185
/* check if it's a connection between cores */
186186
if (buffer->core != comp_core) {
187+
#if CONFIG_INCOHERENT
187188
/* buffer must be shared */
188189
assert(buffer->is_shared);
189-
190+
#else
191+
buffer->is_shared = true;
192+
#endif
190193
if (!comp->is_shared)
191194
comp_make_shared(comp);
192195
}

0 commit comments

Comments
 (0)