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 59EBEC77B75 for ; Tue, 18 Apr 2023 10:01:51 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vYwMpCuDUV5xUwDddOCgxMK+jjsnlp1/KRsbERf2dO0=; b=ckH78UYCWqGKZZ plmmXMmHLhNXDQGSZ02tc0y/QXz2ERPIbcnvS3DUNLo0Gpr2GPiADMRGv4/Y55z0nJ94fhltXWcYQ ulGTIxBU2fv0pncmTjvpk1l2gKq46+pRmOmdMlNHrJkve+nJ6ZIZOnc3X4P4Q+M3udarXlX920OFW QqIupvUB6xIugptlTCCIk2ZZZRpWZtRmy63pAH0If2nBPeHoq7Jb7MLQfbldL1iJGuAPU08+tgbe2 ynWhrBxg8X56uSNsh2xfaBDRhNqHiVqYJ+DmfG7sIZpauCliivxMsgBAdrSEfhPX/bEv4445A5e58 +Y8/+p+o+ss3hkIGuFhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1poi8y-001ZcH-1v; Tue, 18 Apr 2023 10:01:00 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1poi8t-001Zar-38 for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 10:00:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681812056; x=1713348056; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dWWlwOleC3JsfX7CKvESIahpJItJm1NO1du1T9ChI2E=; b=nhLtIOKhKO6qxVsp6KMajcKRxktmMMX8aOBug0tkmMhq1HHMrG7O9x4q 9NlGECN0gIak0b2Znpak9e2sxDIY5T0zheHYIXBju2N9EdrqMbJhbU578 EJEOFjtCD8IP0oEVBl9vYiRKY8AKI3tt3bLDjKzFq3RwhApYHrFPXjjRt LRjgtnwasNL0L2jz7o/0CpchtTLYnmqakd++dp93wNAiNbmKnFW5PU2wO AJX2hA9u/+8PwDG1lRKYtXLnRIVVYOLYkCX+3/heatfvFYpQZvsDXofFb YMSbqLrAbNV2K9Bb2Y6LINsHl8Z6oGJGRA3V3NXnta1HsQC19J/q2aOWU Q==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30394096" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 18 Apr 2023 12:00:51 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 18 Apr 2023 12:00:51 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 18 Apr 2023 12:00:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681812051; x=1713348051; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dWWlwOleC3JsfX7CKvESIahpJItJm1NO1du1T9ChI2E=; b=GlmZBsT0vNSogUilwe9w/g5MyOgDMEatQV5mTaQUDB+wKCsxNAweC4mI SQ2WQ0Jmj3ELgHTPR8zCCJZGtM0KJc97CVxru+nrQW0xX6arB0SnjJuv3 Hje/Gjjt8hZI+F5dP6O7Qddm0w8QPMJlNmB9Uvi8p7QXPLuCFTM7Jd3IG hrnEZ7nU/PctJp9tUV9LcusmVVEk99lNqXP8HgbiAGreCQ51M/Lmeg/yg zWjdtXN93rwrNV1K2Ky2uihwHtdtp/5xnifxPyYptJegM00/wH45L1THT 5BZ2L+kUR94O98cDBrcNeMeHaSKk6hgtIeBq7Ck4tZjghEFrY+ym1egQ/ w==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30394094" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Apr 2023 12:00:51 +0200 Received: from steina-w.localnet (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id C6EA4280056; Tue, 18 Apr 2023 12:00:50 +0200 (CEST) From: Alexander Stein To: Laurent Pinchart 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 1/3] media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fmt_to_pix_fmt Date: Tue, 18 Apr 2023 12:00:43 +0200 Message-ID: <6038523.lOV4Wx5bFT@steina-w> Organization: TQ-Systems GmbH In-Reply-To: <20230418092713.GA26319@pendragon.ideasonboard.com> References: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> <20230418071439.197735-2-alexander.stein@ew.tq-group.com> <20230418092713.GA26319@pendragon.ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_030056_393942_EF287655 X-CRM114-Status: GOOD ( 30.70 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Laurent, thanks or your feedback. Am Dienstag, 18. April 2023, 11:27:13 CEST schrieb Laurent Pinchart: > Hi Alexander, > = > Thank you for the patch. > = > On Tue, Apr 18, 2023 at 09:14:37AM +0200, Alexander Stein wrote: > > There is no need to convert input pixformat to mbus_framefmt and back > > again. Instead apply pixformat width contrains directly. > > = > > Signed-off-by: Alexander Stein > > --- > > = > > drivers/media/platform/nxp/imx7-media-csi.c | 14 +++++++++----- > > 1 file changed, 9 insertions(+), 5 deletions(-) > > = > > diff --git a/drivers/media/platform/nxp/imx7-media-csi.c > > b/drivers/media/platform/nxp/imx7-media-csi.c index > > b701e823436a8..bd649fd9166fd 100644 > > --- a/drivers/media/platform/nxp/imx7-media-csi.c > > +++ b/drivers/media/platform/nxp/imx7-media-csi.c > > @@ -1145,8 +1145,8 @@ 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; > > = > > + u32 stride; > > = > > /* > > = > > * Find the pixel format, default to the first supported format if = not > > = > > @@ -1172,12 +1172,16 @@ __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); > = > Could you please keep the comment from imx7_csi_mbus_fmt_to_pix_fmt() > here, to indicate where the alignment comes from ? Sure, why not. > /* Round up width for minimum burst size */ > = > We should likely revisit this in the future, I don't think the alignment > is actually needed. This could be recorded already: > = > /* > * Round up width for minimum burst size. > * > * TODO: Implement configurable stride support, and check what the = real > * hardware alignment constraint on the width is. > */ Sounds good. I was already suspecting actual stride support is not supporte= d, = as FBUF_PARA is set to 0 (in non-interlaced mode). > > + v4l_bound_align_image(&pixfmt->width, 1, 0xffff, 8, > > + &pixfmt->height, 1, 0xffff, 1, 0); > > + > > + stride =3D round_up((pixfmt->width * cc->bpp) / 8, 8); > = > You can drop the round_up(), as pixfmt->width is now a multiple of 8, so > = > pixfmt->bytesperline =3D pixfmt->width * cc->bpp / 8; But that is only identical if cc->bpp =3D=3D 8, or am I missing something h= ere? > > + pixfmt->bytesperline =3D stride; > > + pixfmt->sizeimage =3D stride * pixfmt->height; > > = > > if (compose) { > > = > > - compose->width =3D fmt_src.width; > > - compose->height =3D fmt_src.height; > > + compose->width =3D pixfmt->width; > = > This is a change of behaviour, compose->width used to be set to the > unaligned width. Oh, you are right. I'll fix that. Best regards, Alexander > > + compose->height =3D pixfmt->height; > > = > > } > > = > > return cc; -- = TQ-Systems GmbH | M=FChlstra=DFe 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht M=FCnchen, HRB 105018 Gesch=E4ftsf=FChrer: Detlef Schneider, R=FCdiger Stahl, Stefan Schneider http://www.tq-group.com/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel