summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Wu <pengw@nvidia.com>2015-06-08 15:01:25 -0700
committerWinnie Hsu <whsu@nvidia.com>2015-06-19 17:27:52 -0700
commitc041d757963de9373a1ae5ef9d2940bb57a2d14b (patch)
treecd7de2903bac8ed1671ff21c51d4195143ec3f73
parent9a9279ad1acf717c69c00724b28ef39acc606eb7 (diff)
media: tegra_camera: add start streaming call
Queueing buffer might happen before starting streaming. So any queueing buffer operation before starting streaming shouldn't trigger real capture but just queue the buffer. After starting streaming, it will wake up kernel workqueue to start real capture. Bug 1639982 Change-Id: I66fd527bbd12790b2d688f320214976e70a658f3 Signed-off-by: Bryan Wu <pengw@nvidia.com> Reviewed-on: http://git-master/r/754710 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: David Wang (SW-TEGRA) <davidw@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
-rw-r--r--drivers/media/platform/soc_camera/tegra_camera/common.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/media/platform/soc_camera/tegra_camera/common.c b/drivers/media/platform/soc_camera/tegra_camera/common.c
index d8b4ff1d4d58..2fa4d78a7add 100644
--- a/drivers/media/platform/soc_camera/tegra_camera/common.c
+++ b/drivers/media/platform/soc_camera/tegra_camera/common.c
@@ -483,8 +483,10 @@ static void tegra_camera_videobuf_queue(struct vb2_buffer *vb)
spin_lock_irq(&cam->videobuf_queue_lock);
list_add_tail(&buf->queue, &cam->capture);
- schedule_work(&cam->work);
spin_unlock_irq(&cam->videobuf_queue_lock);
+
+ if (vb2_is_streaming(vb->vb2_queue))
+ schedule_work(&cam->work);
}
static void tegra_camera_videobuf_release(struct vb2_buffer *vb)
@@ -523,6 +525,19 @@ static int tegra_camera_videobuf_init(struct vb2_buffer *vb)
return 0;
}
+static int tegra_camera_start_streaming(struct vb2_queue *q, unsigned int count)
+{
+ struct soc_camera_device *icd = container_of(q,
+ struct soc_camera_device,
+ vb2_vidq);
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+ struct tegra_camera_dev *cam = ici->priv;
+
+ schedule_work(&cam->work);
+
+ return 0;
+}
+
static int tegra_camera_stop_streaming(struct vb2_queue *q)
{
struct soc_camera_device *icd = container_of(q,
@@ -549,6 +564,7 @@ static struct vb2_ops tegra_camera_videobuf_ops = {
.buf_init = tegra_camera_videobuf_init,
.wait_prepare = soc_camera_unlock,
.wait_finish = soc_camera_lock,
+ .start_streaming = tegra_camera_start_streaming,
.stop_streaming = tegra_camera_stop_streaming,
};