Commit 2d8b2a64 authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Mauro Carvalho Chehab

media: vivid: remove stream_sliced_vbi_cap field

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: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent a810ed0b
...@@ -429,7 +429,6 @@ struct vivid_dev { ...@@ -429,7 +429,6 @@ struct vivid_dev {
u32 vbi_cap_seq_start; u32 vbi_cap_seq_start;
u32 vbi_cap_seq_count; u32 vbi_cap_seq_count;
bool vbi_cap_streaming; bool vbi_cap_streaming;
bool stream_sliced_vbi_cap;
u32 meta_cap_seq_start; u32 meta_cap_seq_start;
u32 meta_cap_seq_count; u32 meta_cap_seq_count;
bool meta_cap_streaming; bool meta_cap_streaming;
......
...@@ -752,7 +752,7 @@ static noinline_for_stack void vivid_thread_vid_cap_tick(struct vivid_dev *dev, ...@@ -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, v4l2_ctrl_request_setup(vbi_cap_buf->vb.vb2_buf.req_obj.req,
&dev->ctrl_hdl_vbi_cap); &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); vivid_sliced_vbi_cap_process(dev, vbi_cap_buf);
else else
vivid_raw_vbi_cap_process(dev, vbi_cap_buf); vivid_raw_vbi_cap_process(dev, vbi_cap_buf);
......
...@@ -255,9 +255,8 @@ int vidioc_s_fmt_vbi_cap(struct file *file, void *priv, ...@@ -255,9 +255,8 @@ int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,
if (ret) if (ret)
return 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; return -EBUSY;
dev->stream_sliced_vbi_cap = false;
dev->vbi_cap_dev.queue->type = V4L2_BUF_TYPE_VBI_CAPTURE; dev->vbi_cap_dev.queue->type = V4L2_BUF_TYPE_VBI_CAPTURE;
return 0; return 0;
} }
...@@ -322,10 +321,9 @@ int vidioc_s_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_format ...@@ -322,10 +321,9 @@ int vidioc_s_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_format
if (ret) if (ret)
return 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; return -EBUSY;
dev->service_set_cap = vbi->service_set; 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; dev->vbi_cap_dev.queue->type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment