]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: imx: imx7-media-csi: Fix video field handling
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 10 Mar 2020 16:06:29 +0000 (17:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 08:50:01 +0000 (10:50 +0200)
[ Upstream commit 8447c0880cfa6c456fed006feed952a77775403f ]

Commit c5c3a48061b5 ("media: imx: Try colorimetry at both sink and
source pads") reworked the way that formats are set on the sink pad of
the CSI subdevice, and accidentally removed video field handling.
Restore it by defaulting to V4L2_FIELD_NONE if the field value isn't
supported, with the only two supported value being V4L2_FIELD_NONE and
V4L2_FIELD_INTERLACED.

Fixes: c5c3a48061b5 ("media: imx: Try colorimetry at both sink and source pads")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/imx/imx7-media-csi.c

index bfd6b5fbf4841d35670b2d1d20648169c158f4e1..d24897d06947fad25c77b5d046e1821faf5342bf 100644 (file)
@@ -1009,6 +1009,7 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi,
                sdformat->format.width = in_fmt->width;
                sdformat->format.height = in_fmt->height;
                sdformat->format.code = in_fmt->code;
+               sdformat->format.field = in_fmt->field;
                *cc = in_cc;
 
                sdformat->format.colorspace = in_fmt->colorspace;
@@ -1023,6 +1024,9 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi,
                                                         false);
                        sdformat->format.code = (*cc)->codes[0];
                }
+
+               if (sdformat->format.field != V4L2_FIELD_INTERLACED)
+                       sdformat->format.field = V4L2_FIELD_NONE;
                break;
        default:
                return -EINVAL;