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 24F8FC77B75 for ; Tue, 18 Apr 2023 09:37:57 +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=X+F9oxSgNU01m8ckZWDkWDsdoVGYfPQ6jIq+okj3sZ0=; b=RqbRSD3+TR+fYW CkC6pjfm/CCA6t8HO7u5vpNHrMYGUKcRc4sotOXZOIulj5VvlYpJ2BT5oFCdER6dRWnf0XuyW4tCY 6OqaAd1S2v1mtdd8Gerr4OEMlydPnR/pL+wbWMK1NlC5Nqa/D/K2hmavIvuDSDY/0etexzgwNi4kU UybpndTS+h3dwYypYxx8ktV0TtL8u2urdU5q6Oex8NZ8t5V+9LS3gAuf7GePyfW6OFrbby12UDYi9 38Fny1ZFf5ZP/zdD+lqgOAr470llpkBkSLyVsan2/CzC47GSQZRkGMusoean9MRUnq0MaPgywUdOC S2EyV1Wh1Ep95/YRLyJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pohlx-001VBf-1u; Tue, 18 Apr 2023 09:37:13 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pohlu-001VAj-2f for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 09:37:12 +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 ECAF0127D; Tue, 18 Apr 2023 11:37:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1681810623; bh=BuvVA/eUtX+MtG0B7mDmn50EABHQOACAO6fOd96O2BY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HZ2kZlXKA5SXkaJEqnJH1DZOb5cHGH9uNJpGtFXy1jlcAq7iWOrHrfWUc1R/VeNTG /x8QFI3au/eflskDI/2KEtuPamvkKSwU7dUY/XYt3VQW25BHe7mp4evr8dLvdq1cOT NVXBrnft6Y2nagqNrFzsZiZFfDyEZDKPOjAZuSpQ= Date: Tue, 18 Apr 2023 12:37:21 +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 v2 3/3] media: imx: imx7-media-csi: Lift width constraints for 8bpp formats Message-ID: <20230418093721.GB11510@pendragon.ideasonboard.com> References: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> <20230418071439.197735-4-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230418071439.197735-4-alexander.stein@ew.tq-group.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_023711_008591_4731FBDC X-CRM114-Status: GOOD ( 17.79 ) 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 Tue, Apr 18, 2023 at 09:14:39AM +0200, Alexander Stein wrote: > For 8-bit formats the image_width just needs to be a multiple of 4 pixels. This doesn't match the code below. I think the code is right, the commit message should be updated. > Signed-off-by: Alexander Stein > --- > drivers/media/platform/nxp/imx7-media-csi.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c > index 1508f6ba20e91..5240670476b2b 100644 > --- a/drivers/media/platform/nxp/imx7-media-csi.c > +++ b/drivers/media/platform/nxp/imx7-media-csi.c > @@ -1147,6 +1147,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, > { > const struct imx7_csi_pixfmt *cc; > u32 stride; > + u32 walign; > > /* > * Find the pixel format, default to the first supported format if not > @@ -1172,7 +1173,13 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, > } > } > > - v4l_bound_align_image(&pixfmt->width, 1, 0xffff, 8, > + /* Refer to CSI_IMAG_PARA.IMAGE_WIDTH description */ > + if (cc->bpp == 8) > + walign = 8; > + else > + walign = 4; > + > + v4l_bound_align_image(&pixfmt->width, 1, 0xffff, walign, > &pixfmt->height, 1, 0xffff, 1, 0); > > stride = round_up((pixfmt->width * cc->bpp) / 8, 8); -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel