[PATCH] media: imx: Round line size to 4 bytes

Dorota Czaplejewicz dorota.czaplejewicz at puri.sm
Wed Oct 6 04:05:44 PDT 2021


Section 13.7.6.13 "CSI Image Parameter Register" of the
i.MX 8M Quad Applications Processors Reference Manual
states that the line size should be divisible by 8 bytes.
However, the hardware also accepts sizes divisible by 4 bytes.

This patch accepts line sizes divisible 4-bytes in non-planar mode.

Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz at puri.sm>
---

Hello,

my previous patch identified something that was not a problem,
so I'm sending a different one.

This has been tested on the Librem 5.

Cheers,
Dorota

 drivers/staging/media/imx/imx-media-utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index 5128915a5d6f..a303003929e3 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -545,13 +545,13 @@ int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
 	}
 
 	/* Round up width for minimum burst size */
-	width = round_up(mbus->width, 8);
+	width = round_up(mbus->width, 4);
 
 	/* Round up stride for IDMAC line start address alignment */
 	if (cc->planar)
 		stride = round_up(width, 16);
 	else
-		stride = round_up((width * cc->bpp) >> 3, 8);
+		stride = round_up((width * cc->bpp) >> 3, 4);
 
 	pix->width = width;
 	pix->height = mbus->height;
-- 
2.31.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211006/5d2d3417/attachment.sig>


More information about the linux-arm-kernel mailing list