summaryrefslogtreecommitdiff
path: root/drivers/staging/media/omap4iss/iss_video.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2015-12-16 16:32:33 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 17:19:21 +0300
commit6246b2a7ad1ffab5a712c38005b668f3e4ca2825 (patch)
treebcd22814c4febb9da302a707f4f85948534b86ef /drivers/staging/media/omap4iss/iss_video.c
parentad92b5cf35adc2d3ec0116f4744561d5405a0db7 (diff)
downloadlinux-6246b2a7ad1ffab5a712c38005b668f3e4ca2825.tar.xz
[media] staging: v4l: omap4iss: Use media entity enumeration interface
Instead of using a bitmap directly in a driver, use the new media entity enumeration interface to perform the same. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/staging/media/omap4iss/iss_video.c')
-rw-r--r--drivers/staging/media/omap4iss/iss_video.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
index 8c6af412bc16..5f8201f861bc 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -749,7 +749,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
struct iss_video_fh *vfh = to_iss_video_fh(fh);
struct iss_video *video = video_drvdata(file);
struct media_entity_graph graph;
- struct media_entity *entity;
+ struct media_entity *entity = &video->video.entity;
enum iss_pipeline_state state;
struct iss_pipeline *pipe;
struct iss_video *far_end;
@@ -764,24 +764,26 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
/* Start streaming on the pipeline. No link touching an entity in the
* pipeline can be activated or deactivated once streaming is started.
*/
- pipe = video->video.entity.pipe
- ? to_iss_pipeline(&video->video.entity) : &video->pipe;
+ pipe = entity->pipe
+ ? to_iss_pipeline(entity) : &video->pipe;
pipe->external = NULL;
pipe->external_rate = 0;
pipe->external_bpp = 0;
- pipe->entities = 0;
+
+ ret = media_entity_enum_init(&pipe->ent_enum, entity->graph_obj.mdev);
+ if (ret)
+ goto err_enum_init;
if (video->iss->pdata->set_constraints)
video->iss->pdata->set_constraints(video->iss, true);
- ret = media_entity_pipeline_start(&video->video.entity, &pipe->pipe);
+ ret = media_entity_pipeline_start(entity, &pipe->pipe);
if (ret < 0)
goto err_media_entity_pipeline_start;
- entity = &video->video.entity;
media_entity_graph_walk_start(&graph, entity);
while ((entity = media_entity_graph_walk_next(&graph)))
- pipe->entities |= 1 << media_entity_id(entity);
+ media_entity_enum_set(&pipe->ent_enum, entity);
/* Verify that the currently configured format matches the output of
* the connected subdev.
@@ -852,6 +854,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
}
mutex_unlock(&video->stream_lock);
+
return 0;
err_omap4iss_set_stream:
@@ -863,7 +866,11 @@ err_media_entity_pipeline_start:
video->iss->pdata->set_constraints(video->iss, false);
video->queue = NULL;
+ media_entity_enum_cleanup(&pipe->ent_enum);
+
+err_enum_init:
mutex_unlock(&video->stream_lock);
+
return ret;
}
@@ -901,6 +908,8 @@ iss_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
vb2_streamoff(&vfh->queue, type);
video->queue = NULL;
+ media_entity_enum_cleanup(&pipe->ent_enum);
+
if (video->iss->pdata->set_constraints)
video->iss->pdata->set_constraints(video->iss, false);
media_entity_pipeline_stop(&video->video.entity);