[PATCH 02/13] media: i2c: ov5647: Correct pixel array offset

Jai Luthra posted 13 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH 02/13] media: i2c: ov5647: Correct pixel array offset
Posted by Jai Luthra 3 months, 2 weeks ago
From: David Plowman <david.plowman@raspberrypi.com>

The top offset in the pixel array is actually 6 (see page 3-1 of the
OV5647 data sheet).

Fixes: 14f70a3232aa ("media: ov5647: Add support for get_selection()")
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 drivers/media/i2c/ov5647.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index 985a8e81529d2f88cb38ccb8c94f8605026a28a9..4fed655f5a11c38e76d1ccc9ae9155cf945684ab 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -69,7 +69,7 @@
 #define OV5647_NATIVE_HEIGHT		1956U
 
 #define OV5647_PIXEL_ARRAY_LEFT		16U
-#define OV5647_PIXEL_ARRAY_TOP		16U
+#define OV5647_PIXEL_ARRAY_TOP		6U
 #define OV5647_PIXEL_ARRAY_WIDTH	2592U
 #define OV5647_PIXEL_ARRAY_HEIGHT	1944U
 

-- 
2.51.0
Re: [PATCH 02/13] media: i2c: ov5647: Correct pixel array offset
Posted by Jacopo Mondi 3 months, 1 week ago
Hi Jai

On Tue, Oct 28, 2025 at 12:57:13PM +0530, Jai Luthra wrote:
> From: David Plowman <david.plowman@raspberrypi.com>
>
> The top offset in the pixel array is actually 6 (see page 3-1 of the
> OV5647 data sheet).
>
> Fixes: 14f70a3232aa ("media: ov5647: Add support for get_selection()")
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>

The patch is correct and match the datasheet, but I wonder what the
implications of having a wrong top were..

I see the full 2592x1944 mode declaring 1944 lines but, as the top row
was set to 16, it means the mode should read 10 lines past the end of
the sensor's pixel array..

Anyway, on the patch
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> ---
>  drivers/media/i2c/ov5647.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
> index 985a8e81529d2f88cb38ccb8c94f8605026a28a9..4fed655f5a11c38e76d1ccc9ae9155cf945684ab 100644
> --- a/drivers/media/i2c/ov5647.c
> +++ b/drivers/media/i2c/ov5647.c
> @@ -69,7 +69,7 @@
>  #define OV5647_NATIVE_HEIGHT		1956U
>
>  #define OV5647_PIXEL_ARRAY_LEFT		16U
> -#define OV5647_PIXEL_ARRAY_TOP		16U
> +#define OV5647_PIXEL_ARRAY_TOP		6U
>  #define OV5647_PIXEL_ARRAY_WIDTH	2592U
>  #define OV5647_PIXEL_ARRAY_HEIGHT	1944U
>
>
> --
> 2.51.0
>
>
Re: [PATCH 02/13] media: i2c: ov5647: Correct pixel array offset
Posted by Dave Stevenson 3 months ago
Hi Jacopo

On Sun, 2 Nov 2025 at 10:29, Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote:
>
> Hi Jai
>
> On Tue, Oct 28, 2025 at 12:57:13PM +0530, Jai Luthra wrote:
> > From: David Plowman <david.plowman@raspberrypi.com>
> >
> > The top offset in the pixel array is actually 6 (see page 3-1 of the
> > OV5647 data sheet).
> >
> > Fixes: 14f70a3232aa ("media: ov5647: Add support for get_selection()")
> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> > Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
>
> The patch is correct and match the datasheet, but I wonder what the
> implications of having a wrong top were..
>
> I see the full 2592x1944 mode declaring 1944 lines but, as the top row
> was set to 16, it means the mode should read 10 lines past the end of
> the sensor's pixel array..

It's not used in computing the register settings, only reported via
get_selection.

A user of the information from get_selection may get confused by
OV5647_PIXEL_ARRAY_TOP + OV5647_PIXEL_ARRAY_HEIGHT being greater than
OV5647_NATIVE_HEIGHT, but you'd still get images.

  Dave

> Anyway, on the patch
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
>
> Thanks
>   j
>
> > ---
> >  drivers/media/i2c/ov5647.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
> > index 985a8e81529d2f88cb38ccb8c94f8605026a28a9..4fed655f5a11c38e76d1ccc9ae9155cf945684ab 100644
> > --- a/drivers/media/i2c/ov5647.c
> > +++ b/drivers/media/i2c/ov5647.c
> > @@ -69,7 +69,7 @@
> >  #define OV5647_NATIVE_HEIGHT         1956U
> >
> >  #define OV5647_PIXEL_ARRAY_LEFT              16U
> > -#define OV5647_PIXEL_ARRAY_TOP               16U
> > +#define OV5647_PIXEL_ARRAY_TOP               6U
> >  #define OV5647_PIXEL_ARRAY_WIDTH     2592U
> >  #define OV5647_PIXEL_ARRAY_HEIGHT    1944U
> >
> >
> > --
> > 2.51.0
> >
> >