aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2011-03-15 13:50:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-04-19 15:01:39 -0400
commitc4a627333f0d952c5e10c02609493fa63b5c7b28 (patch)
tree6fdb568363159339f68652de51077cae55853e7a /drivers
parent25b9875fb4880efabb79d6a35c92cc7287fcaccd (diff)
[media] s5p-fimc: Do not allow changing format after REQBUFS
Protecting the color format with vb2_is_streaming() is not sufficient as this prevents changing the format only after VIDIOC_STREAMON. To prevent the color format reconfiguration as soon as buffers are allocated use vb2_is_busy() instead. Also make the videobuf queue ops structure static. 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c2
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index 95f8b4e11e46..00c561ca3870 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -527,7 +527,7 @@ static int fimc_cap_s_fmt_mplane(struct file *file, void *priv,
527 if (ret) 527 if (ret)
528 return ret; 528 return ret;
529 529
530 if (vb2_is_streaming(&fimc->vid_cap.vbq) || fimc_capture_active(fimc)) 530 if (vb2_is_busy(&fimc->vid_cap.vbq) || fimc_capture_active(fimc))
531 return -EBUSY; 531 return -EBUSY;
532 532
533 frame = &ctx->d_frame; 533 frame = &ctx->d_frame;
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index d54e6d851f52..115a1e0d8c29 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -758,7 +758,7 @@ static void fimc_unlock(struct vb2_queue *vq)
758 mutex_unlock(&ctx->fimc_dev->lock); 758 mutex_unlock(&ctx->fimc_dev->lock);
759} 759}
760 760
761struct vb2_ops fimc_qops = { 761static struct vb2_ops fimc_qops = {
762 .queue_setup = fimc_queue_setup, 762 .queue_setup = fimc_queue_setup,
763 .buf_prepare = fimc_buf_prepare, 763 .buf_prepare = fimc_buf_prepare,
764 .buf_queue = fimc_buf_queue, 764 .buf_queue = fimc_buf_queue,
@@ -965,7 +965,7 @@ static int fimc_m2m_s_fmt_mplane(struct file *file, void *priv,
965 965
966 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); 966 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
967 967
968 if (vb2_is_streaming(vq)) { 968 if (vb2_is_busy(vq)) {
969 v4l2_err(&fimc->m2m.v4l2_dev, "queue (%d) busy\n", f->type); 969 v4l2_err(&fimc->m2m.v4l2_dev, "queue (%d) busy\n", f->type);
970 return -EBUSY; 970 return -EBUSY;
971 } 971 }