media: omap4iss: Acquire graph mutex for graph traversal
Acquire the graph_mutex for traversing the media graph. This seems to have been missing all the time. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
ba689d9333
commit
5bf2c8b66e
2 changed files with 8 additions and 0 deletions
|
|
@ -456,6 +456,8 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
|
|||
|
||||
pipe->do_propagation = false;
|
||||
|
||||
mutex_lock(&iss->media_dev.graph_mutex);
|
||||
|
||||
entity = &pipe->output->video.entity;
|
||||
while (1) {
|
||||
pad = &entity->pads[0];
|
||||
|
|
@ -472,6 +474,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
|
|||
ret = v4l2_subdev_call(subdev, video, s_stream, mode);
|
||||
if (ret < 0 && ret != -ENOIOCTLCMD) {
|
||||
iss_pipeline_disable(pipe, entity);
|
||||
mutex_unlock(&iss->media_dev.graph_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -480,7 +483,9 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
|
|||
pipe->do_propagation = true;
|
||||
}
|
||||
|
||||
mutex_unlock(&iss->media_dev.graph_mutex);
|
||||
iss_print_status(pipe->output->iss);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -854,6 +854,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
|
|||
struct iss_video *video = video_drvdata(file);
|
||||
struct media_graph graph;
|
||||
struct media_entity *entity = &video->video.entity;
|
||||
struct media_device *mdev = entity->graph_obj.mdev;
|
||||
enum iss_pipeline_state state;
|
||||
struct iss_pipeline *pipe;
|
||||
struct iss_video *far_end;
|
||||
|
|
@ -890,9 +891,11 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
|
|||
if (ret < 0)
|
||||
goto err_media_pipeline_start;
|
||||
|
||||
mutex_lock(&mdev->graph_mutex);
|
||||
media_graph_walk_start(&graph, entity);
|
||||
while ((entity = media_graph_walk_next(&graph)))
|
||||
media_entity_enum_set(&pipe->ent_enum, entity);
|
||||
mutex_unlock(&mdev->graph_mutex);
|
||||
|
||||
/*
|
||||
* Verify that the currently configured format matches the output of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue