diff options
Diffstat (limited to 'drivers/media/platform/vimc/vimc-streamer.c')
-rw-r--r-- | drivers/media/platform/vimc/vimc-streamer.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c index b7c1fdef5f0d..6fc18fea2e45 100644 --- a/drivers/media/platform/vimc/vimc-streamer.c +++ b/drivers/media/platform/vimc/vimc-streamer.c | |||
@@ -46,19 +46,18 @@ static struct media_entity *vimc_get_source_entity(struct media_entity *ent) | |||
46 | */ | 46 | */ |
47 | static void vimc_streamer_pipeline_terminate(struct vimc_stream *stream) | 47 | static void vimc_streamer_pipeline_terminate(struct vimc_stream *stream) |
48 | { | 48 | { |
49 | struct media_entity *entity; | 49 | struct vimc_ent_device *ved; |
50 | struct v4l2_subdev *sd; | 50 | struct v4l2_subdev *sd; |
51 | 51 | ||
52 | while (stream->pipe_size) { | 52 | while (stream->pipe_size) { |
53 | stream->pipe_size--; | 53 | stream->pipe_size--; |
54 | entity = stream->ved_pipeline[stream->pipe_size]->ent; | 54 | ved = stream->ved_pipeline[stream->pipe_size]; |
55 | entity = vimc_get_source_entity(entity); | ||
56 | stream->ved_pipeline[stream->pipe_size] = NULL; | 55 | stream->ved_pipeline[stream->pipe_size] = NULL; |
57 | 56 | ||
58 | if (!is_media_entity_v4l2_subdev(entity)) | 57 | if (!is_media_entity_v4l2_subdev(ved->ent)) |
59 | continue; | 58 | continue; |
60 | 59 | ||
61 | sd = media_entity_to_v4l2_subdev(entity); | 60 | sd = media_entity_to_v4l2_subdev(ved->ent); |
62 | v4l2_subdev_call(sd, video, s_stream, 0); | 61 | v4l2_subdev_call(sd, video, s_stream, 0); |
63 | } | 62 | } |
64 | } | 63 | } |
@@ -89,18 +88,25 @@ static int vimc_streamer_pipeline_init(struct vimc_stream *stream, | |||
89 | } | 88 | } |
90 | stream->ved_pipeline[stream->pipe_size++] = ved; | 89 | stream->ved_pipeline[stream->pipe_size++] = ved; |
91 | 90 | ||
91 | if (is_media_entity_v4l2_subdev(ved->ent)) { | ||
92 | sd = media_entity_to_v4l2_subdev(ved->ent); | ||
93 | ret = v4l2_subdev_call(sd, video, s_stream, 1); | ||
94 | if (ret && ret != -ENOIOCTLCMD) { | ||
95 | pr_err("subdev_call error %s\n", | ||
96 | ved->ent->name); | ||
97 | vimc_streamer_pipeline_terminate(stream); | ||
98 | return ret; | ||
99 | } | ||
100 | } | ||
101 | |||
92 | entity = vimc_get_source_entity(ved->ent); | 102 | entity = vimc_get_source_entity(ved->ent); |
93 | /* Check if the end of the pipeline was reached*/ | 103 | /* Check if the end of the pipeline was reached*/ |
94 | if (!entity) | 104 | if (!entity) |
95 | return 0; | 105 | return 0; |
96 | 106 | ||
107 | /* Get the next device in the pipeline */ | ||
97 | if (is_media_entity_v4l2_subdev(entity)) { | 108 | if (is_media_entity_v4l2_subdev(entity)) { |
98 | sd = media_entity_to_v4l2_subdev(entity); | 109 | sd = media_entity_to_v4l2_subdev(entity); |
99 | ret = v4l2_subdev_call(sd, video, s_stream, 1); | ||
100 | if (ret && ret != -ENOIOCTLCMD) { | ||
101 | vimc_streamer_pipeline_terminate(stream); | ||
102 | return ret; | ||
103 | } | ||
104 | ved = v4l2_get_subdevdata(sd); | 110 | ved = v4l2_get_subdevdata(sd); |
105 | } else { | 111 | } else { |
106 | vdev = container_of(entity, | 112 | vdev = container_of(entity, |