From 7b7a2f9e9a3ce6d0e6ceb0fa614a3fbab067f62b Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 2 Feb 2021 16:46:39 +0000 Subject: [PATCH] staging/bcm2835-codec: Implement additional g_selection calls for decode v4l_cropcap calls our vidioc_g_pixelaspect function to get the pixel aspect ratio, but also calls g_selection for V4L2_SEL_TGT_CROP_BOUNDS and V4L2_SEL_TGT_CROP_DEFAULT. Whilst it allows for vidioc_g_pixelaspect not to be implemented, it doesn't allow for either of the other two. Add in support for the additional selection targets. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c index 5cbc7213c77529..3b1ffe6b0ab1c0 100644 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c @@ -1544,6 +1544,14 @@ static int vidioc_g_selection(struct file *file, void *priv, s->r.width = q_data->crop_width; s->r.height = q_data->crop_height; break; + case V4L2_SEL_TGT_CROP_BOUNDS: + case V4L2_SEL_TGT_CROP_DEFAULT: + s->r.left = 0; + s->r.top = 0; + s->r.width = (q_data->bytesperline << 3) / + q_data->fmt->depth; + s->r.height = q_data->height; + break; default: return -EINVAL; }