From patchwork Fri Sep 24 10:06:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dorota Czaplejewicz X-Patchwork-Id: 12514977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92A50C433F5 for ; Fri, 24 Sep 2021 10:19:02 +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 5EF8560EE7 for ; Fri, 24 Sep 2021 10:19:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5EF8560EE7 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: MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id: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=CSuVlX+S00TWnOXlb4qaALJb8ilmOQBQtWh5bMweOKA=; b=Q2m TYgYjGYt6V7OE8wSylXxspUUO7uY3aWq0xsDZ/VTnDwIhL1HJ01m14uBQ0gKjdBVI7aRUwGJVCG1x a5yFmW1gVSrtaU6XxnuX+A9mjUpOXUiTZn3wpPZ1FTGgdUy0mnf9+HaAWg0AL4mKPQLUeIw4o500k NVsDnzOuEp/yg9xqkEY7meCvHqAsCsQ7Sw+1riE/z30fQERtRXyfBTh0Glx1IvyP/ApbQwKpPHzCQ 5SBfxDTywjUyjReaO9/4tZ/mpLzt+x2KJu75yJRruJ8Qw7S2CZP6MWlgCkuksq2CFLteF/Iue0wD0 O5hmAk8AHzQUSIdFL7Eao6pOXnI+G2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTiGO-00E5WE-MY; Fri, 24 Sep 2021 10:17:04 +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 1mTiGJ-00E5VU-Vq for linux-arm-kernel@lists.infradead.org; Fri, 24 Sep 2021 10:17:01 +0000 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id A7B1DDF4E2; Fri, 24 Sep 2021 03:06:38 -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 K32DZ-SiYatL; Fri, 24 Sep 2021 03:06:38 -0700 (PDT) Date: Fri, 24 Sep 2021 12:06:31 +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: Fix rounding Message-ID: <20210924120631.7060da0f.dorota.czaplejewicz@puri.sm> Organization: Purism X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210924_031700_044389_DEF056A9 X-CRM114-Status: GOOD ( 11.38 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Change rounding to the minimal burst size from 2^n to n. This fixes images with sizes that are a multiple of 8 pixels. See section 13.7.6.13 CSI Image Parameter Register of the i.MX 8M Quad Applications Processors Reference Manual. Fixes: 451a7b7815d0b ("media: imx: lift CSI and PRP ENC/VF width alignment restriction") Signed-off-by: Dorota Czaplejewicz --- Hi, I tested this patch on the Librem 5 with the main camera. --Dorota drivers/staging/media/imx/imx-media-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 5128915a5d6f..a2d8fab32a39 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, 3); /* Round up stride for IDMAC line start address alignment */ if (cc->planar) - stride = round_up(width, 16); + stride = round_up(width, 4); else - stride = round_up((width * cc->bpp) >> 3, 8); + stride = round_up((width * cc->bpp) >> 3, 3); pix->width = width; pix->height = mbus->height;