[RFC,1/5] media: ov6650: Fix V4L2_SEL_FLAG_KEEP_CONFIG handling
Commit Message
This flag is now ignored - output frame size is affected by new crop
settings regardless of the flag value. Fix it.
Since keeping output frame size untouched while applying new crop
settings is not supported, simply return results of .get_selection() if
V4L2_SEL_FLAG_KEEP_CONFIG is passed to .set_selection().
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/media/i2c/ov6650.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -484,6 +484,10 @@ static int ov6650_set_selection(struct v4l2_subdev *sd,
sel->target != V4L2_SEL_TGT_CROP)
return -EINVAL;
+ /* No support for changing crop rectangle with frame size preserved */
+ if (sel->flags & V4L2_SEL_FLAG_KEEP_CONFIG)
+ return ov6650_get_selection(sd, cfg, sel);
+
v4l_bound_align_image(&sel->r.width, 2, W_CIF, 1,
&sel->r.height, 2, H_CIF, 1, 0);
v4l_bound_align_image(&sel->r.left, DEF_HSTRT << 1,