Hi Maxime,

This is already fixed in media tree:
0929983e49c81c1d413702cd9b83bb06c4a2555c media: ov5640: fix framerate update


On 10/11/2018 11:21 AM, Maxime Ripard wrote:
> The current logic only requires to call ov5640_set_mode, which will in turn
> change the clock rates according to the mode and frame interval, when a new
> mode is set up.
> 
> However, when only the frame interval is changed but the mode isn't,
> ov5640_set_mode is never called and the resulting frame rate will be old or
> default one. Fix this by requiring that ov5640_set_mode is called when the
> frame interval is changed as well.
> 
> Signed-off-by: Maxime Ripard <maxime.rip...@bootlin.com>
> ---
>   drivers/media/i2c/ov5640.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
> index 818411400ef6..e01d2cb93c67 100644
> --- a/drivers/media/i2c/ov5640.c
> +++ b/drivers/media/i2c/ov5640.c
> @@ -2638,8 +2638,12 @@ static int ov5640_s_frame_interval(struct v4l2_subdev 
> *sd,
>               goto out;
>       }
>   
> -     sensor->current_fr = frame_rate;
> -     sensor->frame_interval = fi->interval;
> +     if (frame_rate != sensor->current_fr) {
> +             sensor->current_fr = frame_rate;
> +             sensor->frame_interval = fi->interval;
> +             sensor->pending_mode_change = true;
> +     }
> +
>       mode = ov5640_find_mode(sensor, frame_rate, mode->hact,
>                               mode->vact, true);
>       if (!mode) {
> 

BR,
Hugues.

Reply via email to