[media] media: vivid: use vb2_ops_wait_prepare/finish helper
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
a48ff17dbb
commit
6dfa513180
|
@ -195,20 +195,6 @@ static const u8 vivid_hdmi_edid[256] = {
|
|||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7
|
||||
};
|
||||
|
||||
void vivid_lock(struct vb2_queue *vq)
|
||||
{
|
||||
struct vivid_dev *dev = vb2_get_drv_priv(vq);
|
||||
|
||||
mutex_lock(&dev->mutex);
|
||||
}
|
||||
|
||||
void vivid_unlock(struct vb2_queue *vq)
|
||||
{
|
||||
struct vivid_dev *dev = vb2_get_drv_priv(vq);
|
||||
|
||||
mutex_unlock(&dev->mutex);
|
||||
}
|
||||
|
||||
static int vidioc_querycap(struct file *file, void *priv,
|
||||
struct v4l2_capability *cap)
|
||||
{
|
||||
|
@ -1018,6 +1004,7 @@ static int __init vivid_create_instance(int inst)
|
|||
q->mem_ops = &vb2_vmalloc_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->min_buffers_needed = 2;
|
||||
q->lock = &dev->mutex;
|
||||
|
||||
ret = vb2_queue_init(q);
|
||||
if (ret)
|
||||
|
@ -1036,6 +1023,7 @@ static int __init vivid_create_instance(int inst)
|
|||
q->mem_ops = &vb2_vmalloc_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->min_buffers_needed = 2;
|
||||
q->lock = &dev->mutex;
|
||||
|
||||
ret = vb2_queue_init(q);
|
||||
if (ret)
|
||||
|
@ -1054,6 +1042,7 @@ static int __init vivid_create_instance(int inst)
|
|||
q->mem_ops = &vb2_vmalloc_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->min_buffers_needed = 2;
|
||||
q->lock = &dev->mutex;
|
||||
|
||||
ret = vb2_queue_init(q);
|
||||
if (ret)
|
||||
|
@ -1072,6 +1061,7 @@ static int __init vivid_create_instance(int inst)
|
|||
q->mem_ops = &vb2_vmalloc_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->min_buffers_needed = 2;
|
||||
q->lock = &dev->mutex;
|
||||
|
||||
ret = vb2_queue_init(q);
|
||||
if (ret)
|
||||
|
@ -1089,6 +1079,7 @@ static int __init vivid_create_instance(int inst)
|
|||
q->mem_ops = &vb2_vmalloc_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->min_buffers_needed = 8;
|
||||
q->lock = &dev->mutex;
|
||||
|
||||
ret = vb2_queue_init(q);
|
||||
if (ret)
|
||||
|
|
|
@ -514,7 +514,4 @@ static inline bool vivid_is_hdmi_out(const struct vivid_dev *dev)
|
|||
return dev->output_type[dev->output] == HDMI;
|
||||
}
|
||||
|
||||
void vivid_lock(struct vb2_queue *vq);
|
||||
void vivid_unlock(struct vb2_queue *vq);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -297,8 +297,8 @@ const struct vb2_ops vivid_sdr_cap_qops = {
|
|||
.buf_queue = sdr_cap_buf_queue,
|
||||
.start_streaming = sdr_cap_start_streaming,
|
||||
.stop_streaming = sdr_cap_stop_streaming,
|
||||
.wait_prepare = vivid_unlock,
|
||||
.wait_finish = vivid_lock,
|
||||
.wait_prepare = vb2_ops_wait_prepare,
|
||||
.wait_finish = vb2_ops_wait_finish,
|
||||
};
|
||||
|
||||
int vivid_sdr_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band)
|
||||
|
|
|
@ -236,8 +236,8 @@ const struct vb2_ops vivid_vbi_cap_qops = {
|
|||
.buf_queue = vbi_cap_buf_queue,
|
||||
.start_streaming = vbi_cap_start_streaming,
|
||||
.stop_streaming = vbi_cap_stop_streaming,
|
||||
.wait_prepare = vivid_unlock,
|
||||
.wait_finish = vivid_lock,
|
||||
.wait_prepare = vb2_ops_wait_prepare,
|
||||
.wait_finish = vb2_ops_wait_finish,
|
||||
};
|
||||
|
||||
int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,
|
||||
|
|
|
@ -131,8 +131,8 @@ const struct vb2_ops vivid_vbi_out_qops = {
|
|||
.buf_queue = vbi_out_buf_queue,
|
||||
.start_streaming = vbi_out_start_streaming,
|
||||
.stop_streaming = vbi_out_stop_streaming,
|
||||
.wait_prepare = vivid_unlock,
|
||||
.wait_finish = vivid_lock,
|
||||
.wait_prepare = vb2_ops_wait_prepare,
|
||||
.wait_finish = vb2_ops_wait_finish,
|
||||
};
|
||||
|
||||
int vidioc_g_fmt_vbi_out(struct file *file, void *priv,
|
||||
|
|
|
@ -288,8 +288,8 @@ const struct vb2_ops vivid_vid_cap_qops = {
|
|||
.buf_queue = vid_cap_buf_queue,
|
||||
.start_streaming = vid_cap_start_streaming,
|
||||
.stop_streaming = vid_cap_stop_streaming,
|
||||
.wait_prepare = vivid_unlock,
|
||||
.wait_finish = vivid_lock,
|
||||
.wait_prepare = vb2_ops_wait_prepare,
|
||||
.wait_finish = vb2_ops_wait_finish,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -209,8 +209,8 @@ const struct vb2_ops vivid_vid_out_qops = {
|
|||
.buf_queue = vid_out_buf_queue,
|
||||
.start_streaming = vid_out_start_streaming,
|
||||
.stop_streaming = vid_out_stop_streaming,
|
||||
.wait_prepare = vivid_unlock,
|
||||
.wait_finish = vivid_lock,
|
||||
.wait_prepare = vb2_ops_wait_prepare,
|
||||
.wait_finish = vb2_ops_wait_finish,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue