From 678856299c0db53c47bfcbedda7921d878a78be5 Mon Sep 17 00:00:00 2001 From: Ian Jamison Date: Fri, 1 Dec 2017 13:53:50 -0500 Subject: media: imx: Remove incorrect check for queue state in start/stop_streaming It is possible to call STREAMON without the minimum number of buffers queued. In this case the vb2_queue state will be set to streaming but the start_streaming vb2_op will not be called. Later when enough buffers are queued, start_streaming will be called but vb2_is_streaming will already return true. Also removed the queue state check in stop_streaming since it's not valid there either. Signed-off-by: Ian Jamison Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/imx/imx-media-capture.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'drivers/staging/media/imx/imx-media-capture.c') diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index ea145bafb880..7b6763802db8 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -449,9 +449,6 @@ static int capture_start_streaming(struct vb2_queue *vq, unsigned int count) unsigned long flags; int ret; - if (vb2_is_streaming(vq)) - return 0; - ret = imx_media_pipeline_set_stream(priv->md, &priv->src_sd->entity, true); if (ret) { @@ -480,9 +477,6 @@ static void capture_stop_streaming(struct vb2_queue *vq) unsigned long flags; int ret; - if (!vb2_is_streaming(vq)) - return; - spin_lock_irqsave(&priv->q_lock, flags); priv->stop = true; spin_unlock_irqrestore(&priv->q_lock, flags); -- cgit From bd9d208a04e0db4f66255c24ff37e49069d274ee Mon Sep 17 00:00:00 2001 From: Steve Longerbeam Date: Thu, 14 Dec 2017 20:04:45 -0500 Subject: media: staging/imx: convert static vdev lists to list_head Although not technically necessary because imx-media has only a maximum of 8 video devices, and once setup the video device lists are static, in anticipation of moving control ineritance to v4l2-core, make the vdev lists more generic by converting to dynamic list_head's. After doing that, 'struct imx_media_pad' is now just a list_head of video devices reachable from a pad. Allocate an array of list_head's, one list_head for each pad, and attach that array to sd->host_priv. An entry in the pad lists is of type 'struct imx_media_pad_vdev', and points to a video device from the master list. Signed-off-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/imx/imx-media-capture.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/staging/media/imx/imx-media-capture.c') diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 7b6763802db8..576bdc7e9c42 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -748,6 +748,8 @@ imx_media_capture_device_init(struct v4l2_subdev *src_sd, int pad) vfd->queue = &priv->q; priv->vdev.vfd = vfd; + INIT_LIST_HEAD(&priv->vdev.list); + video_set_drvdata(vfd, priv); v4l2_ctrl_handler_init(&priv->ctrl_hdlr, 0); -- cgit