aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap3isp/ispvideo.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2015-12-16 11:32:30 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:19:20 -0200
commit17d3d4058a61329a6a4384054da6a57c65c7e8ba (patch)
tree65a40c244307e4081dc62597518aaa5808977771 /drivers/media/platform/omap3isp/ispvideo.c
parent[media] media: Keep using the same graph walk object for a given pipeline (diff)
downloadlinux-dev-17d3d4058a61329a6a4384054da6a57c65c7e8ba.tar.xz
linux-dev-17d3d4058a61329a6a4384054da6a57c65c7e8ba.zip
[media] v4l: omap3isp: 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/media/platform/omap3isp/ispvideo.c')
-rw-r--r--drivers/media/platform/omap3isp/ispvideo.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index 33123f112151..994dfc0813f6 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -241,7 +241,7 @@ static int isp_video_get_graph_data(struct isp_video *video,
while ((entity = media_entity_graph_walk_next(&graph))) {
struct isp_video *__video;
- pipe->entities |= 1 << media_entity_id(entity);
+ media_entity_enum_set(&pipe->ent_enum, entity);
if (far_end != NULL)
continue;
@@ -901,7 +901,6 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
struct v4l2_ext_control ctrl;
unsigned int i;
int ret;
- u32 id;
/* Memory-to-memory pipelines have no external subdev. */
if (pipe->input != NULL)
@@ -909,7 +908,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
for (i = 0; i < ARRAY_SIZE(ents); i++) {
/* Is the entity part of the pipeline? */
- if (!(pipe->entities & (1 << media_entity_id(ents[i]))))
+ if (!media_entity_enum_test(&pipe->ent_enum, ents[i]))
continue;
/* ISP entities have always sink pad == 0. Find source. */
@@ -961,8 +960,8 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
pipe->external_rate = ctrl.value64;
- id = media_entity_id(&isp->isp_ccdc.subdev.entity);
- if (pipe->entities & (1 << id)) {
+ if (media_entity_enum_test(&pipe->ent_enum,
+ &isp->isp_ccdc.subdev.entity)) {
unsigned int rate = UINT_MAX;
/*
* Check that maximum allowed CCDC pixel rate isn't
@@ -1028,7 +1027,9 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
pipe = video->video.entity.pipe
? to_isp_pipeline(&video->video.entity) : &video->pipe;
- pipe->entities = 0;
+ ret = media_entity_enum_init(&pipe->ent_enum, &video->isp->media_dev);
+ if (ret)
+ goto err_enum_init;
/* TODO: Implement PM QoS */
pipe->l3_ick = clk_get_rate(video->isp->clock[ISP_CLK_L3_ICK]);
@@ -1102,6 +1103,7 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
}
mutex_unlock(&video->stream_lock);
+
return 0;
err_set_stream:
@@ -1122,7 +1124,11 @@ err_pipeline_start:
INIT_LIST_HEAD(&video->dmaqueue);
video->queue = NULL;
+ media_entity_enum_cleanup(&pipe->ent_enum);
+
+err_enum_init:
mutex_unlock(&video->stream_lock);
+
return ret;
}
@@ -1174,6 +1180,8 @@ isp_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
/* TODO: Implement PM QoS */
media_entity_pipeline_stop(&video->video.entity);
+ media_entity_enum_cleanup(&pipe->ent_enum);
+
done:
mutex_unlock(&video->stream_lock);
return 0;