From patchwork Wed Oct 6 11:05:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dorota Czaplejewicz X-Patchwork-Id: 12539105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F041C433F5 for ; Wed, 6 Oct 2021 11:06:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61E62610FC for ; Wed, 6 Oct 2021 11:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238188AbhJFLIW (ORCPT ); Wed, 6 Oct 2021 07:08:22 -0400 Received: from comms.puri.sm ([159.203.221.185]:50232 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237931AbhJFLIV (ORCPT ); Wed, 6 Oct 2021 07:08:21 -0400 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 6C431E1339; Wed, 6 Oct 2021 04:05:59 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TEq-cT8BT5Xw; Wed, 6 Oct 2021 04:05:58 -0700 (PDT) Date: Wed, 6 Oct 2021 13:05:44 +0200 From: Dorota Czaplejewicz 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@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@puri.sm, phone-devel@vger.kernel.org Subject: [PATCH] media: imx: Round line size to 4 bytes Message-ID: <20211006110207.256325-1-dorota.czaplejewicz@puri.sm> Organization: Purism MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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;