aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0627-bcm2835-Allow-compressed-frames-to-set-sizeimage-438.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 10:54:34 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 19:07:07 +0200
commit8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch)
tree1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0627-bcm2835-Allow-compressed-frames-to-set-sizeimage-438.patch
parent33b6885975ce376ff075362b7f0890326043111b (diff)
downloadupstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted patches, wireless patches and defconfig patches. bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 4B v1.1 4G bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0627-bcm2835-Allow-compressed-frames-to-set-sizeimage-438.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.10/950-0627-bcm2835-Allow-compressed-frames-to-set-sizeimage-438.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0627-bcm2835-Allow-compressed-frames-to-set-sizeimage-438.patch b/target/linux/bcm27xx/patches-5.10/950-0627-bcm2835-Allow-compressed-frames-to-set-sizeimage-438.patch
new file mode 100644
index 0000000000..c0c86bd8cd
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.10/950-0627-bcm2835-Allow-compressed-frames-to-set-sizeimage-438.patch
@@ -0,0 +1,47 @@
+From 9eaafa9f93c9a97498b73583a70b9e238cbe4536 Mon Sep 17 00:00:00 2001
+From: jc-kynesim <jc@kynesim.co.uk>
+Date: Fri, 11 Jun 2021 15:14:31 +0100
+Subject: [PATCH] bcm2835: Allow compressed frames to set sizeimage
+ (#4386)
+
+Allow the user to set sizeimage in TRY_FMT and S_FMT if the format
+flags have V4L2_FMT_FLAG_COMPRESSED set
+
+Signed-off-by: John Cox <jc@kynesim.co.uk>
+---
+ .../bcm2835-codec/bcm2835-v4l2-codec.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
+@@ -1291,6 +1291,8 @@ static int vidioc_g_fmt_vid_cap(struct f
+ static int vidioc_try_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f,
+ struct bcm2835_codec_fmt *fmt)
+ {
++ unsigned int sizeimage;
++
+ /*
+ * The V4L2 specification requires the driver to correct the format
+ * struct if any of the dimensions is unsupported
+@@ -1319,9 +1321,18 @@ static int vidioc_try_fmt(struct bcm2835
+ f->fmt.pix_mp.num_planes = 1;
+ f->fmt.pix_mp.plane_fmt[0].bytesperline =
+ get_bytesperline(f->fmt.pix_mp.width, fmt);
+- f->fmt.pix_mp.plane_fmt[0].sizeimage =
+- get_sizeimage(f->fmt.pix_mp.plane_fmt[0].bytesperline,
+- f->fmt.pix_mp.width, f->fmt.pix_mp.height, fmt);
++ sizeimage = get_sizeimage(f->fmt.pix_mp.plane_fmt[0].bytesperline,
++ f->fmt.pix_mp.width, f->fmt.pix_mp.height,
++ fmt);
++ /*
++ * Drivers must set sizeimage for uncompressed formats
++ * Compressed formats allow the client to request an alternate
++ * size for the buffer.
++ */
++ if (!(fmt->flags & V4L2_FMT_FLAG_COMPRESSED) ||
++ f->fmt.pix_mp.plane_fmt[0].sizeimage < sizeimage)
++ f->fmt.pix_mp.plane_fmt[0].sizeimage = sizeimage;
++
+ memset(f->fmt.pix_mp.plane_fmt[0].reserved, 0,
+ sizeof(f->fmt.pix_mp.plane_fmt[0].reserved));
+