mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
media: vivid: fix CREATE_BUFS support in queue_setup()
While queue_setup was correct for CREATE_BUFS support for video devices, for VBI, SDR and touch devices it was wrong. This was found after adding new v4l2-compliance tests. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
0fd7c0c2c1
commit
23558d802a
@ -219,8 +219,13 @@ static int sdr_cap_queue_setup(struct vb2_queue *vq,
|
|||||||
unsigned sizes[], struct device *alloc_devs[])
|
unsigned sizes[], struct device *alloc_devs[])
|
||||||
{
|
{
|
||||||
/* 2 = max 16-bit sample returned */
|
/* 2 = max 16-bit sample returned */
|
||||||
sizes[0] = SDR_CAP_SAMPLES_PER_BUF * 2;
|
u32 size = SDR_CAP_SAMPLES_PER_BUF * 2;
|
||||||
|
|
||||||
|
if (*nplanes)
|
||||||
|
return sizes[0] < size ? -EINVAL : 0;
|
||||||
|
|
||||||
*nplanes = 1;
|
*nplanes = 1;
|
||||||
|
sizes[0] = size;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@ static int touch_cap_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
|
|||||||
unsigned int size = f->sizeimage;
|
unsigned int size = f->sizeimage;
|
||||||
|
|
||||||
if (*nplanes) {
|
if (*nplanes) {
|
||||||
if (sizes[0] < size)
|
if (*nplanes != 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else {
|
return sizes[0] < size ? -EINVAL : 0;
|
||||||
sizes[0] = size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*nplanes = 1;
|
*nplanes = 1;
|
||||||
|
sizes[0] = size;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +132,8 @@ static int vbi_cap_queue_setup(struct vb2_queue *vq,
|
|||||||
if (!vivid_is_sdtv_cap(dev))
|
if (!vivid_is_sdtv_cap(dev))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (*nplanes)
|
||||||
|
return sizes[0] < size ? -EINVAL : 0;
|
||||||
sizes[0] = size;
|
sizes[0] = size;
|
||||||
|
|
||||||
*nplanes = 1;
|
*nplanes = 1;
|
||||||
|
@ -28,6 +28,8 @@ static int vbi_out_queue_setup(struct vb2_queue *vq,
|
|||||||
if (!vivid_is_svid_out(dev))
|
if (!vivid_is_svid_out(dev))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (*nplanes)
|
||||||
|
return sizes[0] < size ? -EINVAL : 0;
|
||||||
sizes[0] = size;
|
sizes[0] = size;
|
||||||
|
|
||||||
*nplanes = 1;
|
*nplanes = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user