bcm27xx: add linux 5.4 support
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0302-staging-bcm2835-codec-Correct-bytesperline-on-format.patch
1 From eb4cbf0e6893397f00aff0f90dc9d3df75e98b52 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 11 Jul 2019 14:58:35 +0100
4 Subject: [PATCH] staging: bcm2835-codec: Correct bytesperline on
5 format changed
6
7 The handling of format changed events incorrectly set bytesperline
8 to the cropped width, which ignored padding and formats with
9 more than 8bpp.
10 Fix these.
11
12 Reported by: zillevdr <zillevdr@gmx.de>
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
14 ---
15 .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 +++-
16 1 file changed, 3 insertions(+), 1 deletion(-)
17
18 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
19 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
20 @@ -759,7 +759,9 @@ static void handle_fmt_changed(struct bc
21
22 q_data->crop_width = format->es.video.crop.width;
23 q_data->crop_height = format->es.video.crop.height;
24 - q_data->bytesperline = format->es.video.crop.width;
25 + q_data->bytesperline = get_bytesperline(format->es.video.width,
26 + q_data->fmt);
27 +
28 q_data->height = format->es.video.height;
29 q_data->sizeimage = format->buffer_size_min;
30 if (format->es.video.color_space)