bcm27xx: add support for linux v5.15
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0486-staging-bcm2835-codec-Change-the-default-codec-res-t.patch
1 From ac2682411d03cf2951abf2856aeaf10206e700fc Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 13 May 2021 11:56:21 +0100
4 Subject: [PATCH] staging/bcm2835-codec: Change the default codec res
5 to 32x32
6
7 In order to effectively guarantee that a V4L2_EVENT_SOURCE_CHANGE
8 event occurs, adopt a default resolution of 32x32 so that it
9 is incredibly unlikely to be decoding a stream of that resolution
10 and therefore failing to note a "change" requiring the event.
11
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
13 ---
14 .../bcm2835-codec/bcm2835-v4l2-codec.c | 15 +++++++++++++--
15 1 file changed, 13 insertions(+), 2 deletions(-)
16
17 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
19 @@ -97,8 +97,19 @@ static const char * const components[] =
20 #define MAX_W 1920
21 #define MAX_H 1920
22 #define BPL_ALIGN 32
23 -#define DEFAULT_WIDTH 640
24 -#define DEFAULT_HEIGHT 480
25 +/*
26 + * The decoder spec supports the V4L2_EVENT_SOURCE_CHANGE event, but the docs
27 + * seem to want it to always be generated on startup, which prevents the client
28 + * from configuring the CAPTURE queue based on any parsing it has already done
29 + * which may save time and allow allocation of CAPTURE buffers early. Surely
30 + * SOURCE_CHANGE means something has changed, not just "always notify".
31 + *
32 + * For those clients that don't set the CAPTURE resolution, adopt a default
33 + * resolution that is seriously unlikely to be correct, therefore almost
34 + * guaranteed to get the SOURCE_CHANGE event.
35 + */
36 +#define DEFAULT_WIDTH 32
37 +#define DEFAULT_HEIGHT 32
38 /*
39 * The unanswered question - what is the maximum size of a compressed frame?
40 * V4L2 mandates that the encoded frame must fit in a single buffer. Sizing