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 3BD00C6FA82 for ; Mon, 12 Sep 2022 22:28:34 +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=ay/wKw+MGD1mop8H3RLUFSaYxo5KilFq2LO9jML8t0k=; b=L/3yS+0VK8//3t U7YwjtjCmn/ONi63glsydHSrdq8WhYomYZO+8PxgIJUAnyPBEocrZNzVi0rNrqzCyVyG0grSWCdtp pPbZJ9oW7bP7t0IhrVjwjSqkhamRDTWG09PyETYYeBv6uG3LAuyXETSP1ZQRK0LHejj/A8Y+qJKt2 GKNPonGCKbZQGHpXBXSqDqfeEOsNtpcgUL9L2WMZfwswWkv+He1oureYE087ZuQt7PICD3EjxaF3H cWf7IjXAo6OzCysGtFq5p7TDpmi4dumC2uX+qzQdQePJkXlQiNOswOJcCH9f1gsxVvd5HkNtx5Z3D f7JYliifx6RlW6B8DVdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXrti-00Eo37-Nv; Mon, 12 Sep 2022 22:27:22 +0000 Received: from 4.mo575.mail-out.ovh.net ([46.105.59.63]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXrte-00Enun-7R for linux-arm-kernel@lists.infradead.org; Mon, 12 Sep 2022 22:27:20 +0000 Received: from player750.ha.ovh.net (unknown [10.111.208.229]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 21F35233C0 for ; Mon, 12 Sep 2022 22:27:09 +0000 (UTC) Received: from etezian.org (bbcs-175-223.cust.wingo.ch [178.238.175.223]) (Authenticated sender: andi@etezian.org) by player750.ha.ovh.net (Postfix) with ESMTPSA id 4B5682E6847BB; Mon, 12 Sep 2022 22:26:39 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-95G0013efd0b66-a73e-45c9-bb98-e25c7815fbbb, 3B4E35B332874A0F69C0154FD1AC24ACCE6C8C6C) smtp.auth=andi@etezian.org X-OVh-ClientIp: 178.238.175.223 Date: Tue, 13 Sep 2022 00:26:36 +0200 From: Andi Shyti To: Smitha T Murthy Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, m.szyprowski@samsung.com, andrzej.hajda@intel.com, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@vanguardiasur.com.ar, jernej.skrabec@gmail.com, benjamin.gaignard@collabora.com, stanimir.varbanov@linaro.org, dillon.minfei@gmail.com, david.plowman@raspberrypi.com, mark.rutland@arm.com, robh+dt@kernel.org, krzk+dt@kernel.org, andi@etezian.org, alim.akhtar@samsung.com, aswani.reddy@samsung.com, pankaj.dubey@samsung.com, linux-fsd@tesla.com, aakarsh.jain@samsung.com Subject: Re: [Patch v2 04/15] media: s5p-mfc: Add initial support for MFCv12 Message-ID: References: <20220907064715.55778-1-smitha.t@samsung.com> <20220907064715.55778-5-smitha.t@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220907064715.55778-5-smitha.t@samsung.com> X-Ovh-Tracer-Id: 12842858766094371346 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfedufedgudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughiucfuhhihthhiuceorghnughisegvthgviihirghnrdhorhhgqeenucggtffrrghtthgvrhhnpeejgfelgeekieffjeegveeuvdehgeelveetveejudffvedvleehvdefleehudelueenucfkpheptddrtddrtddrtddpudejkedrvdefkedrudejhedrvddvfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjeehtddrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegrnhguihesvghtvgiiihgrnhdrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdgrrhhmqdhkvghrnhgvlheslhhishhtshdrihhnfhhrrgguvggrugdrohhrghdpoffvtefjohhsthepmhhoheejhe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220912_152718_615108_244E8B66 X-CRM114-Status: GOOD ( 14.16 ) 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 Smitha, just a fast look here [...] > +/* Encoder buffer size for MFCv12 */ > +#define ENC_V120_BASE_SIZE(x, y) \ > + (((x + 3) * (y + 3) * 8) \ > + + (((y * 64) + 2304) * (x + 7) / 8)) do we need any overflow control here? [...] > #define MFC_V7_BIT BIT(2) > #define MFC_V8_BIT BIT(3) > #define MFC_V10_BIT BIT(5) > +#define MFC_V12_BIT BIT(7) > > #define MFC_V5PLUS_BITS (MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | \ > - MFC_V8_BIT | MFC_V10_BIT) > + MFC_V8_BIT | MFC_V10_BIT | MFC_V12_BIT) > #define MFC_V6PLUS_BITS (MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT | \ > - MFC_V10_BIT) > -#define MFC_V7PLUS_BITS (MFC_V7_BIT | MFC_V8_BIT | MFC_V10_BIT) > + MFC_V10_BIT | MFC_V12_BIT) > +#define MFC_V7PLUS_BITS (MFC_V7_BIT | MFC_V8_BIT | MFC_V10_BIT | \ > + MFC_V12_BIT) why not MFC_V10PLUS_BITS ? [...] > @@ -146,7 +146,7 @@ static struct s5p_mfc_fmt formats[] = { > .codec_mode = S5P_FIMV_CODEC_HEVC_DEC, > .type = MFC_FMT_DEC, > .num_planes = 1, > - .versions = MFC_V10_BIT, > + .versions = MFC_V10_BIT | MFC_V12_BIT, we could just yse MFC_V10PLUS_BITS here [...] > + if (IS_MFCV12(dev)) { > + lcu_width = S5P_MFC_LCU_WIDTH(ctx->img_width); > + lcu_height = S5P_MFC_LCU_HEIGHT(ctx->img_height); > + if (ctx->codec_mode == S5P_FIMV_CODEC_HEVC_ENC && > + ctx->is_10bit) { > + ctx->luma_dpb_size = > + width64 * height32 + > + ALIGN(DIV_ROUND_UP(lcu_width * 32, 4), > + 16) * height32 + 128; > + if (ctx->is_422) { > + ctx->chroma_dpb_size = > + ctx->luma_dpb_size; > + } else { > + ctx->chroma_dpb_size = > + width64 * height32 / 2 + > + ALIGN(DIV_ROUND_UP(lcu_width * > + 32, 4), 16) * height32 / 2 + 128; > + } You don't need the brackets here. > + } else if (ctx->codec_mode == S5P_FIMV_CODEC_VP9_ENC && > + ctx->is_10bit) { > + ctx->luma_dpb_size = > + ALIGN(ctx->img_width * 2, 128) * > + height32 + 64; > + ctx->chroma_dpb_size = > + ALIGN(ctx->img_width * 2, 128) * > + height32 / 2 + 64; > + } else { > + ctx->luma_dpb_size = > + width64 * height32 + 64; > + if (ctx->is_422) { > + ctx->chroma_dpb_size = > + ctx->luma_dpb_size; > + } else { > + ctx->chroma_dpb_size = > + width64 * height32 / 2 + 64; > + } You don't need the brackets here. [...] Andi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel