@@ -1147,6 +1147,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
{
const struct imx7_csi_pixfmt *cc;
u32 stride;
+ u32 walign;
/*
* Find the pixel format, default to the first supported format if not
@@ -1172,7 +1173,13 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
}
}
- v4l_bound_align_image(&pixfmt->width, 1, 0xffff, 8,
+ /* Refer to CSI_IMAG_PARA.IMAGE_WIDTH description */
+ if (cc->bpp == 8)
+ walign = 8;
+ else
+ walign = 4;
+
+ v4l_bound_align_image(&pixfmt->width, 1, 0xffff, walign,
&pixfmt->height, 1, 0xffff, 1, 0);
stride = round_up((pixfmt->width * cc->bpp) / 8, 8);
For 8-bit formats the image_width just needs to be a multiple of 4 pixels. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> --- drivers/media/platform/nxp/imx7-media-csi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)