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: 12539117 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 7C80FC433EF for ; Wed, 6 Oct 2021 11:07:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4DBC9610E5 for ; Wed, 6 Oct 2021 11:07:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4DBC9610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=puri.sm Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=SVuSHpJY88LOIN3OTwOr9EuqF9WVNR35Z+8bdKm9KVM=; b=ac3 IcpCcBw8QekU8gUqaw87rxScZOgCOy69V4z++ZTMTtMJc0fmmDaf52ur5ar/eMZ9VqXAahyUS1rEN DNJnbXF5vXALHXC07xQnVmUXOzJatbzTBfTMeXjsviraFrOpL0KxN9xVLBsNfDZhVFvUJEqXeVKEZ 7GP3W2v5f+WXEu4mhky9pZZpSNewBtXnvaoyVMMvbLQpoKGJPdc03bUwJNSqa5CZh3cwwi22i0mgK 0KEBica76e8DEN8S8cmN7bbi5wH/2qETq0nRn6XkEwftRg47LPHXv10DHLJX+s5vMnAKTcjUtHLRn WXR0UdE1LEm5FWlM0o0AcySrHsfq8TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mY4kQ-00Dy17-Qp; Wed, 06 Oct 2021 11:06:06 +0000 Received: from comms.puri.sm ([159.203.221.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mY4kM-00Dxzd-Ck for linux-arm-kernel@lists.infradead.org; Wed, 06 Oct 2021 11:06:04 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211006_040602_452461_998BB76D X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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;