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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 6E2B4CA9EA0 for ; Tue, 22 Oct 2019 13:18:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3F72D21783 for ; Tue, 22 Oct 2019 13:18:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gDciYbCb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F72D21783 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+infradead-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=bombadil.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=ojCRtw6bMgyR+68xYs0SCIxTgzP+mdJqCkqfx0/938k=; b=gDciYbCb+cMBMoU02xeNV8Z9y 41yre03AwCajsTTx09XZkCcpMtjYEE5tX00E3sPrp45kx3bOiOvD257vbyD0fmnG714r9DkVLYpp0 JDIbNygOaUo963e0rD2JgFRZMLkfCJherwhuvKDv/KWE4muv9IRCZk34wsl7eMIrkRQMa9Xaht4az 78+WiuPoIWGLnJLEkr/cvdavNhdqa9WxDX01uAuVX2Qvy8GYwvyQG/mI2/DWztdAGPg1kIQVBnHqw o6awl+pAgTSFCaaOsSUVkFid0Qs8NQw1yt/tzC2jP1fAOPI3LFgjPVYNz+tSqsqHDm7nZq2U2rUwX iLLs/6VrA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMu3T-0007xx-D0; Tue, 22 Oct 2019 13:18:31 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMu31-0007Z5-1W for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2019 13:18:05 +0000 X-Originating-IP: 86.250.200.211 Received: from aptenodytes (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id E4C1920019; Tue, 22 Oct 2019 13:17:51 +0000 (UTC) Date: Tue, 22 Oct 2019 15:17:51 +0200 From: Paul Kocialkowski To: Mauro Carvalho Chehab Subject: Re: [PATCH v8 3/3] media: cedrus: Add HEVC/H.265 decoding support Message-ID: <20191022131751.GE2651@aptenodytes> References: <20190927143411.141526-1-paul.kocialkowski@bootlin.com> <20190927143411.141526-4-paul.kocialkowski@bootlin.com> <20191017095751.5a229051@coco.lan> <20191022124012.GD2651@aptenodytes> MIME-Version: 1.0 In-Reply-To: <20191022124012.GD2651@aptenodytes> User-Agent: Mutt/1.12.2 (2019-09-21) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191022_061803_472478_49458D1A X-CRM114-Status: GOOD ( 22.51 ) 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: Nicolas Dufresne , Jernej Skrabec , Jonas Karlman , Chen-Yu Tsai , Maxime Ripard , linux-kernel@vger.kernel.org, Hans Verkuil , linux-sunxi@googlegroups.com, Thomas Petazzoni , Tomasz Figa , Ezequiel Garcia , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: multipart/mixed; boundary="===============6604539588210186291==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6604539588210186291== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AbQceqfdZEv+FvjW" Content-Disposition: inline --AbQceqfdZEv+FvjW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi again, On Tue 22 Oct 19, 14:40, Paul Kocialkowski wrote: > Hi Mauro and thanks for the review, >=20 > On Thu 17 Oct 19, 09:57, Mauro Carvalho Chehab wrote: > > Em Fri, 27 Sep 2019 16:34:11 +0200 > > Paul Kocialkowski escreveu: > >=20 > > > This introduces support for HEVC/H.265 to the Cedrus VPU driver, with > > > both uni-directional and bi-directional prediction modes supported. > > >=20 > > > Field-coded (interlaced) pictures, custom quantization matrices and > > > 10-bit output are not supported at this point. > > >=20 > > > Signed-off-by: Paul Kocialkowski > > > --- > >=20 > > ... > >=20 > > > + unsigned int ctb_size_luma =3D > > > + 1 << log2_max_luma_coding_block_size; > >=20 > > Shifts like this is a little scary. "1" constant is signed. So, if > > log2_max_luma_coding_block_size is 31, the above logic has undefined > > behavior. Different archs and C compilers may handle it on different > > ways. >=20 > I wasn't aware that it was the case, thanks for bringing this to light! > I'll make it 1UL then. >=20 > > > +#define VE_DEC_H265_LOW_ADDR_PRIMARY_CHROMA(a) \ > > > + (((a) << 24) & GENMASK(31, 24)) > >=20 > > Same applies here and on other similar macros. You need to enforce > > (a) to be unsigned, as otherwise the behavior is undefined. > >=20 > > Btw, this is a recurrent pattern on this file. I would define a > > macro, e. g. something like: > >=20 > > #define MASK_BITS_AND_SHIFT(v, high, low) \ > > ((UL(v) << low) & GENMASK(high, low)) > >=20 > > And use it for all similar patterns here. >=20 > Sounds good! I find that the reverse wording (SHIFT_AND_MASK_BITS) would = be > a bit more explicit since the shift happens prior to the mask. Apparently the UL(v) macro just appends UL to v in preprocessor, so it won't work with anything else than direct integers. I'll replace it with a (unsigned long) cast, that seems to do the job. Cheers, Paul > Also we probably need to have parenthesis around "low", right? >=20 > > The best would be to include such macro at linux/bits.h, although some > > upstream discussion is required. > >=20 > > So, for now, let's add it at this header file, but work upstream > > to have it merged there. >=20 > Understood, I'll include it in that header for now and send a separate pa= tch > for inclusion in linux/bits.h (apparently the preprocessor doesn't care a= bout > redefinitions so we can just remove the cedrus fashion once the common on= e is > in). >=20 > What do you think? >=20 > Cheers, >=20 > Paul --=20 Developer of free digital technology and hardware support. Website: https://www.paulk.fr/ Coding blog: https://code.paulk.fr/ Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/ --AbQceqfdZEv+FvjW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAl2vAX8ACgkQ3cLmz3+f v9ETIwgAoQrWpxchaAG6DmiijZJfUkjHe2aPTZmNqmRokQJJbqr2V+i0yMM97x0n 5R9a/EvXyH+upMG6rFlIkp9bk5pHALcUdo8SNKenHuQLzpFFdPTfKdAsSmYvaCn6 si2GMwjdcM7hFl26OvPyEidF34yqkqHbGo5WSS87777Cu+TY9TeWdFMrAPiCOJkc xMDmwWO2w9CdIrJZ6z8FHaAeMQuYS0gsxZdcM/j3ok93tE8NuPU95qdS/mN1a5WJ 06gDjQAFV8E52yNtys6D7JWAAuU3Heq6IJaDx0Ql/jDcLmSmITgvVMicFXJE6K4X uKLrQkHxHYijHGY3FrP+q8i7SsThrg== =i+cM -----END PGP SIGNATURE----- --AbQceqfdZEv+FvjW-- --===============6604539588210186291== 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 --===============6604539588210186291==--