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
8#ifndef __SOF_SCHEDULE_DP_SCHEDULE_H__
9#define __SOF_SCHEDULE_DP_SCHEDULE_H__
10
11#include <rtos/task.h>
12#include <sof/trace/trace.h>
13#include <user/trace.h>
14#include <stdint.h>
15#include <ipc4/base_fw.h>
16#include <ipc4/module.h>
17#include <ipc4/pipeline.h>
18
19struct processing_module;
20
56
61
75 const struct sof_uuid_entry *uid,
76 const struct task_ops *ops,
77 struct processing_module *mod,
78 uint16_t core,
79 size_t stack_size,
80 uint32_t options);
82
89void scheduler_get_task_info_dp(struct scheduler_props *scheduler_props,
90 uint32_t *data_off_size);
91
92enum {
93 DP_TASK_EVENT_PROCESS = BIT(0), /* Need to process data */
94 DP_TASK_EVENT_CANCEL = BIT(1), /* Thread cancellation */
95 DP_TASK_EVENT_IPC = BIT(2), /* IPC message */
96 DP_TASK_EVENT_IPC_DONE = BIT(3), /* IPC processing has completed. */
97};
98
99struct bind_info;
100struct sof_source;
101struct sof_sink;
102/*
103 * Keeps the scheduler_dp_thread_ipc() flow simple - just one call that does all
104 * the IPC-message specific parameter packing internally. This is slightly
105 * suboptimal because IPC parameters first have to be collected in this
106 * structure and then packed in DP-accessible memory inside
107 * scheduler_dp_thread_ipc(). This could be split into two levels, by adding
108 * IPC-specific functions like ipc_flatten_pipeline_state() and similar, but
109 * that would add multiple functions to the API.
110 */
112 const struct bind_info *bind_data;
113 struct {
114 unsigned int trigger_cmd;
115 enum ipc4_pipeline_state state;
117 struct sof_source **sources;
119 struct sof_sink **sinks;
121};
122
123#if CONFIG_ZEPHYR_DP_SCHEDULER
124int scheduler_dp_thread_ipc(struct processing_module *pmod, unsigned int cmd,
125 const union scheduler_dp_thread_ipc_param *param);
126#else
127static inline int scheduler_dp_thread_ipc(struct processing_module *pmod,
128 unsigned int cmd,
129 const union scheduler_dp_thread_ipc_param *param)
130{
131 return 0;
132}
133#endif
134
135#endif /* __SOF_SCHEDULE_DP_SCHEDULE_H__ */
static int scheduler_dp_thread_ipc(struct processing_module *pmod, unsigned int cmd, const union scheduler_dp_thread_ipc_param *param)
Definition dp_schedule.h:127
@ DP_TASK_EVENT_CANCEL
Definition dp_schedule.h:94
@ DP_TASK_EVENT_PROCESS
Definition dp_schedule.h:93
@ DP_TASK_EVENT_IPC
Definition dp_schedule.h:95
@ DP_TASK_EVENT_IPC_DONE
Definition dp_schedule.h:96
void scheduler_dp_ll_tick(void)
int scheduler_dp_init(void)
DP scheduler is a scheduler that creates a separate preemptible Zephyr thread for each SOF task.
void scheduler_get_task_info_dp(struct scheduler_props *scheduler_props, uint32_t *data_off_size)
Extract information about scheduler's 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 DP task and add it to scheduling It must be called on core the task is declared to run o...
Definition component.h:284
Connects UUID with component description.
Definition uuid.h:77
Task operations.
Definition task.h:49
Task used by schedulers.
Definition task.h:56
Definition dp_schedule.h:111
const struct bind_info * bind_data
Definition dp_schedule.h:112
unsigned int trigger_cmd
Definition dp_schedule.h:114
int n_sinks
Definition dp_schedule.h:118
struct sof_source ** sources
Definition dp_schedule.h:117
struct scheduler_dp_thread_ipc_param::@053035172114074033332357031121234110163265353247 pipeline_state
enum ipc4_pipeline_state state
Definition dp_schedule.h:115
int n_sources
Definition dp_schedule.h:116
struct sof_sink ** sinks
Definition dp_schedule.h:119
#define BIT(b)
Definition bit.h:14