diff mbox series

[1/3] media: imx: imx7-media-csi: Fix mbus framefmt field init

Message ID 20230316143829.499039-2-alexander.stein@ew.tq-group.com
State Accepted
Commit e6f68b1c4048e97bb01b770fd9c487ecce6c5cab
Headers show
Series [1/3] media: imx: imx7-media-csi: Fix mbus framefmt field init | expand

Commit Message

Alexander Stein March 16, 2023, 2:38 p.m. UTC
Default to non-interleaving.

Fixes: bc0d3df31ffe ("media: imx: imx7-media-csi: Simplify imx7_csi_video_init_format()")
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

Rui Miguel Silva March 17, 2023, 5:20 p.m. UTC | #1
Hi Alexander,
Thanks for the patch.

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

> Default to non-interleaving.

Why?

>
> Fixes: bc0d3df31ffe ("media: imx: imx7-media-csi: Simplify imx7_csi_video_init_format()")

It was never init to FIELD_NONE even before this patch, do you think it
is really a fix?

Cheers,
  Rui

> 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(+)
>
> 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
Laurent Pinchart March 17, 2023, 6:28 p.m. UTC | #2
Hello,

On Fri, Mar 17, 2023 at 05:20:55PM +0000, Rui Miguel Silva wrote:
> Hi Alexander,
> Thanks for the patch.
> 
> Alexander Stein <alexander.stein@ew.tq-group.com> writes:
> 
> > Default to non-interleaving.
> 
> Why?

Otherwise it is implicitly set to V4L2_FIELD_ANY as the structure is
zero-initialized, and that's not a valid value for drivers to return to
userspace. This should be explained in the commit message.

> > Fixes: bc0d3df31ffe ("media: imx: imx7-media-csi: Simplify imx7_csi_video_init_format()")
> 
> It was never init to FIELD_NONE even before this patch, do you think it
> is really a fix?

Commit bc0d3df31ffe does indeed not seem relevant.

The problem predates the destaging of the driver, it's a bit difficult
to trace. I'd drop the Fixes: tag.

> > 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(+)
> >
> > 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 17, 2023, 7:20 p.m. UTC | #3
Hi Laurent.

Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:

> Hello,
>
> On Fri, Mar 17, 2023 at 05:20:55PM +0000, Rui Miguel Silva wrote:
>> Hi Alexander,
>> Thanks for the patch.
>> 
>> Alexander Stein <alexander.stein@ew.tq-group.com> writes:
>> 
>> > Default to non-interleaving.
>> 
>> Why?
>
> Otherwise it is implicitly set to V4L2_FIELD_ANY as the structure is
> zero-initialized, and that's not a valid value for drivers to return to
> userspace. This should be explained in the commit message.

Yes, that was my intention, to have the why in the commit message.

Cheers,
  Rui

>
>> > Fixes: bc0d3df31ffe ("media: imx: imx7-media-csi: Simplify imx7_csi_video_init_format()")
>> 
>> It was never init to FIELD_NONE even before this patch, do you think it
>> is really a fix?
>
> Commit bc0d3df31ffe does indeed not seem relevant.
>
> The problem predates the destaging of the driver, it's a bit difficult
> to trace. I'd drop the Fixes: tag.
>
>> > 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(+)
>> >
>> > 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;
>
> -- 
> Regards,
>
> Laurent Pinchart
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;