bcm27xx: add support for linux v5.15
[openwrt/staging/ldir.git] / target / linux / bcm27xx / patches-5.15 / 950-0373-staging-bcm2835-camera-Add-support-for-DMABUFs.patch
1 From 7875476d9d797ed087399ec27e0b5db5b2c37162 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 17 Mar 2021 12:34:57 +0000
4 Subject: [PATCH] staging/bcm2835-camera: Add support for DMABUFs
5
6 DMABUFs are all handled by videobuf2, so there is no reason not
7 to enable support for them.
8
9 Note that this driver is still using the vmalloc allocator, so
10 the buffers it allocates will not be compatible with the codec
11 or ISP driver that require contiguous buffers. However this
12 driver should be able to import the buffers allocated by them.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 ++-
17 1 file changed, 2 insertions(+), 1 deletion(-)
18
19 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
20 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
21 @@ -1453,6 +1453,7 @@ static const struct v4l2_ioctl_ops camer
22 .vidioc_querybuf = vb2_ioctl_querybuf,
23 .vidioc_qbuf = vb2_ioctl_qbuf,
24 .vidioc_dqbuf = vb2_ioctl_dqbuf,
25 + .vidioc_expbuf = vb2_ioctl_expbuf,
26 .vidioc_enum_framesizes = vidioc_enum_framesizes,
27 .vidioc_enum_frameintervals = vidioc_enum_frameintervals,
28 .vidioc_g_parm = vidioc_g_parm,
29 @@ -1934,7 +1935,7 @@ static int bcm2835_mmal_probe(struct pla
30 q = &dev->capture.vb_vidq;
31 memset(q, 0, sizeof(*q));
32 q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
33 - q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ;
34 + q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ | VB2_DMABUF;
35 q->drv_priv = dev;
36 q->buf_struct_size = sizeof(struct vb2_mmal_buffer);
37 q->ops = &bm2835_mmal_video_qops;