66f82668950f431e588356baac947377f8c0efe0
[openwrt/staging/nbd.git] /
1 From b90151e3519ca2e8944dd1565999ad6ac5c4fb51 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 752/782] 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)