5b9cd745c53baa8a3fdce3d823062e7115c2b050
[openwrt/staging/noltari.git] / target / linux / bcm27xx / patches-5.10 / 950-0503-staging-bcm2835-codec-Implement-additional-g_selecti.patch
1 From ba936c1969753c11ed4f903d007f7e6a9e2d8abb Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 2 Feb 2021 16:46:39 +0000
4 Subject: [PATCH] staging/bcm2835-codec: Implement additional
5 g_selection calls for decode
6
7 v4l_cropcap calls our vidioc_g_pixelaspect function to get the pixel
8 aspect ratio, but also calls g_selection for V4L2_SEL_TGT_CROP_BOUNDS
9 and V4L2_SEL_TGT_CROP_DEFAULT. Whilst it allows for vidioc_g_pixelaspect
10 not to be implemented, it doesn't allow for either of the other two.
11
12 Add in support for the additional selection targets.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 8 ++++++++
17 1 file changed, 8 insertions(+)
18
19 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
20 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
21 @@ -1517,6 +1517,14 @@ static int vidioc_g_selection(struct fil
22 s->r.width = q_data->crop_width;
23 s->r.height = q_data->crop_height;
24 break;
25 + case V4L2_SEL_TGT_CROP_BOUNDS:
26 + case V4L2_SEL_TGT_CROP_DEFAULT:
27 + s->r.left = 0;
28 + s->r.top = 0;
29 + s->r.width = (q_data->bytesperline << 3) /
30 + q_data->fmt->depth;
31 + s->r.height = q_data->height;
32 + break;
33 default:
34 return -EINVAL;
35 }