media: vivid: remove stream_sliced_vbi_cap field
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 12 Apr 2021 11:02:10 +0000 (13:02 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 8 Jun 2021 10:04:36 +0000 (12:04 +0200)
Vivid tracks the VBI capture mode in vivid_dev->stream_sliced_vbi_cap
field.  We can just look at the buffer type instead, and drop the field.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/test-drivers/vivid/vivid-core.h
drivers/media/test-drivers/vivid/vivid-kthread-cap.c
drivers/media/test-drivers/vivid/vivid-vbi-cap.c

index cdff6cd264d038dc30d6d52c14e902bc34b6a18a..1e3c4f5a9413fe9e0c46693ec5d7178b4e4a9347 100644 (file)
@@ -429,7 +429,6 @@ struct vivid_dev {
        u32                             vbi_cap_seq_start;
        u32                             vbi_cap_seq_count;
        bool                            vbi_cap_streaming;
-       bool                            stream_sliced_vbi_cap;
        u32                             meta_cap_seq_start;
        u32                             meta_cap_seq_count;
        bool                            meta_cap_streaming;
index c0dc609c135818dc7515d7fd7291f40d50bdac5a..9da730ccfa94f3579912cc9999ccc1025c64ede5 100644 (file)
@@ -752,7 +752,7 @@ static noinline_for_stack void vivid_thread_vid_cap_tick(struct vivid_dev *dev,
 
                v4l2_ctrl_request_setup(vbi_cap_buf->vb.vb2_buf.req_obj.req,
                                        &dev->ctrl_hdl_vbi_cap);
-               if (dev->stream_sliced_vbi_cap)
+               if (vbi_cap_buf->vb.vb2_buf.type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE)
                        vivid_sliced_vbi_cap_process(dev, vbi_cap_buf);
                else
                        vivid_raw_vbi_cap_process(dev, vbi_cap_buf);
index 1a9348eea781792fc4f002af95d776a56927763a..387df4ff01b08f6a22fff73f093699c2c62169e3 100644 (file)
@@ -255,9 +255,8 @@ int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,
 
        if (ret)
                return ret;
-       if (dev->stream_sliced_vbi_cap && vb2_is_busy(&dev->vb_vbi_cap_q))
+       if (f->type != V4L2_BUF_TYPE_VBI_CAPTURE && vb2_is_busy(&dev->vb_vbi_cap_q))
                return -EBUSY;
-       dev->stream_sliced_vbi_cap = false;
        dev->vbi_cap_dev.queue->type = V4L2_BUF_TYPE_VBI_CAPTURE;
        return 0;
 }
@@ -322,10 +321,9 @@ int vidioc_s_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_format
 
        if (ret)
                return ret;
-       if (!dev->stream_sliced_vbi_cap && vb2_is_busy(&dev->vb_vbi_cap_q))
+       if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE && vb2_is_busy(&dev->vb_vbi_cap_q))
                return -EBUSY;
        dev->service_set_cap = vbi->service_set;
-       dev->stream_sliced_vbi_cap = true;
        dev->vbi_cap_dev.queue->type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
        return 0;
 }