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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 9F4DAC4741F for ; Wed, 4 Nov 2020 10:57:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2415E20867 for ; Wed, 4 Nov 2020 10:57:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q89uLwMg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2415E20867 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject: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:List-Owner; bh=znJCT+hQHYe98ajkGlXu2g0LBfmCava2YFQlK3Pe7HU=; b=q89uLwMgwwjQBFoTwusArHpIe 7hiCgiCG0c20mNqb3Vo/ZxVSWal67B38++CVvKAHGbuQ6QSeuxIVTe7/ZMG8kwlgFb2+AEDGhI+Ks UZUtq4wSQnx7ol4eMh7bmWJmJ63P74vvQTvWRzQs0NTO1tsV8zlapC9eIYnYWjJ5R95Lhg/bldu/O fjHAF/M816/3fK7eGfRSCqEKUb8+CUYTsZ5pEKXz19ESwjNWanGCrbpKRbDeB0G8QnDspufWfhpbK eWs4cgg2z+dMrAUgoarRWPPFg5NlE2j8TZRg8WAYC8TcpmnnsQ8CKhmGva929jmICIFbTBn3FjC/H SflID2F6Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaGSy-0002V8-Gd; Wed, 04 Nov 2020 10:56:36 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaGSq-0002Pw-9I for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 10:56:33 +0000 Received: from aptenodytes (196.109.29.93.rev.sfr.net [93.29.109.196]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id EB48C100004; Wed, 4 Nov 2020 10:56:19 +0000 (UTC) Date: Wed, 4 Nov 2020 11:56:19 +0100 From: Paul Kocialkowski To: Helen Koike Subject: Re: [PATCH 04/14] media: sun6i-csi: Fix the image storage bpp for 10/12-bit Bayer formats Message-ID: <20201104105619.GG285779@aptenodytes> References: <20201023174546.504028-1-paul.kocialkowski@bootlin.com> <20201023174546.504028-5-paul.kocialkowski@bootlin.com> <60fc4f85-e08f-fec6-5687-005add5cbeed@collabora.com> MIME-Version: 1.0 In-Reply-To: <60fc4f85-e08f-fec6-5687-005add5cbeed@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_055628_597829_A0E7B9C5 X-CRM114-Status: GOOD ( 24.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Philipp Zabel , Kishon Vijay Abraham I , Thomas Petazzoni , Greg Kroah-Hartman , =?utf-8?B?S8OpdmluIEwnaMO0cGl0YWw=?= , linux-kernel@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , Hans Verkuil , linux-sunxi@googlegroups.com, Rob Herring , Vinod Koul , Yong Deng , Sakari Ailus , Hans Verkuil , Mauro Carvalho Chehab , kevin.lhopital@hotmail.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: multipart/mixed; boundary="===============6302692325275347408==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6302692325275347408== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c7hkjup166d4FzgN" Content-Disposition: inline --c7hkjup166d4FzgN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Helen, On Fri 30 Oct 20, 19:45, Helen Koike wrote: > Hi Paul, >=20 > On 10/23/20 2:45 PM, Paul Kocialkowski wrote: > > Both 10 and 12-bit Bayer formats are stored aligned as 16-bit values > > in memory, not unaligned 10 or 12 bits. > >=20 > > Since the current code for retreiving the bpp is used only to > > calculate the memory storage size of the picture (which is what > > pixel formats describe, unlike media bus formats), fix it there. > >=20 > > Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s") > > Co-developed-by: K=C3=A9vin L'h=C3=B4pital > > Signed-off-by: K=C3=A9vin L'h=C3=B4pital > > Signed-off-by: Paul Kocialkowski > > --- > > .../platform/sunxi/sun6i-csi/sun6i_csi.h | 20 +++++++++---------- > > 1 file changed, 10 insertions(+), 10 deletions(-) > >=20 > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h b/drive= rs/media/platform/sunxi/sun6i-csi/sun6i_csi.h > > index c626821aaedb..7f2be70ae641 100644 > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h > > @@ -86,7 +86,7 @@ void sun6i_csi_update_buf_addr(struct sun6i_csi *csi,= dma_addr_t addr); > > */ > > void sun6i_csi_set_stream(struct sun6i_csi *csi, bool enable); > > =20 > > -/* get bpp form v4l2 pixformat */ > > +/* get memory storage bpp from v4l2 pixformat */ > > static inline int sun6i_csi_get_bpp(unsigned int pixformat) > > { > > switch (pixformat) { > > @@ -96,15 +96,6 @@ static inline int sun6i_csi_get_bpp(unsigned int pix= format) > > case V4L2_PIX_FMT_SRGGB8: > > case V4L2_PIX_FMT_JPEG: > > return 8; > > - case V4L2_PIX_FMT_SBGGR10: > > - case V4L2_PIX_FMT_SGBRG10: > > - case V4L2_PIX_FMT_SGRBG10: > > - case V4L2_PIX_FMT_SRGGB10: > > - return 10; > > - case V4L2_PIX_FMT_SBGGR12: > > - case V4L2_PIX_FMT_SGBRG12: > > - case V4L2_PIX_FMT_SGRBG12: > > - case V4L2_PIX_FMT_SRGGB12: > > case V4L2_PIX_FMT_HM12: > > case V4L2_PIX_FMT_NV12: > > case V4L2_PIX_FMT_NV21: > > @@ -121,6 +112,15 @@ static inline int sun6i_csi_get_bpp(unsigned int p= ixformat) > > case V4L2_PIX_FMT_RGB565: > > case V4L2_PIX_FMT_RGB565X: > > return 16; > > + case V4L2_PIX_FMT_SBGGR10: > > + case V4L2_PIX_FMT_SGBRG10: > > + case V4L2_PIX_FMT_SGRBG10: > > + case V4L2_PIX_FMT_SRGGB10: > > + case V4L2_PIX_FMT_SBGGR12: > > + case V4L2_PIX_FMT_SGBRG12: > > + case V4L2_PIX_FMT_SGRBG12: > > + case V4L2_PIX_FMT_SRGGB12: > > + return 16; > > case V4L2_PIX_FMT_RGB24: > > case V4L2_PIX_FMT_BGR24: > > return 24; > >=20 >=20 > Instead of updating this table, how about using v4l2_format_info() instea= d? Yes that would be a very good thing to do indeed! Thanks, Paul --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --c7hkjup166d4FzgN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAl+iiNMACgkQ3cLmz3+f v9HFXAf+N1l+y0ROoaUymhgezNhzMtVA6+rT/3K27Nviyx+yotMuLRVQx9kOrRIu NyOl92AbK3YHZoeBs3MG7x9K83Hg8jecHQfyWqXew7gsI5tzSwpkeUWJ4p3+BK3y Nr5TAxlDgeGKsys/03OBVp2MPBQEuh3CG+vx+g6VV0/j/xu7sRpt1HvK+loqHDnr pzTVenulCZlv5wpaO++e9qBlAJWT/dZ30dP89kjzmHg1ojS4gOwPK3n6urzvYYOL HyRYUKHCTMrAqiA3Oc8NshO3drPft1zmByfbbbcwi1tSFJGwHX4le2ai6uJzME6M mkdcnTQlloff4Y+k5HOQZpsbJtWchw== =kPUg -----END PGP SIGNATURE----- --c7hkjup166d4FzgN-- --===============6302692325275347408== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6302692325275347408==--