Message ID | 20181011092107.30715-13-maxime.ripard@bootlin.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | media: ov5640: Misc cleanup and improvements | expand |
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.ripard@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.
Hi Hugues, On Mon, Oct 15, 2018 at 01:57:40PM +0000, Hugues FRUCHET wrote: > This is already fixed in media tree: > 0929983e49c81c1d413702cd9b83bb06c4a2555c media: ov5640: fix framerate update My bad then, I missed it, thanks! Maxime
You're welcome ;) On 10/16/2018 09:10 AM, Maxime Ripard wrote: > Hi Hugues, > > On Mon, Oct 15, 2018 at 01:57:40PM +0000, Hugues FRUCHET wrote: >> This is already fixed in media tree: >> 0929983e49c81c1d413702cd9b83bb06c4a2555c media: ov5640: fix framerate update > > My bad then, I missed it, thanks! > Maxime >
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) {
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.ripard@bootlin.com> --- drivers/media/i2c/ov5640.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)