Commit 8df0d155 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld
Browse files

media: staging: rkisp1: cap: support simultanous streaming



support simultanous streaming by enabeling the subdevices
only until the isp if the other is already streaming.
Signed-off-by: Dafna Hirschfeld's avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
parent 7914bd42
......@@ -839,7 +839,8 @@ static void rkisp1_return_all_buffers(struct rkisp1_capture *cap,
*
* If the until argument isn't NULL, stop the pipeline walk when reaching the
* until entity. This is used to disable a partially started pipeline due to a
* subdev start error.
* subdev start error, or if we want to stream from one capture when the
* other is already streaming.
*/
static int rkisp1_pipeline_sink_walk(struct media_entity *from,
struct media_entity *until,
......@@ -916,12 +917,22 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue)
struct rkisp1_capture *cap = queue->drv_priv;
struct rkisp1_vdev_node *node = &cap->vnode;
struct rkisp1_device *rkisp1 = cap->rkisp1;
struct rkisp1_capture *other = &rkisp1->capture_devs[cap->id ^ 1];
struct media_entity *until_entity = NULL;
int ret;
mutex_lock(&cap->rkisp1->stream_lock);
rkisp1_stream_stop(cap);
ret = rkisp1_pipeline_sink_walk(&node->vdev.entity, NULL,
/*
* if the other capture streams then we should disable
* only until the isp subdev
*/
if (other->is_streaming)
until_entity = &rkisp1->isp.sd.entity;
ret = rkisp1_pipeline_sink_walk(&node->vdev.entity, until_entity,
rkisp1_pipeline_disable_cb);
if (ret)
dev_err(rkisp1->dev,
......@@ -983,6 +994,8 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
{
struct rkisp1_capture *cap = queue->drv_priv;
struct media_entity *entity = &cap->vnode.vdev.entity;
struct media_entity *until_entity = NULL;
struct rkisp1_capture *other = &cap->rkisp1->capture_devs[cap->id ^ 1];
int ret;
mutex_lock(&cap->rkisp1->stream_lock);
......@@ -1010,8 +1023,14 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
rkisp1_stream_start(cap);
/* if the other capture already streams then we should only
* start stream until the isp subdev
*/
if (other->is_streaming)
until_entity = &cap->rkisp1->isp.sd.entity;
/* start sub-devices */
ret = rkisp1_pipeline_sink_walk(entity, NULL,
ret = rkisp1_pipeline_sink_walk(entity, until_entity,
rkisp1_pipeline_enable_cb);
if (ret)
goto err_stop_stream;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment