diff mbox series

[v3,2/4] media: imx: imx7-media-csi: Remove interlave fields

Message ID 20230418122041.1318862-3-alexander.stein@ew.tq-group.com (mailing list archive)
State New, archived
Headers show
Series Fix imx7-media-csi format settings | expand

Commit Message

Alexander Stein April 18, 2023, 12:20 p.m. UTC
Interlaced mode is currently not supported, so disable fields in try_fmt.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Changes in v3:
* Remove left-over interlace mode check

 drivers/media/platform/nxp/imx7-media-csi.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

Comments

Laurent Pinchart April 18, 2023, 3:43 p.m. UTC | #1
Hi Alexander,

Thank you for the patch.

In the subject line, "interlave" is misspelled. I'd write "Remove
incorrect interlacing support"

On Tue, Apr 18, 2023 at 02:20:39PM +0200, Alexander Stein wrote:
> Interlaced mode is currently not supported, so disable fields in try_fmt.

And here,

The driver doesn't currently support interlacing, but due to legacy
leftovers, it accepts values for the pixel format "field" field other
than V4L2_FIELD_NONE. Fix it by hardcoding V4L2_FIELD_NONE. Proper
interlacing support can be implemented later if desired.

With this,

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

I can apply those changes directly to my tree if you would prefer
avoiding a v4.

> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> Changes in v3:
> * Remove left-over interlace mode check
> 
>  drivers/media/platform/nxp/imx7-media-csi.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
> index b149374b07ee1..1315f5743b76f 100644
> --- a/drivers/media/platform/nxp/imx7-media-csi.c
> +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> @@ -1162,20 +1162,6 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
>  		cc = imx7_csi_find_pixel_format(pixfmt->pixelformat);
>  	}
>  
> -	/* Allow IDMAC interweave but enforce field order from source. */
> -	if (V4L2_FIELD_IS_INTERLACED(pixfmt->field)) {
> -		switch (pixfmt->field) {
> -		case V4L2_FIELD_SEQ_TB:
> -			pixfmt->field = V4L2_FIELD_INTERLACED_TB;
> -			break;
> -		case V4L2_FIELD_SEQ_BT:
> -			pixfmt->field = V4L2_FIELD_INTERLACED_BT;
> -			break;
> -		default:
> -			break;
> -		}
> -	}
> -
>  	/*
>  	 * Round up width for minimum burst size.
>  	 *
> @@ -1187,6 +1173,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
>  
>  	pixfmt->bytesperline = pixfmt->width * cc->bpp / 8;
>  	pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;
> +	pixfmt->field = V4L2_FIELD_NONE;
>  
>  	return cc;
>  }
Alexander Stein April 19, 2023, 7:02 a.m. UTC | #2
Hi Laurent,

Am Dienstag, 18. April 2023, 17:43:51 CEST schrieb Laurent Pinchart:
> Hi Alexander,
> 
> Thank you for the patch.
> 
> In the subject line, "interlave" is misspelled. I'd write "Remove
> incorrect interlacing support"

Sounds much better, thanks. I'll change that.

> On Tue, Apr 18, 2023 at 02:20:39PM +0200, Alexander Stein wrote:
> > Interlaced mode is currently not supported, so disable fields in try_fmt.
> 
> And here,
> 
> The driver doesn't currently support interlacing, but due to legacy
> leftovers, it accepts values for the pixel format "field" field other
> than V4L2_FIELD_NONE. Fix it by hardcoding V4L2_FIELD_NONE. Proper
> interlacing support can be implemented later if desired.
> 
> With this,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I can apply those changes directly to my tree if you would prefer
> avoiding a v4.

Thanks, as Patch 3/4 need another round anyway. I'll update accordingly and 
resend.

Best regards,
Alexander

> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> > Changes in v3:
> > * Remove left-over interlace mode check
> > 
> >  drivers/media/platform/nxp/imx7-media-csi.c | 15 +--------------
> >  1 file changed, 1 insertion(+), 14 deletions(-)
> > 
> > diff --git a/drivers/media/platform/nxp/imx7-media-csi.c
> > b/drivers/media/platform/nxp/imx7-media-csi.c index
> > b149374b07ee1..1315f5743b76f 100644
> > --- a/drivers/media/platform/nxp/imx7-media-csi.c
> > +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> > @@ -1162,20 +1162,6 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format
> > *pixfmt,> 
> >  		cc = imx7_csi_find_pixel_format(pixfmt->pixelformat);
> >  	
> >  	}
> > 
> > -	/* Allow IDMAC interweave but enforce field order from source. */
> > -	if (V4L2_FIELD_IS_INTERLACED(pixfmt->field)) {
> > -		switch (pixfmt->field) {
> > -		case V4L2_FIELD_SEQ_TB:
> > -			pixfmt->field = V4L2_FIELD_INTERLACED_TB;
> > -			break;
> > -		case V4L2_FIELD_SEQ_BT:
> > -			pixfmt->field = V4L2_FIELD_INTERLACED_BT;
> > -			break;
> > -		default:
> > -			break;
> > -		}
> > -	}
> > -
> > 
> >  	/*
> >  	
> >  	 * Round up width for minimum burst size.
> >  	 *
> > 
> > @@ -1187,6 +1173,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format
> > *pixfmt,> 
> >  	pixfmt->bytesperline = pixfmt->width * cc->bpp / 8;
> >  	pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;
> > 
> > +	pixfmt->field = V4L2_FIELD_NONE;
> > 
> >  	return cc;
> >  
> >  }
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 b149374b07ee1..1315f5743b76f 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -1162,20 +1162,6 @@  __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
 		cc = imx7_csi_find_pixel_format(pixfmt->pixelformat);
 	}
 
-	/* Allow IDMAC interweave but enforce field order from source. */
-	if (V4L2_FIELD_IS_INTERLACED(pixfmt->field)) {
-		switch (pixfmt->field) {
-		case V4L2_FIELD_SEQ_TB:
-			pixfmt->field = V4L2_FIELD_INTERLACED_TB;
-			break;
-		case V4L2_FIELD_SEQ_BT:
-			pixfmt->field = V4L2_FIELD_INTERLACED_BT;
-			break;
-		default:
-			break;
-		}
-	}
-
 	/*
 	 * Round up width for minimum burst size.
 	 *
@@ -1187,6 +1173,7 @@  __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
 
 	pixfmt->bytesperline = pixfmt->width * cc->bpp / 8;
 	pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;
+	pixfmt->field = V4L2_FIELD_NONE;
 
 	return cc;
 }