From 93aeb34c43761a0872f7ac5de085665f74e03165 Mon Sep 17 00:00:00 2001 From: Alex Damian Date: Fri, 22 Apr 2016 20:48:02 +0100 Subject: [PATCH] Fix compilation for newer kernels New kernels above 4.4 have a different interface for vb2_ops.queue_setup, so we respect that. Tested on 4.6.0, the camera works ok. --- fthd_v4l2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fthd_v4l2.c b/fthd_v4l2.c index 1d62a9e..ea3fe16 100644 --- a/fthd_v4l2.c +++ b/fthd_v4l2.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,9 @@ #define FTHD_NUM_FORMATS 2 /* NV16 is disabled for now */ static int fthd_buffer_queue_setup(struct vb2_queue *vq, +#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,4,0) const struct v4l2_format *fmt, +#endif unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) { @@ -55,10 +58,6 @@ static int fthd_buffer_queue_setup(struct vb2_queue *vq, return -EINVAL; /* FIXME: We assume single plane format here but not below */ - if (fmt && fmt->fmt.pix.sizeimage < - (cur_fmt->bytesperline * cur_fmt->height)) - return -EINVAL; - for (i = 0; i < *nplanes; i++) { sizes[i] = cur_fmt->sizeimage; alloc_ctxs[i] = dev_priv->alloc_ctx;