ImmortalWrt/target/linux/bcm27xx/patches-5.15/950-0583-staging-bcm2835-codec-bytesperline-for-YUV420-YVU420.patch
Álvaro Fernández Rojas 20ea6adbf1 bcm27xx: add support for linux v5.15
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-17 15:11:22 +02:00

43 lines
1.6 KiB
Diff

From 18277c9cdbb9d3595d442c97ee80b2c10303aeb9 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 26 Nov 2021 16:46:22 +0000
Subject: [PATCH] staging/bcm2835-codec: bytesperline for YUV420/YVU420
needs to be 64
Matching https://github.com/raspberrypi/linux/pull/4419, the ISP
block (which is also used on the input of the encoder, and output
of the decoder) needs the base address of all planes to be aligned
to multiples of 32. This includes the chroma planes of YUV420 and
YVU420.
If the height is only a multiple of 2 (not 4), then you get an odd
number of lines in the second plane, which means the 3rd plane
starts at a multiple of bytesperline/2.
Set the minimum bytesperline alignment to 64 for those formats
so that the plane alignment is always right.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
.../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
+++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
@@ -157,14 +157,14 @@ static const struct bcm2835_codec_fmt su
/* YUV formats */
.fourcc = V4L2_PIX_FMT_YUV420,
.depth = 8,
- .bytesperline_align = 32,
+ .bytesperline_align = 64,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_I420,
.size_multiplier_x2 = 3,
}, {
.fourcc = V4L2_PIX_FMT_YVU420,
.depth = 8,
- .bytesperline_align = 32,
+ .bytesperline_align = 64,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_YV12,
.size_multiplier_x2 = 3,