Sound Open Firmware
Loading...
Searching...
No Matches
pipeline.h File Reference
Include dependency graph for pipeline.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pipeline
struct  pipeline_walk_context
struct  pipeline_data
struct  pipeline_task
 Task type registered by pipelines. More...
struct  create_pipeline_params
 For storing IPC payload data. More...

Macros

#define PPL_STATUS_PATH_STOP   1
#define PPL_STATUS_PATH_TERMINATE   2
#define PPL_STATUS_SCHEDULED   2
#define PPL_CONN_DIR_COMP_TO_BUFFER   0
#define PPL_CONN_DIR_BUFFER_TO_COMP   1
#define PPL_DIR_DOWNSTREAM   0
#define PPL_DIR_UPSTREAM   1
#define pipeline_task_get(t)

Functions

struct pipeline * pipeline_new (struct k_heap *heap, uint32_t pipeline_id, uint32_t priority, uint32_t comp_id, struct create_pipeline_params *pparams)
 Creates a new pipeline.
int pipeline_free (struct pipeline *p)
 Free's a pipeline.
int pipeline_connect (struct comp_dev *comp, struct comp_buffer *buffer, int dir)
 Connect components in a pipeline.
void pipeline_disconnect (struct comp_dev *comp, struct comp_buffer *buffer, int dir)
 Creates a new pipeline.
int pipeline_complete (struct pipeline *p, struct comp_dev *source, struct comp_dev *sink)
 Completes a pipeline.
void pipeline_posn_init (struct sof *sof)
 Initializes pipeline position structure.
int pipeline_reset (struct pipeline *p, struct comp_dev *host_cd)
 Resets the pipeline and free runtime resources.
int pipeline_for_each_comp (struct comp_dev *current, struct pipeline_walk_context *ctx, int dir)
 Walks the pipeline graph for each component.
struct comp_dev * pipeline_get_dai_comp (uint32_t pipeline_id, int dir)
 Walks pipeline graph to find dai component.
static uint32_t pipeline_id (struct pipeline *p)
 Retrieves pipeline id from pipeline.
int pipeline_params (struct pipeline *p, struct comp_dev *cd, struct sof_ipc_pcm_params *params)
 Creates a new pipeline.
int pipeline_prepare (struct pipeline *p, struct comp_dev *cd)
 Prepares pipeline for processing.
int pipeline_trigger (struct pipeline *p, struct comp_dev *host, int cmd)
 Trigger pipeline - IPC context.
int pipeline_trigger_run (struct pipeline *p, struct comp_dev *host, int cmd)
 Trigger pipeline - either IPC or pipeline task context.
int pipeline_copy (struct pipeline *p)
 Copy data along a pipeline.
void pipeline_get_timestamp (struct pipeline *p, struct comp_dev *host_dev, struct sof_ipc_stream_posn *posn)
 Get time pipeline timestamps from host to dai.
static bool pipeline_is_same_sched_comp (struct pipeline *current, struct pipeline *previous)
 Checks if two pipelines have the same scheduling component.
static bool pipeline_is_timer_driven (struct pipeline *p)
 Is pipeline is scheduled with timer.
static bool pipeline_is_this_cpu (struct pipeline *p)
 Is pipeline is scheduled on this core.
int pipeline_comp_ll_task_init (struct pipeline *p)
 Init an LL task for a pipeline.
void pipeline_comp_ll_task_free (struct pipeline *p)
 Free the LL tasks owned by a pipeline.
int pipeline_comp_dp_task_init (struct comp_dev *comp)
 Init a DP task for a component.
void pipeline_schedule_copy (struct pipeline *p, uint64_t start)
 Schedule a pipeline copy to run after a delay.
void pipeline_comp_trigger_sched_comp (struct pipeline *p, struct comp_dev *comp, struct pipeline_walk_context *ctx)
 Trigger pipeline's scheduling component.
void pipeline_schedule_triggered (struct pipeline_walk_context *ctx, int cmd)
 Schedule all triggered pipelines.
void pipeline_schedule_config (struct pipeline *p, uint32_t sched_id, uint32_t core, uint32_t period, uint32_t period_mips, uint32_t frames_per_sched, uint32_t time_domain)
 Configure pipeline scheduling.
int pipeline_xrun_recover (struct pipeline *p)
 Recover the pipeline from a XRUN condition.
int pipeline_xrun_handle_trigger (struct pipeline *p, int cmd)
 Perform xrun recovery.
void pipeline_xrun (struct pipeline *p, struct comp_dev *dev, int32_t bytes)
 notify host that we have XRUN.
int pipeline_xrun_set_limit (struct pipeline *p, uint32_t xrun_limit_usecs)
 Set tolerance for pipeline xrun handling.
void pipeline_comp_copy_error_notify (const struct comp_dev *component, int error_code)
 Sends an ipc notification that an error occurred in the module's processing function.

Macro Definition Documentation

◆ pipeline_task_get

#define pipeline_task_get ( t)
Value:
#define container_of(ptr, type, member)
Definition common.h:119
Task type registered by pipelines.
Definition pipeline.h:136
Task used by schedulers.
Definition task.h:56

◆ PPL_CONN_DIR_BUFFER_TO_COMP

#define PPL_CONN_DIR_BUFFER_TO_COMP   1

◆ PPL_CONN_DIR_COMP_TO_BUFFER

#define PPL_CONN_DIR_COMP_TO_BUFFER   0

◆ PPL_DIR_DOWNSTREAM

#define PPL_DIR_DOWNSTREAM   0

◆ PPL_DIR_UPSTREAM

#define PPL_DIR_UPSTREAM   1

◆ PPL_STATUS_PATH_STOP

#define PPL_STATUS_PATH_STOP   1

◆ PPL_STATUS_PATH_TERMINATE

#define PPL_STATUS_PATH_TERMINATE   2

◆ PPL_STATUS_SCHEDULED

#define PPL_STATUS_SCHEDULED   2

Function Documentation

◆ pipeline_comp_copy_error_notify()

void pipeline_comp_copy_error_notify ( const struct comp_dev * component,
int error_code )

Sends an ipc notification that an error occurred in the module's processing function.

Parameters
[in]componentThe component in which the error occurred.
[in]error_codeError code.

◆ pipeline_comp_dp_task_init()

int pipeline_comp_dp_task_init ( struct comp_dev * comp)

Init a DP task for a component.

Parameters
[in]compa component the task is created for
Returns
0 on success.

◆ pipeline_comp_ll_task_free()

void pipeline_comp_ll_task_free ( struct pipeline * p)

Free the LL tasks owned by a pipeline.

Parameters
[in]ppipeline.

◆ pipeline_comp_ll_task_init()

int pipeline_comp_ll_task_init ( struct pipeline * p)

Init an LL task for a pipeline.

Parameters
[in]ppipeline.
Returns
0 on success.

◆ pipeline_comp_trigger_sched_comp()

void pipeline_comp_trigger_sched_comp ( struct pipeline * p,
struct comp_dev * comp,
struct pipeline_walk_context * ctx )

Trigger pipeline's scheduling component.

Parameters
[in]ppipeline.
[in,out]compPipeline component device.
[in]ctxPipeline graph walk context.

◆ pipeline_complete()

int pipeline_complete ( struct pipeline * p,
struct comp_dev * source,
struct comp_dev * sink )

Completes a pipeline.

Parameters
[in]ppipeline.
[in]sourcePipeline component device.
[in]sinkPipeline component device.
Returns
0 on success.

◆ pipeline_connect()

int pipeline_connect ( struct comp_dev * comp,
struct comp_buffer * buffer,
int dir )

Connect components in a pipeline.

Parameters
[in]compconnecting component.
[in]bufferconnecting buffer.
[in]dirConnection direction.
Returns
0 on success.

◆ pipeline_copy()

int pipeline_copy ( struct pipeline * p)

Copy data along a pipeline.

Parameters
[in]ppipeline.
Returns
0 on success.

◆ pipeline_disconnect()

void pipeline_disconnect ( struct comp_dev * comp,
struct comp_buffer * buffer,
int dir )

Creates a new pipeline.

Parameters
[in]compconnecting component.
[in]bufferconnecting buffer.
[in]dirConnection direction.

◆ pipeline_for_each_comp()

int pipeline_for_each_comp ( struct comp_dev * current,
struct pipeline_walk_context * ctx,
int dir )

Walks the pipeline graph for each component.

Parameters
[in]currentCurrent pipeline component.
[in]ctxPipeline graph walk context.
[in]dirWalk direction.
Returns
0 on success.

◆ pipeline_free()

int pipeline_free ( struct pipeline * p)

Free's a pipeline.

Parameters
[in]ppipeline.
Returns
0 on success.

◆ pipeline_get_dai_comp()

struct comp_dev * pipeline_get_dai_comp ( uint32_t pipeline_id,
int dir )

Walks pipeline graph to find dai component.

Parameters
[in]pipeline_idis the start pipeline id.
[in]diris the direction of the traversal.
Returns
dai component.

◆ pipeline_get_timestamp()

void pipeline_get_timestamp ( struct pipeline * p,
struct comp_dev * host_dev,
struct sof_ipc_stream_posn * posn )

Get time pipeline timestamps from host to dai.

Parameters
[in]ppipeline.
[in]host_devHost DMA component.
[in,out]posnPipeline stream position.

◆ pipeline_id()

uint32_t pipeline_id ( struct pipeline * p)
inlinestatic

Retrieves pipeline id from pipeline.

Parameters
ppipeline.
Returns
pipeline id.

◆ pipeline_is_same_sched_comp()

bool pipeline_is_same_sched_comp ( struct pipeline * current,
struct pipeline * previous )
inlinestatic

Checks if two pipelines have the same scheduling component.

Parameters
[in]currentThis pipeline.
[in]previousOther pipeline.
Returns
true if both pipelines are scheduled together.

◆ pipeline_is_this_cpu()

bool pipeline_is_this_cpu ( struct pipeline * p)
inlinestatic

Is pipeline is scheduled on this core.

Parameters
[in]ppipeline.
Returns
true if pipeline core ID == current core ID.

◆ pipeline_is_timer_driven()

bool pipeline_is_timer_driven ( struct pipeline * p)
inlinestatic

Is pipeline is scheduled with timer.

Parameters
[in]ppipeline.
Returns
true if pipeline uses timer based scheduling.

◆ pipeline_new()

struct pipeline * pipeline_new ( struct k_heap * heap,
uint32_t pipeline_id,
uint32_t priority,
uint32_t comp_id,
struct create_pipeline_params * pparams )

Creates a new pipeline.

Parameters
[in]heapHeap to allocate the pipeline on, or NULL for default.
[in]pipeline_idPipeline ID number.
[in]priorityPipeline scheduling priority.
[in]comp_idPipeline component ID number.
[in]pparamsPipeline parameters from IPC payload, maybe NULL.
Returns
New pipeline pointer or NULL.

◆ pipeline_params()

int pipeline_params ( struct pipeline * p,
struct comp_dev * cd,
struct sof_ipc_pcm_params * params )

Creates a new pipeline.

Parameters
[in]ppipeline.
[in]cdPipeline component device.
[in]paramsPipeline parameters.
Returns
0 on success.

◆ pipeline_posn_init()

void pipeline_posn_init ( struct sof * sof)

Initializes pipeline position structure.

Parameters
[in,out]sofPointer to sof structure.

◆ pipeline_prepare()

int pipeline_prepare ( struct pipeline * p,
struct comp_dev * cd )

Prepares pipeline for processing.

Parameters
[in]ppipeline.
[in,out]cdPipeline component device.
Returns
0 on success.

◆ pipeline_reset()

int pipeline_reset ( struct pipeline * p,
struct comp_dev * host_cd )

Resets the pipeline and free runtime resources.

Parameters
[in]ppipeline.
[in]host_cdHost DMA component device.
Returns
0 on success.

◆ pipeline_schedule_config()

void pipeline_schedule_config ( struct pipeline * p,
uint32_t sched_id,
uint32_t core,
uint32_t period,
uint32_t period_mips,
uint32_t frames_per_sched,
uint32_t time_domain )

Configure pipeline scheduling.

Parameters
[in]ppipeline.
[in]sched_idScheduling component ID.
[in]coreDSP core pipeline runs on.
[in]periodPipeline scheduling period in us.
[in]period_mipsPipeline worst case MCPS per period.
[in]frames_per_schedPipeline frames processed per schedule.
[in]time_domainPipeline scheduling time domain.

◆ pipeline_schedule_copy()

void pipeline_schedule_copy ( struct pipeline * p,
uint64_t start )

Schedule a pipeline copy to run after a delay.

Parameters
[in]ppipeline.
[in]startPipeline start time in microseconds.

◆ pipeline_schedule_triggered()

void pipeline_schedule_triggered ( struct pipeline_walk_context * ctx,
int cmd )

Schedule all triggered pipelines.

Parameters
[in]ctxPipeline graph walk context.
[in]cmdTrigger command.

◆ pipeline_trigger()

int pipeline_trigger ( struct pipeline * p,
struct comp_dev * host,
int cmd )

Trigger pipeline - IPC context.

Parameters
[in]ppipeline.
[in]hostHost DMA component.
[in]cmdPipeline trigger command.
Returns
0 on success.

◆ pipeline_trigger_run()

int pipeline_trigger_run ( struct pipeline * p,
struct comp_dev * host,
int cmd )

Trigger pipeline - either IPC or pipeline task context.

Parameters
[in]ppipeline.
[in]hostHost DMA component.
[in]cmdPipeline trigger command.
Returns
0 on success.

◆ pipeline_xrun()

void pipeline_xrun ( struct pipeline * p,
struct comp_dev * dev,
int32_t bytes )

notify host that we have XRUN.

Parameters
[in]ppipeline.
[in]devPipeline component device.
[in]bytesNumber of bytes we have over or under run.

◆ pipeline_xrun_handle_trigger()

int pipeline_xrun_handle_trigger ( struct pipeline * p,
int cmd )

Perform xrun recovery.

Parameters
[in]ppipeline.
[in]cmdTrigger command.
Returns
0 on success.

◆ pipeline_xrun_recover()

int pipeline_xrun_recover ( struct pipeline * p)

Recover the pipeline from a XRUN condition.

Parameters
[in]ppipeline.
Returns
0 on success.

◆ pipeline_xrun_set_limit()

int pipeline_xrun_set_limit ( struct pipeline * p,
uint32_t xrun_limit_usecs )

Set tolerance for pipeline xrun handling.

Parameters
[in]ppipeline.
[in]xrun_limit_usecsLimit in micro secs that pipeline will tolerate.