Commit dd419105 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

media: imx: imx7_mipi_csis: Fix input size alignment

The alignments given to the v4l_bound_align_image() are expressed in
bytes, while the function expects them to be expressed as a power of
two. Fix it.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 5c7cf0f3
...@@ -831,25 +831,25 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *mipi_sd, ...@@ -831,25 +831,25 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *mipi_sd,
*/ */
switch (csis_fmt->width % 8) { switch (csis_fmt->width % 8) {
case 0: case 0:
align = 1; align = 0;
break; break;
case 4: case 4:
align = 2; align = 1;
break; break;
case 2: case 2:
case 6: case 6:
align = 4; align = 2;
break; break;
case 1: case 1:
case 3: case 3:
case 5: case 5:
case 7: case 7:
align = 8; align = 3;
break; break;
} }
v4l_bound_align_image(&fmt->width, 1, CSIS_MAX_PIX_WIDTH, align, v4l_bound_align_image(&fmt->width, 1, CSIS_MAX_PIX_WIDTH, align,
&fmt->height, 1, CSIS_MAX_PIX_HEIGHT, 1, 0); &fmt->height, 1, CSIS_MAX_PIX_HEIGHT, 0, 0);
sdformat->format = *fmt; sdformat->format = *fmt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment