]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: rcar-vin: Do not reset the crop and compose rectangles in s_fmt
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Wed, 4 Sep 2019 21:54:07 +0000 (18:54 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 1 Oct 2019 20:08:33 +0000 (17:08 -0300)
The crop and compose rectangles are reset when s_fmt is called
resulting in potentially valid rectangles being lost when updating the
format. Fix this by mapping the rectangles inside the new format.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/rcar-vin/rcar-v4l2.c

index 4d01a13ad14eee68e0f42e96fafeebf4bbd101bc..3f175e2e0a9a13890cb4bd0eec705c3f5d13912d 100644 (file)
@@ -283,8 +283,8 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv,
                return ret;
 
        vin->format = f->fmt.pix;
-       vin->crop = crop;
-       vin->compose = compose;
+       v4l2_rect_map_inside(&vin->crop, &crop);
+       v4l2_rect_map_inside(&vin->compose, &compose);
        vin->src_rect = crop;
 
        return 0;