summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-06-01 17:03:13 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-31 17:17:31 +0200
commit8e013700bc12806d80f31ebe360916987f0e03df (patch)
tree08f72f21ff13afaef584c4de98c28efcfb7add61 /drivers/media
parentmedia: videodev2.h: Add request_fd field to v4l2_buffer (diff)
downloadlinux-8e013700bc12806d80f31ebe360916987f0e03df.tar.xz
linux-8e013700bc12806d80f31ebe360916987f0e03df.zip
media: vb2: add init_buffer buffer op
We need to initialize the request_fd field in struct vb2_v4l2_buffer to -1 instead of the default of 0. So we need to add a new op that is called when struct vb2_v4l2_buffer is allocated. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/videobuf2/videobuf2-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index eead693ba619..230f83d6d094 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -356,6 +356,8 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory,
vb->planes[plane].length = plane_sizes[plane];
vb->planes[plane].min_length = plane_sizes[plane];
}
+ call_void_bufop(q, init_buffer, vb);
+
q->bufs[vb->index] = vb;
/* Allocate video buffer memory for the MMAP type */