aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/omap3isp/ispvideo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/omap3isp/ispvideo.c')
-rw-r--r--drivers/media/video/omap3isp/ispvideo.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c
index 912ac071b104..0cb8a9f9d675 100644
--- a/drivers/media/video/omap3isp/ispvideo.c
+++ b/drivers/media/video/omap3isp/ispvideo.c
@@ -278,7 +278,8 @@ isp_video_far_end(struct isp_video *video)
278 * limits reported by every block in the pipeline. 278 * limits reported by every block in the pipeline.
279 * 279 *
280 * Return 0 if all formats match, or -EPIPE if at least one link is found with 280 * Return 0 if all formats match, or -EPIPE if at least one link is found with
281 * different formats on its two ends. 281 * different formats on its two ends or if the pipeline doesn't start with a
282 * video source (either a subdev with no input pad, or a non-subdev entity).
282 */ 283 */
283static int isp_video_validate_pipeline(struct isp_pipeline *pipe) 284static int isp_video_validate_pipeline(struct isp_pipeline *pipe)
284{ 285{
@@ -329,10 +330,15 @@ static int isp_video_validate_pipeline(struct isp_pipeline *pipe)
329 * in the middle of it. */ 330 * in the middle of it. */
330 shifter_link = subdev == &isp->isp_ccdc.subdev; 331 shifter_link = subdev == &isp->isp_ccdc.subdev;
331 332
332 /* Retrieve the source format */ 333 /* Retrieve the source format. Return an error if no source
334 * entity can be found, and stop checking the pipeline if the
335 * source entity isn't a subdev.
336 */
333 pad = media_entity_remote_source(pad); 337 pad = media_entity_remote_source(pad);
334 if (pad == NULL || 338 if (pad == NULL)
335 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) 339 return -EPIPE;
340
341 if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
336 break; 342 break;
337 343
338 subdev = media_entity_to_v4l2_subdev(pad->entity); 344 subdev = media_entity_to_v4l2_subdev(pad->entity);
@@ -1050,6 +1056,14 @@ error:
1050 if (video->isp->pdata->set_constraints) 1056 if (video->isp->pdata->set_constraints)
1051 video->isp->pdata->set_constraints(video->isp, false); 1057 video->isp->pdata->set_constraints(video->isp, false);
1052 media_entity_pipeline_stop(&video->video.entity); 1058 media_entity_pipeline_stop(&video->video.entity);
1059 /* The DMA queue must be emptied here, otherwise CCDC interrupts
1060 * that will get triggered the next time the CCDC is powered up
1061 * will try to access buffers that might have been freed but
1062 * still present in the DMA queue. This can easily get triggered
1063 * if the above omap3isp_pipeline_set_stream() call fails on a
1064 * system with a free-running sensor.
1065 */
1066 INIT_LIST_HEAD(&video->dmaqueue);
1053 video->queue = NULL; 1067 video->queue = NULL;
1054 } 1068 }
1055 1069