diff mbox series

[v2,07/18] media: i2c: imx219: Initialize ycbcr_enc

Message ID 20230821223001.28480-8-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: i2c: imx219: Miscellaneous cleanups and improvements | expand

Commit Message

Laurent Pinchart Aug. 21, 2023, 10:29 p.m. UTC
While the ycbcr_enc field doesn't apply to raw formats, leaving it
uninitialized makes the driver behave in a less deterministic way. Fix
it by picking the default value for the colorspace.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes since v1:

- Use V4L2_YCBCR_ENC_601
---
 drivers/media/i2c/imx219.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dave Stevenson Aug. 22, 2023, 4:30 p.m. UTC | #1
On Mon, 21 Aug 2023 at 23:30, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> While the ycbcr_enc field doesn't apply to raw formats, leaving it
> uninitialized makes the driver behave in a less deterministic way. Fix
> it by picking the default value for the colorspace.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

> ---
> Changes since v1:
>
> - Use V4L2_YCBCR_ENC_601
> ---
>  drivers/media/i2c/imx219.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
> index 3a0b082d9ee0..16776a3ae84d 100644
> --- a/drivers/media/i2c/imx219.c
> +++ b/drivers/media/i2c/imx219.c
> @@ -499,6 +499,7 @@ static void imx219_update_pad_format(struct imx219 *imx219,
>         fmt->height = mode->height;
>         fmt->field = V4L2_FIELD_NONE;
>         fmt->colorspace = V4L2_COLORSPACE_RAW;
> +       fmt->ycbcr_enc = V4L2_YCBCR_ENC_601;
>         fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE;
>         fmt->xfer_func = V4L2_XFER_FUNC_NONE;
>  }
> --
> Regards,
>
> Laurent Pinchart
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index 3a0b082d9ee0..16776a3ae84d 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -499,6 +499,7 @@  static void imx219_update_pad_format(struct imx219 *imx219,
 	fmt->height = mode->height;
 	fmt->field = V4L2_FIELD_NONE;
 	fmt->colorspace = V4L2_COLORSPACE_RAW;
+	fmt->ycbcr_enc = V4L2_YCBCR_ENC_601;
 	fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE;
 	fmt->xfer_func = V4L2_XFER_FUNC_NONE;
 }