diff mbox series

[06/13] media: mt9m114: Tweak default hblank and vblank for more accurate fps

Message ID 20250504101336.18748-7-hdegoede@redhat.com
State New
Headers show
Series media: mt9m114: Changes to make it work with atomisp devices | expand

Commit Message

Hans de Goede May 4, 2025, 10:13 a.m. UTC
The PLL gets programmed to achieve a 48 MHz pixelclock, with the original
vblank + hblank defaults this results in a fps of:

48000000 / ((1296 + 307) * (976 + 23) = 29.974 fps

Tweak the defaults to get closer to 30 fps:

48000000 / ((1296 + 308) * (976 + 21) = 30.015 fps

This improves things from being 0.026 fps too low to 0.015 fps too high.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/i2c/mt9m114.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart May 9, 2025, 9:30 p.m. UTC | #1
Hi Hans,

Thank you for the patch.

On Sun, May 04, 2025 at 12:13:27PM +0200, Hans de Goede wrote:
> The PLL gets programmed to achieve a 48 MHz pixelclock, with the original

s/original/current/

> vblank + hblank defaults this results in a fps of:
> 
> 48000000 / ((1296 + 307) * (976 + 23) = 29.974 fps
> 
> Tweak the defaults to get closer to 30 fps:
> 
> 48000000 / ((1296 + 308) * (976 + 21) = 30.015 fps
> 
> This improves things from being 0.026 fps too low to 0.015 fps too high.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/mt9m114.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c
> index 52337c719e22..ba8b7660f88a 100644
> --- a/drivers/media/i2c/mt9m114.c
> +++ b/drivers/media/i2c/mt9m114.c
> @@ -331,8 +331,8 @@
>   */
>  #define MT9M114_MIN_HBLANK				303
>  #define MT9M114_MIN_VBLANK				21
> -#define MT9M114_DEF_HBLANK				307
> -#define MT9M114_DEF_VBLANK				23
> +#define MT9M114_DEF_HBLANK				308
> +#define MT9M114_DEF_VBLANK				21
>  
>  #define MT9M114_DEF_FRAME_RATE				30
>  #define MT9M114_MAX_FRAME_RATE				120
diff mbox series

Patch

diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c
index 52337c719e22..ba8b7660f88a 100644
--- a/drivers/media/i2c/mt9m114.c
+++ b/drivers/media/i2c/mt9m114.c
@@ -331,8 +331,8 @@ 
  */
 #define MT9M114_MIN_HBLANK				303
 #define MT9M114_MIN_VBLANK				21
-#define MT9M114_DEF_HBLANK				307
-#define MT9M114_DEF_VBLANK				23
+#define MT9M114_DEF_HBLANK				308
+#define MT9M114_DEF_VBLANK				21
 
 #define MT9M114_DEF_FRAME_RATE				30
 #define MT9M114_MAX_FRAME_RATE				120