[media] v4l: omap3isp: Use the new media graph walk interface

The media graph walk requires initialisation and cleanup soon. Update the
users to perform the soon necessary API calls.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Sakari Ailus
2015-12-16 11:32:24 -02:00
committed by Mauro Carvalho Chehab
vanhempi 106b9907c3
commit 28461451c0
4 muutettua tiedostoa jossa 61 lisäystä ja 27 poistoa

Näytä tiedosto

@@ -227,8 +227,15 @@ static int isp_video_get_graph_data(struct isp_video *video,
struct media_entity *entity = &video->video.entity;
struct media_device *mdev = entity->graph_obj.mdev;
struct isp_video *far_end = NULL;
int ret;
mutex_lock(&mdev->graph_mutex);
ret = media_entity_graph_walk_init(&graph, entity->graph_obj.mdev);
if (ret) {
mutex_unlock(&mdev->graph_mutex);
return ret;
}
media_entity_graph_walk_start(&graph, entity);
while ((entity = media_entity_graph_walk_next(&graph))) {
@@ -252,6 +259,8 @@ static int isp_video_get_graph_data(struct isp_video *video,
mutex_unlock(&mdev->graph_mutex);
media_entity_graph_walk_cleanup(&graph);
if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
pipe->input = far_end;
pipe->output = video;
@@ -1244,7 +1253,12 @@ static int isp_video_open(struct file *file)
goto done;
}
ret = omap3isp_pipeline_pm_use(&video->video.entity, 1);
ret = media_entity_graph_walk_init(&handle->graph,
&video->isp->media_dev);
if (ret)
goto done;
ret = omap3isp_pipeline_pm_use(&video->video.entity, 1, &handle->graph);
if (ret < 0) {
omap3isp_put(video->isp);
goto done;
@@ -1275,6 +1289,7 @@ static int isp_video_open(struct file *file)
done:
if (ret < 0) {
v4l2_fh_del(&handle->vfh);
media_entity_graph_walk_cleanup(&handle->graph);
kfree(handle);
}
@@ -1294,7 +1309,8 @@ static int isp_video_release(struct file *file)
vb2_queue_release(&handle->queue);
mutex_unlock(&video->queue_lock);
omap3isp_pipeline_pm_use(&video->video.entity, 0);
omap3isp_pipeline_pm_use(&video->video.entity, 0, &handle->graph);
media_entity_graph_walk_cleanup(&handle->graph);
/* Release the file handle. */
v4l2_fh_del(vfh);