mirror of https://github.com/thesofproject/sof.git
pipeline: add function for checking pipe execution core
Extracts check whether the pipeline should be executed on the current core to separate method. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
parent
f14a8a7049
commit
4563f2c12d
|
@ -191,7 +191,7 @@ static int idc_pipeline_trigger(uint32_t cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check whether we are executing from the right core */
|
/* check whether we are executing from the right core */
|
||||||
if (arch_cpu_get_id() != pcm_dev->cd->pipeline->ipc_pipe.core)
|
if (!pipeline_is_this_cpu(pcm_dev->cd->pipeline))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* trigger pipeline */
|
/* trigger pipeline */
|
||||||
|
@ -232,7 +232,7 @@ static int idc_component_command(uint32_t cmd)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* check whether we are executing from the right core */
|
/* check whether we are executing from the right core */
|
||||||
if (arch_cpu_get_id() != comp_dev->cd->pipeline->ipc_pipe.core)
|
if (!pipeline_is_this_cpu(comp_dev->cd->pipeline))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* execute component command */
|
/* execute component command */
|
||||||
|
|
|
@ -608,7 +608,7 @@ int pipeline_trigger(struct pipeline *p, struct comp_dev *host, int cmd)
|
||||||
trace_pipe_with_ids(p, "pipeline_trigger()");
|
trace_pipe_with_ids(p, "pipeline_trigger()");
|
||||||
|
|
||||||
/* if current core is different than requested */
|
/* if current core is different than requested */
|
||||||
if (p->ipc_pipe.core != cpu_get_id())
|
if (!pipeline_is_this_cpu(p))
|
||||||
return pipeline_trigger_on_core(p, host, cmd);
|
return pipeline_trigger_on_core(p, host, cmd);
|
||||||
|
|
||||||
/* handle pipeline global checks before going into each components */
|
/* handle pipeline global checks before going into each components */
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#ifndef __SOF_AUDIO_PIPELINE_H__
|
#ifndef __SOF_AUDIO_PIPELINE_H__
|
||||||
#define __SOF_AUDIO_PIPELINE_H__
|
#define __SOF_AUDIO_PIPELINE_H__
|
||||||
|
|
||||||
|
#include <sof/lib/cpu.h>
|
||||||
#include <sof/schedule/task.h>
|
#include <sof/schedule/task.h>
|
||||||
#include <sof/spinlock.h>
|
#include <sof/spinlock.h>
|
||||||
#include <sof/trace/trace.h>
|
#include <sof/trace/trace.h>
|
||||||
|
@ -114,6 +115,12 @@ static inline bool pipeline_is_timer_driven(struct pipeline *p)
|
||||||
return p->ipc_pipe.time_domain == SOF_TIME_DOMAIN_TIMER;
|
return p->ipc_pipe.time_domain == SOF_TIME_DOMAIN_TIMER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* checks if pipeline is scheduled on this core */
|
||||||
|
static inline bool pipeline_is_this_cpu(struct pipeline *p)
|
||||||
|
{
|
||||||
|
return p->ipc_pipe.core == cpu_get_id();
|
||||||
|
}
|
||||||
|
|
||||||
/* pipeline creation and destruction */
|
/* pipeline creation and destruction */
|
||||||
struct pipeline *pipeline_new(struct sof_ipc_pipe_new *pipe_desc,
|
struct pipeline *pipeline_new(struct sof_ipc_pipe_new *pipe_desc,
|
||||||
struct comp_dev *cd);
|
struct comp_dev *cd);
|
||||||
|
|
Loading…
Reference in New Issue