diff mbox series

[v2,09/23] media: ov5640: Fix 720x480 in RGB888 mode

Message ID 20220210110458.152494-10-jacopo@jmondi.org
State Superseded
Headers show
Series media: ov5640: Rework the clock tree programming for MIPI | expand

Commit Message

Jacopo Mondi Feb. 10, 2022, 11:04 a.m. UTC
Adjust the left crop of 720x480 to enable capture in RGB888 format,
which is otherwise broken.

The 56 pixels alignment has been copied from the 720x576 mode.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/i2c/ov5640.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart Feb. 20, 2022, 12:50 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Thu, Feb 10, 2022 at 12:04:44PM +0100, Jacopo Mondi wrote:
> Adjust the left crop of 720x480 to enable capture in RGB888 format,
> which is otherwise broken.

How is it broken ?

> The 56 pixels alignment has been copied from the 720x576 mode.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  drivers/media/i2c/ov5640.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
> index 9ba1b44d21f7..f817f865ad16 100644
> --- a/drivers/media/i2c/ov5640.c
> +++ b/drivers/media/i2c/ov5640.c
> @@ -746,7 +746,7 @@ ov5640_mode_data[OV5640_NUM_MODES] = {
>  			.height	= 1947,
>  		},
>  		.crop = {
> -			.left	= 16,
> +			.left	= 56,

The values look weird. The mode has an analog crop width of 2624, and
uses subsampling. After subsampling the width is thus 1312, and a left
offset of 16 or 56 for the crop rectangle thus output an image that
isn't centered.

Regardless, given that the centering issue preexists, if this fixes the
problem,

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

>  			.top	= 60,
>  			.width	= 720,
>  			.height	= 480,
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 9ba1b44d21f7..f817f865ad16 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -746,7 +746,7 @@  ov5640_mode_data[OV5640_NUM_MODES] = {
 			.height	= 1947,
 		},
 		.crop = {
-			.left	= 16,
+			.left	= 56,
 			.top	= 60,
 			.width	= 720,
 			.height	= 480,