Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/audio/copier/copier.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <rtos/interrupt.h>
#include <sof/ipc/msg.h>
#include <sof/ipc/topology.h>
#include <sof/schedule/ll_schedule_domain.h>
#include <rtos/interrupt.h>
Comment on lines 13 to 17

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not part of this PR.

#include <rtos/timer.h>
#include <rtos/cache.h>
Expand Down Expand Up @@ -838,7 +839,9 @@ __cold static int set_chmap(struct comp_dev *dev, const void *data, size_t data_
pcm_converter_func process;
pcm_converter_func converters[IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT];
int i;
#ifndef CONFIG_SOF_USERSPACE_LL
uint32_t irq_flags;
#endif

assert_can_be_cold();

Expand Down Expand Up @@ -892,15 +895,26 @@ __cold static int set_chmap(struct comp_dev *dev, const void *data, size_t data_
}
}

/* Atomically update chmap, process and converters */
/* Atomically update chmap, process and converters.
* In user-space builds irq_local_disable() is privileged,
* use the LL scheduler lock instead.
*/
#ifdef CONFIG_SOF_USERSPACE_LL
user_ll_lock_sched(dev->pipeline->core);
#else
irq_local_disable(irq_flags);
#endif

cd->dd[0]->chmap = chmap_cfg->channel_map;
cd->dd[0]->process = process;
for (i = 0; i < IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT; i++)
cd->converter[i] = converters[i];

#ifdef CONFIG_SOF_USERSPACE_LL
user_ll_unlock_sched(dev->pipeline->core);
#else
irq_local_enable(irq_flags);
#endif

return 0;
}
Expand Down
Loading