From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DBDD7C77B72 for ; Thu, 20 Apr 2023 10:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/SmK0Dl3SeuLpj02kTZ/STuVYNdKYQgzOzOixCAa/ks=; b=bheEZfNUYc+H86 eF4qBlZ+TAM9tXhemsB9ZzATp3c95/FC3aSx53MBd8v5CfBp7zV/M48XjXEcnfSZSemrXv5zrZxs4 z3/cbKjhdwo8gav8jV4YZCneFhlAjmKlmzYrQMZVoGF7CjbXmxSUvElQhGqypr1XZvjGZzL9gbQKU 4l+cvAL/chztnDcZB7BzpkWc3gNOYQMZiOo+7YcxPkifhAnmgfC11tVlVf/L8oHM08VkR4LTCQ9u4 GD/0Od3QsEzCq0ppavqAaqMmKRe9YoVUgBv4v+zokWVtY0Xxlv5n4t9pVCznSV6Z52Lk+m1GNOF1j DjGpDGcuybWrN2p0boSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppRb5-007hAI-1h; Thu, 20 Apr 2023 10:33:03 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ppRaz-007h94-2P for linux-arm-kernel@lists.infradead.org; Thu, 20 Apr 2023 10:33:01 +0000 Received: from pendragon.ideasonboard.com (133-32-181-51.west.xps.vectant.ne.jp [133.32.181.51]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D797D5AA; Thu, 20 Apr 2023 12:32:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1681986765; bh=z7JqXntV/ozWgmPY7FKQzTroECPSQd/UrgMWJu9QwCU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CjYX1o9/oyXR7PwvrTi9iTQBg3KULtvrYLoeN+5iEcRV+4F02eljvlXHTKqI6uPK1 YUdYdGt2ul/YMuKz5LaOcfyFssjRYwa3+yrgueEfiCBFgdkZHdfx4oKU+O4k962NrM kLDB2DxAHurUpgLiJGadaADTzioYmDJ4OvWMC7wc= Date: Thu, 20 Apr 2023 13:33:05 +0300 From: Laurent Pinchart To: Alexander Stein Cc: Rui Miguel Silva , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Fabio Estevam , Pengutronix Kernel Team , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 3/4] media: imx: imx7-media-csi: Relax width constraints for non-8bpp formats Message-ID: <20230420103305.GC11005@pendragon.ideasonboard.com> References: <20230419070712.1422335-1-alexander.stein@ew.tq-group.com> <20230419070712.1422335-4-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230419070712.1422335-4-alexander.stein@ew.tq-group.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230420_033257_946309_E9DD2B0C X-CRM114-Status: GOOD ( 17.40 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Alexander, Thank you for the patch. On Wed, Apr 19, 2023 at 09:07:11AM +0200, Alexander Stein wrote: > The driver unconditionally aligns the image width to multiples of 8 > pixels. The real alignment constraint is 8 bytes, as indicated by the > CSI_IMAG_PARA.IMAGE_WIDTH documentation that calls for 8 pixel alignment > for 8bpp formats and 4 pixel alignment for other formats. > > Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart > --- > Changes in v4: > * Improve commit message > * Simplify walign calculation > * Remove comment on hardware alignment constraints > > drivers/media/platform/nxp/imx7-media-csi.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c > index 1315f5743b76f..e6abbfbc5c129 100644 > --- a/drivers/media/platform/nxp/imx7-media-csi.c > +++ b/drivers/media/platform/nxp/imx7-media-csi.c > @@ -1146,6 +1146,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, > struct v4l2_rect *compose) > { > const struct imx7_csi_pixfmt *cc; > + u32 walign; > > if (compose) { > compose->width = pixfmt->width; > @@ -1163,12 +1164,13 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, > } > > /* > - * Round up width for minimum burst size. > + * The width alignment is 8 bytes as indicated by the > + * CSI_IMAG_PARA.IMAGE_WIDTH documentation. Convert it to pixels. > * > - * TODO: Implement configurable stride support, and check what the real > - * hardware alignment constraint on the width is. > + * TODO: Implement configurable stride support. > */ > - v4l_bound_align_image(&pixfmt->width, 1, 0xffff, 8, > + walign = 8 * 8 / cc->bpp; > + v4l_bound_align_image(&pixfmt->width, 1, 0xffff, walign, > &pixfmt->height, 1, 0xffff, 1, 0); > > pixfmt->bytesperline = pixfmt->width * cc->bpp / 8; -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel