Sound Open Firmware
Loading...
Searching...
No Matches
dp_schedule.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright(c) 2023 Intel Corporation. All rights reserved.
4 *
5 * Author: Marcin Szkudlinski
6 */
7
29#ifndef __SOF_SCHEDULE_DP_SCHEDULE_H__
30#define __SOF_SCHEDULE_DP_SCHEDULE_H__
31
32#include <rtos/task.h>
33#include <sof/trace/trace.h>
34#include <user/trace.h>
35#include <stdint.h>
36#include <ipc4/base_fw.h>
37#include <ipc4/module.h>
38#include <ipc4/pipeline.h>
40
47
56
72 const struct sof_uuid_entry *uid,
73 const struct task_ops *ops,
74 struct processing_module *mod,
75 uint16_t core,
76 size_t stack_size,
77 uint32_t options);
78
79#if defined(__ZEPHYR__) && CONFIG_SOF_FULL_ZEPHYR_APPLICATION
84__syscall void scheduler_dp_internal_free(struct task *task);
85
92__syscall void scheduler_dp_ll_tick(void);
93#include <zephyr/syscalls/dp_schedule.h>
94#endif
95
105 uint32_t *data_off_size);
106
110enum {
111 DP_TASK_EVENT_PROCESS = BIT(0), /* Need to process data */
112 DP_TASK_EVENT_CANCEL = BIT(1), /* Thread cancellation */
113 DP_TASK_EVENT_IPC = BIT(2), /* IPC message */
114 DP_TASK_EVENT_IPC_DONE = BIT(3), /* IPC processing has completed. */
115};
116
117struct bind_info;
118struct sof_source;
119struct sof_sink;
120/*
121 * Keeps the scheduler_dp_thread_ipc() flow simple - just one call that does all
122 * the IPC-message specific parameter packing internally. This is slightly
123 * suboptimal because IPC parameters first have to be collected in this
124 * structure and then packed in DP-accessible memory inside
125 * scheduler_dp_thread_ipc(). This could be split into two levels, by adding
126 * IPC-specific functions like ipc_flatten_pipeline_state() and similar, but
127 * that would add multiple functions to the API.
128 */
130 const struct bind_info *bind_data;
131 /* SOF_IPC4_MOD_INIT_INSTANCE: ext_data points to the caller's stack frame and is
132 * only valid until scheduler_dp_thread_ipc() returns; ipc_thread_flatten() copies
133 * it by value into DP-thread-accessible memory before the DP thread runs init().
134 */
136 struct {
137 unsigned int trigger_cmd;
142 struct sof_sink **sinks;
144 struct {
145 uint32_t param_id;
149 const char *data;
151 struct {
152 uint32_t param_id;
153 uint32_t data_offset_size;
154 size_t fragment_size;
155 char *data;
157};
158
170#if CONFIG_ZEPHYR_DP_SCHEDULER
171int scheduler_dp_thread_ipc(struct processing_module *pmod, unsigned int cmd,
172 union scheduler_dp_thread_ipc_param *param);
173#else
174static inline int scheduler_dp_thread_ipc(struct processing_module *pmod,
175 unsigned int cmd,
177{
178 return 0;
179}
180#endif
181
184#endif /* __SOF_SCHEDULE_DP_SCHEDULE_H__ */
IPC4 Base Firmware parameters, memory configuration, and status definitions.
ipc4_pipeline_state
Pipeline operational state machine values.
Definition pipeline.h:51
void scheduler_dp_ll_tick(void)
Tick notification from the Low-Latency (LL) timer domain to the DP scheduler.
int scheduler_dp_init(void)
Initialize the Data Processing (DP) scheduler on the calling core.
void scheduler_get_task_info_dp(struct scheduler_props *scheduler_props, uint32_t *data_off_size)
Extract telemetry information about Data Processing scheduler tasks.
int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid, const struct task_ops *ops, struct processing_module *mod, uint16_t core, size_t stack_size, uint32_t options)
Initialize a Data Processing task and attach a dedicated Zephyr worker thread.
void scheduler_dp_internal_free(struct task *task)
Free kernel-side internal resources associated with a DP task.
static int scheduler_dp_thread_ipc(struct processing_module *pmod, unsigned int cmd, union scheduler_dp_thread_ipc_param *param)
Dispatch an IPC command synchronously to a Data Processing (DP) worker thread.
Definition dp_schedule.h:174
@ DP_TASK_EVENT_CANCEL
Definition dp_schedule.h:112
@ DP_TASK_EVENT_PROCESS
Definition dp_schedule.h:111
@ DP_TASK_EVENT_IPC
Definition dp_schedule.h:113
@ DP_TASK_EVENT_IPC_DONE
Definition dp_schedule.h:114
Dynamic module interface, lifecycle callbacks, and buffer contracts.
module_cfg_fragment_position
Fragment position in config MODULE_CFG_FRAGMENT_FIRST: first fragment of the large configuration MODU...
Definition interface.h:29
IPC4 pipeline creation, states, priorities, and management commands.
IPC4 module instantiation, binding, pin configuration, and parameter definitions.
User-space ABI log levels and binary trace packet header definitions.
Component module binding metadata and endpoint references.
Definition component.h:287
Container for found ext init object pointers This struct contains pointers that point to IPC payload ...
Definition base.h:40
Definition base.h:103
Core scheduler properties and scheduled tasks.
Definition base_fw.h:685
internals of sink API.
Definition sink_api.h:141
internals of source API.
Definition source_api.h:137
Connects UUID with component description.
Definition uuid.h:77
Operations and callbacks associated with a scheduling task.
Definition task.h:72
Core task structure managed by SOF schedulers.
Definition task.h:81
Core task descriptor, task operations, and task execution state machine.
Definition dp_schedule.h:129
const struct module_ext_init_data * ext_data
Definition dp_schedule.h:135
struct scheduler_dp_thread_ipc_param::@157 get_config
const char * data
Definition dp_schedule.h:149
enum module_cfg_fragment_position position
Definition dp_schedule.h:146
size_t fragment_size
Definition dp_schedule.h:148
const struct bind_info * bind_data
Definition dp_schedule.h:130
unsigned int trigger_cmd
Definition dp_schedule.h:137
int n_sinks
Definition dp_schedule.h:141
uint32_t param_id
Definition dp_schedule.h:145
struct scheduler_dp_thread_ipc_param::@155 pipeline_state
struct scheduler_dp_thread_ipc_param::@156 set_config
struct sof_source ** sources
Definition dp_schedule.h:140
uint32_t data_offset_size
Definition dp_schedule.h:147
enum ipc4_pipeline_state state
Definition dp_schedule.h:138
int n_sources
Definition dp_schedule.h:139
char * data
Definition dp_schedule.h:155
struct sof_sink ** sinks
Definition dp_schedule.h:142