2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 05:34:00 +08:00

[media] v4l: vsp1: Extract pipeline initialization code into a function

The code will be reused outside of vsp1_video.c.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Laurent Pinchart 2015-08-02 17:32:13 -03:00 committed by Mauro Carvalho Chehab
parent 945f127677
commit f294c2f70e
3 changed files with 12 additions and 5 deletions

View File

@ -49,6 +49,16 @@ void vsp1_pipeline_reset(struct vsp1_pipeline *pipe)
pipe->uds = NULL;
}
void vsp1_pipeline_init(struct vsp1_pipeline *pipe)
{
mutex_init(&pipe->lock);
spin_lock_init(&pipe->irqlock);
init_waitqueue_head(&pipe->wq);
INIT_LIST_HEAD(&pipe->entities);
pipe->state = VSP1_PIPELINE_STOPPED;
}
void vsp1_pipeline_run(struct vsp1_pipeline *pipe)
{
struct vsp1_device *vsp1 = pipe->output->entity.vsp1;

View File

@ -67,6 +67,7 @@ static inline struct vsp1_pipeline *to_vsp1_pipeline(struct media_entity *e)
}
void vsp1_pipeline_reset(struct vsp1_pipeline *pipe);
void vsp1_pipeline_init(struct vsp1_pipeline *pipe);
void vsp1_pipeline_run(struct vsp1_pipeline *pipe);
bool vsp1_pipeline_stopped(struct vsp1_pipeline *pipe);

View File

@ -1026,11 +1026,7 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
spin_lock_init(&video->irqlock);
INIT_LIST_HEAD(&video->irqqueue);
mutex_init(&video->pipe.lock);
spin_lock_init(&video->pipe.irqlock);
INIT_LIST_HEAD(&video->pipe.entities);
init_waitqueue_head(&video->pipe.wq);
video->pipe.state = VSP1_PIPELINE_STOPPED;
vsp1_pipeline_init(&video->pipe);
video->pipe.frame_end = vsp1_video_pipeline_frame_end;
/* Initialize the media entity... */