]> git.ipfire.org Git - thirdparty/openwrt.git/blob
3d90a9c984b63f6bbfafa51076876339a6236f4f
[thirdparty/openwrt.git] /
1 From 55faf2eb5190410941aaabdc5bbd2c74c27f546e Mon Sep 17 00:00:00 2001
2 From: David Plowman <david.plowman@raspberrypi.com>
3 Date: Thu, 15 Feb 2024 13:35:04 +0000
4 Subject: [PATCH 1099/1135] drivers: staging: bcm2835-isp: Respect caller's
5 stride value
6
7 The stride value reported for output image buffers should be at least
8 as large as any value that was passed in by the caller (subject to
9 correct alignment for the pixel format). If the value is zero (meaning
10 no value was passed), or is too small, the minimum acceptable value
11 will be substituted.
12
13 Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
14 ---
15 .../staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c | 6 ++++--
16 1 file changed, 4 insertions(+), 2 deletions(-)
17
18 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
19 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
20 @@ -1050,8 +1050,10 @@ static int bcm2835_isp_node_try_fmt(stru
21 f->fmt.pix.quantization = V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, f->fmt.pix.colorspace,
22 f->fmt.pix.ycbcr_enc);
23
24 - f->fmt.pix.bytesperline = get_bytesperline(f->fmt.pix.width,
25 - fmt);
26 + /* Respect any stride value (suitably aligned) that was requested. */
27 + f->fmt.pix.bytesperline = max(get_bytesperline(f->fmt.pix.width, fmt),
28 + ALIGN(f->fmt.pix.bytesperline,
29 + fmt->bytesperline_align));
30 f->fmt.pix.field = V4L2_FIELD_NONE;
31 f->fmt.pix.sizeimage =
32 get_sizeimage(f->fmt.pix.bytesperline, f->fmt.pix.width,