9c1fa2ba622b4b6f10611dbc7ece6f1cd7efe584
[openwrt/staging/hauke.git] /
1 From 87bb03be2c8ab1db246181ebeaf2588cda3dfd31 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 }