media: rcar-vin: Do not reset the crop and compose rectangles in s_fmt

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>
This commit is contained in:
Niklas Söderlund 2019-09-04 18:54:07 -03:00 committed by Mauro Carvalho Chehab
parent 20aca4a33b
commit 104464f573

View 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;