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 0DA3FC77B75 for ; Tue, 18 Apr 2023 15:36:02 +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=Kn+I813Pg4SMGaD+MhQqT5mfeG8d7x/K0lvmS5R9l0U=; b=nmkCrHfyjHqL/m u3p62pb8bMw4ROJlrM/NOUBKrWyfIjy1yyMvqOZ+SggB4ma34j7krnix4XRAZ4l3RsAEeFzhPYtXO gJXJeteudvrLwgiGXkORwcip5tyNDOxVqIhRysEFqfFSlzH1KZM0k/X925dVJkKYHQmDZwYhtJLu5 MQTQW0Fke397d2rXpD3h7F7L8GifAHLudoIU3iNLEHXBkIZ0byyL2240tMNgtUXw4yEyYfyvybIfl Imm4vbf65Z8zjJKNapQYLrPGnRfSU6aS6ehfklCCM80BCxC56i9ENn1eG3+hrsnlOePPTXxzQGblM Q7n0J9PBPS1IoTjpkdIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ponMO-002dhv-1n; Tue, 18 Apr 2023 15:35:12 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ponML-002dfa-0a for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 15:35:11 +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 5EC91DE5; Tue, 18 Apr 2023 17:35:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1681832101; bh=29CZDdB3OmL7lnZ3wrZfr9S5Q96+fW831dciXVD/HpA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S+QN1d6IRVsc21sLlcFTuAqKtF3R2ec0YCJqpqVQkRK9TQfxCF/TQkcNRSFbqTS5K 87uV/THfd1dHFRdM/B0VOW8f1uFzpwnFvUDeoM3DvLhXuKbcwwy5nuFdeLB/34SSTk xrmO6+S0SVJwaJX32k+eE0UGMWFaGf4DZRlPndWo= Date: Tue, 18 Apr 2023 18:35:18 +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 v3 1/4] media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fmt_to_pix_fmt Message-ID: <20230418153518.GG30837@pendragon.ideasonboard.com> References: <20230418122041.1318862-1-alexander.stein@ew.tq-group.com> <20230418122041.1318862-2-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230418122041.1318862-2-alexander.stein@ew.tq-group.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_083509_380354_C4FC72B3 X-CRM114-Status: GOOD ( 19.62 ) 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 02:20:38PM +0200, Alexander Stein wrote: > There is no need to convert input pixformat to mbus_framefmt and back > again. Instead apply pixformat width constrains directly. > Assign compose values before adjusting pixformat height/width. > > Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart > --- > Changes in v3: > * Move compose assignment before width adjustments > * Add comments regarding width multiples > * Remove unneeded stride rounding > > drivers/media/platform/nxp/imx7-media-csi.c | 22 ++++++++++++++------- > 1 file changed, 15 insertions(+), 7 deletions(-) > > diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c > index b701e823436a8..b149374b07ee1 100644 > --- a/drivers/media/platform/nxp/imx7-media-csi.c > +++ b/drivers/media/platform/nxp/imx7-media-csi.c > @@ -1145,9 +1145,13 @@ static const struct imx7_csi_pixfmt * > __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, > struct v4l2_rect *compose) > { > - struct v4l2_mbus_framefmt fmt_src; > const struct imx7_csi_pixfmt *cc; > > + if (compose) { > + compose->width = pixfmt->width; > + compose->height = pixfmt->height; > + } > + > /* > * Find the pixel format, default to the first supported format if not > * found. > @@ -1172,13 +1176,17 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, > } > } > > - v4l2_fill_mbus_format(&fmt_src, pixfmt, 0); > - imx7_csi_mbus_fmt_to_pix_fmt(pixfmt, &fmt_src, cc); > + /* > + * Round up width for minimum burst size. > + * > + * TODO: Implement configurable stride support, and check what the real > + * hardware alignment constraint on the width is. > + */ > + v4l_bound_align_image(&pixfmt->width, 1, 0xffff, 8, > + &pixfmt->height, 1, 0xffff, 1, 0); > > - if (compose) { > - compose->width = fmt_src.width; > - compose->height = fmt_src.height; > - } > + pixfmt->bytesperline = pixfmt->width * cc->bpp / 8; > + pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height; > > return cc; > } -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel