]> asedeno.scripts.mit.edu Git - linux.git/commit
media: vb2: add buf_out_validate callback
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 16 Jan 2019 12:01:13 +0000 (10:01 -0200)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 31 Jan 2019 11:29:47 +0000 (09:29 -0200)
commit28d77c21cbeb2c6039d48ef88401b87a56a7a07f
tree71c5b3ab4c34e2d2ae92638c33401916ed5f19a7
parent065e5a31497d8f285da06eac1c8d8e86c723af47
media: vb2: add buf_out_validate callback

When queueing a buffer to a request the 'field' value is not validated.
That field is only validated when the _buf_prepare() is called,
which happens when the request is queued.

However, this validation should happen at QBUF time, since you want
to know about this as soon as possible. Also, the spec requires that
the 'field' value is validated at QBUF time.

This patch adds a new buf_out_validate callback to validate the
output buffer at buf_prepare time or when QBUF queues an unprepared
buffer to a request. This callback is mandatory for output queues
that support requests.

This issue was found by v4l2-compliance since it failed to replace
V4L2_FIELD_ANY by a proper field value when testing the vivid video
output in combination with requests.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/videobuf2/videobuf2-core.c
include/media/videobuf2-core.h