[media] s5p-fimc: Add error checks for pipeline stream on callbacks
authorAndrzej Hajda <a.hajda@samsung.com>
Wed, 27 Feb 2013 11:13:59 +0000 (08:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 31 Mar 2013 13:57:17 +0000 (10:57 -0300)
set_stream error for pipelines is logged or reported to user
space if possible.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/s5p-fimc/fimc-capture.c

index 724cd8b4933d60faf61302b359c90f82b6a835f9..ff9ca6384636051b7960045c7e8160a8ac7ed03c 100644 (file)
@@ -286,8 +286,8 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
                fimc_activate_capture(ctx);
 
                if (!test_and_set_bit(ST_CAPT_ISP_STREAM, &fimc->state))
-                       fimc_pipeline_call(fimc, set_stream,
-                                          &fimc->pipeline, 1);
+                       return fimc_pipeline_call(fimc, set_stream,
+                                                 &fimc->pipeline, 1);
        }
 
        return 0;
@@ -443,12 +443,17 @@ static void buffer_queue(struct vb2_buffer *vb)
        if (vb2_is_streaming(&vid_cap->vbq) &&
            vid_cap->active_buf_cnt >= min_bufs &&
            !test_and_set_bit(ST_CAPT_STREAM, &fimc->state)) {
+               int ret;
+
                fimc_activate_capture(ctx);
                spin_unlock_irqrestore(&fimc->slock, flags);
 
-               if (!test_and_set_bit(ST_CAPT_ISP_STREAM, &fimc->state))
-                       fimc_pipeline_call(fimc, set_stream,
-                                          &fimc->pipeline, 1);
+               if (test_and_set_bit(ST_CAPT_ISP_STREAM, &fimc->state))
+                       return;
+
+               ret = fimc_pipeline_call(fimc, set_stream, &fimc->pipeline, 1);
+               if (ret < 0)
+                       v4l2_err(&vid_cap->vfd, "stream on failed: %d\n", ret);
                return;
        }
        spin_unlock_irqrestore(&fimc->slock, flags);