diff mbox series

[v2,1/2] media: imx: imx7-media-csi: Fix mbus framefmt field init

Message ID 20230321072707.678039-2-alexander.stein@ew.tq-group.com (mailing list archive)
State New, archived
Headers show
Series imx7-media-csi: small cleanup | expand

Commit Message

Alexander Stein March 21, 2023, 7:27 a.m. UTC
'field' is zero-initialized to V4L2_FIELD_ANY, which is an invalid value
to return to userspace. Instead fefault to non-interleaving.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/media/platform/nxp/imx7-media-csi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart March 21, 2023, 9:37 a.m. UTC | #1
Hi Alexander,

Thank you for the patch.

On Tue, Mar 21, 2023 at 08:27:06AM +0100, Alexander Stein wrote:
> 'field' is zero-initialized to V4L2_FIELD_ANY, which is an invalid value
> to return to userspace. Instead fefault to non-interleaving.

I prefer defaulting to non-interleaving instead of fefaulting :-) I'll
fix the typo in my tree.

> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

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

> ---
>  drivers/media/platform/nxp/imx7-media-csi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
> index c22bf5c827e7..3e97b9f2ff69 100644
> --- a/drivers/media/platform/nxp/imx7-media-csi.c
> +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> @@ -1610,6 +1610,7 @@ static int imx7_csi_video_init_format(struct imx7_csi *csi)
>  	format.code = IMX7_CSI_DEF_MBUS_CODE;
>  	format.width = IMX7_CSI_DEF_PIX_WIDTH;
>  	format.height = IMX7_CSI_DEF_PIX_HEIGHT;
> +	format.field = V4L2_FIELD_NONE;
>  
>  	imx7_csi_mbus_fmt_to_pix_fmt(&csi->vdev_fmt, &format, NULL);
>  	csi->vdev_compose.width = format.width;
Alexander Stein March 21, 2023, 10:08 a.m. UTC | #2
Hi Laurent,

Am Dienstag, 21. März 2023, 10:37:57 CET schrieb Laurent Pinchart:
> Hi Alexander,
> 
> Thank you for the patch.
> 
> On Tue, Mar 21, 2023 at 08:27:06AM +0100, Alexander Stein wrote:
> > 'field' is zero-initialized to V4L2_FIELD_ANY, which is an invalid value
> > to return to userspace. Instead fefault to non-interleaving.
> 
> I prefer defaulting to non-interleaving instead of fefaulting :-) I'll
> fix the typo in my tree.

Oh :-) thanks for fixing this.

Best regards,
Alexander

> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> > 
> >  drivers/media/platform/nxp/imx7-media-csi.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/media/platform/nxp/imx7-media-csi.c
> > b/drivers/media/platform/nxp/imx7-media-csi.c index
> > c22bf5c827e7..3e97b9f2ff69 100644
> > --- a/drivers/media/platform/nxp/imx7-media-csi.c
> > +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> > @@ -1610,6 +1610,7 @@ static int imx7_csi_video_init_format(struct
> > imx7_csi *csi)> 
> >  	format.code = IMX7_CSI_DEF_MBUS_CODE;
> >  	format.width = IMX7_CSI_DEF_PIX_WIDTH;
> >  	format.height = IMX7_CSI_DEF_PIX_HEIGHT;
> > 
> > +	format.field = V4L2_FIELD_NONE;
> > 
> >  	imx7_csi_mbus_fmt_to_pix_fmt(&csi->vdev_fmt, &format, NULL);
> >  	csi->vdev_compose.width = format.width;
Rui Miguel Silva March 21, 2023, 3 p.m. UTC | #3
Hi Alexander,

Alexander Stein <alexander.stein@ew.tq-group.com> writes:

> 'field' is zero-initialized to V4L2_FIELD_ANY, which is an invalid value
> to return to userspace. Instead fefault to non-interleaving.
>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Many thanks for adding this much better change log. (with the already
mention fefault fix from Laurent :) )

Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>

Cheers,
   Rui
> ---
>  drivers/media/platform/nxp/imx7-media-csi.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
> index c22bf5c827e7..3e97b9f2ff69 100644
> --- a/drivers/media/platform/nxp/imx7-media-csi.c
> +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> @@ -1610,6 +1610,7 @@ static int imx7_csi_video_init_format(struct imx7_csi *csi)
>  	format.code = IMX7_CSI_DEF_MBUS_CODE;
>  	format.width = IMX7_CSI_DEF_PIX_WIDTH;
>  	format.height = IMX7_CSI_DEF_PIX_HEIGHT;
> +	format.field = V4L2_FIELD_NONE;
>  
>  	imx7_csi_mbus_fmt_to_pix_fmt(&csi->vdev_fmt, &format, NULL);
>  	csi->vdev_compose.width = format.width;
> -- 
> 2.34.1
diff mbox series

Patch

diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
index c22bf5c827e7..3e97b9f2ff69 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -1610,6 +1610,7 @@  static int imx7_csi_video_init_format(struct imx7_csi *csi)
 	format.code = IMX7_CSI_DEF_MBUS_CODE;
 	format.width = IMX7_CSI_DEF_PIX_WIDTH;
 	format.height = IMX7_CSI_DEF_PIX_HEIGHT;
+	format.field = V4L2_FIELD_NONE;
 
 	imx7_csi_mbus_fmt_to_pix_fmt(&csi->vdev_fmt, &format, NULL);
 	csi->vdev_compose.width = format.width;