diff mbox series

[v2,2/3] media: imx: imx7-media-csi: Remove interlave fields

Message ID 20230418071439.197735-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, 7:14 a.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>
---
 drivers/media/platform/nxp/imx7-media-csi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart April 18, 2023, 9:34 a.m. UTC | #1
Hi Alexander,

Thank you for the patch.

On Tue, Apr 18, 2023 at 09:14:38AM +0200, Alexander Stein wrote:
> Interlaced mode is currently not supported, so disable fields in try_fmt.
>
> 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 bd649fd9166fd..1508f6ba20e91 100644
> --- a/drivers/media/platform/nxp/imx7-media-csi.c
> +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> @@ -1178,6 +1178,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,

You should also drop the following code in the same function:

	/* 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;
		}
	}

>  	stride = round_up((pixfmt->width * cc->bpp) / 8, 8);
>  	pixfmt->bytesperline = stride;
>  	pixfmt->sizeimage = stride * pixfmt->height;
> +	pixfmt->field = V4L2_FIELD_NONE;
>  
>  	if (compose) {
>  		compose->width = pixfmt->width;
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 bd649fd9166fd..1508f6ba20e91 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -1178,6 +1178,7 @@  __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
 	stride = round_up((pixfmt->width * cc->bpp) / 8, 8);
 	pixfmt->bytesperline = stride;
 	pixfmt->sizeimage = stride * pixfmt->height;
+	pixfmt->field = V4L2_FIELD_NONE;
 
 	if (compose) {
 		compose->width = pixfmt->width;