From 67d36ab44018ada1fdb490fb965b29aa2b58a4d5 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 4 Jul 2022 18:10:23 +0100 Subject: [PATCH 1/2] media: i2c: ov9281: Correct min/def vts for 640x400 A VTS of 421 in the 640x400 mode only streams at 130.2fps instead of the expected ~261fps. This appears to be an invalid value for the sensor, as a VTS of 422 works fine to give 259.79fps. Set the minimum (and default) to 422. Signed-off-by: Dave Stevenson --- drivers/media/i2c/ov9281.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov9281.c b/drivers/media/i2c/ov9281.c index 0a5f9e0927aecb..2fb40e63c5856b 100644 --- a/drivers/media/i2c/ov9281.c +++ b/drivers/media/i2c/ov9281.c @@ -369,7 +369,7 @@ static const struct ov9281_mode supported_modes[] = { .height = 400, .exp_def = 0x0320, .hts_def = 0x05b0, - .vts_def = 421, + .vts_def = 422, .crop = { .left = 0, .top = 0, From 000fc32d14ea824e163f27d36097b6f67c043342 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 4 Jul 2022 18:12:56 +0100 Subject: [PATCH 2/2] media: i2c: ov9281: Change exposure default value with mode choice When the exposure range is updated due to changing VBLANK, adopt the mode default value, not the current default. Should the specific default value be outside of the min/max range defined, then the whole update is rejected, which can leave an invalid exposure range active. Signed-off-by: Dave Stevenson --- drivers/media/i2c/ov9281.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov9281.c b/drivers/media/i2c/ov9281.c index 2fb40e63c5856b..552b658479532c 100644 --- a/drivers/media/i2c/ov9281.c +++ b/drivers/media/i2c/ov9281.c @@ -976,7 +976,7 @@ static int ov9281_set_ctrl(struct v4l2_ctrl *ctrl) __v4l2_ctrl_modify_range(ov9281->exposure, ov9281->exposure->minimum, max, ov9281->exposure->step, - ov9281->exposure->default_value); + ov9281->cur_mode->vts_def); break; }