All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: imx: Round line size to 4 bytes
@ 2021-10-06 11:05 ` Dorota Czaplejewicz
  0 siblings, 0 replies; 12+ messages in thread
From: Dorota Czaplejewicz @ 2021-10-06 11:05 UTC (permalink / raw)
  To: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	linux-media, linux-staging, linux-arm-kernel, linux-kernel
  Cc: kernel, phone-devel

[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]

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@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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-18 10:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 11:05 [PATCH] media: imx: Round line size to 4 bytes Dorota Czaplejewicz
2021-10-06 11:05 ` Dorota Czaplejewicz
2021-10-08 12:19 ` Philipp Zabel
2021-10-08 12:19   ` Philipp Zabel
2021-10-13  9:26   ` Dorota Czaplejewicz
2021-10-13  9:26     ` Dorota Czaplejewicz
2021-10-14 11:26     ` Philipp Zabel
2021-10-14 11:26       ` Philipp Zabel
2021-10-17 11:07       ` Dorota Czaplejewicz
2021-10-17 11:07         ` Dorota Czaplejewicz
2021-10-18 10:21         ` Philipp Zabel
2021-10-18 10:21           ` Philipp Zabel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.