From: Niklas Söderlund Date: Wed, 4 Sep 2019 21:54:07 +0000 (-0300) Subject: media: rcar-vin: Do not reset the crop and compose rectangles in s_fmt X-Git-Tag: for-linus-20191205~90^2^2~318 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=104464f573d5e1c58e2901fce209fc4682b6f8e3;p=linux-2.6-block.git 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 Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 4d01a13ad14e..3f175e2e0a9a 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -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;