From patchwork Tue Oct 11 12:25:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614676 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E4D7C433FE for ; Wed, 12 Oct 2022 03:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbiJLDrq (ORCPT ); Tue, 11 Oct 2022 23:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbiJLDrg (ORCPT ); Tue, 11 Oct 2022 23:47:36 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D43792CC for ; Tue, 11 Oct 2022 20:47:33 -0700 (PDT) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20221012034730epoutp04feae88eeaed32b245073249e5642cdea~dNawb-8wp0572305723epoutp04d for ; Wed, 12 Oct 2022 03:47:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20221012034730epoutp04feae88eeaed32b245073249e5642cdea~dNawb-8wp0572305723epoutp04d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546450; bh=KQA2k/ooP0X6HqqDcCu+dMgG5d+FuA71B4Z/y2XwyDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BHIrkPI64do7jHzAZ8zImRabISNbgrWQlJnusYdxOG6yh4RMGU2a65Ruq647XmODc PFsXdDX15SqG0DoTQ+hoEK7u6/3zdWSNZoNw0+hhdbgrUH8mBW83njBf/7PnePccWa gJRcIFoPTAQWAOZkIjG7OV8mBiU0zhqEyeY/teFM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20221012034729epcas5p207f37b5c9bd8158c601dbe57033f8976~dNavmEVGk1526715267epcas5p2B; Wed, 12 Oct 2022 03:47:29 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.178]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4MnJWM13lbz4x9Q0; Wed, 12 Oct 2022 03:47:27 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 05.1E.26992.EC836436; Wed, 12 Oct 2022 12:47:26 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20221011125142epcas5p13c858a5f27830fb1de50fa51e9730eca~dBMnQmnWt3163231632epcas5p1X; Tue, 11 Oct 2022 12:51:42 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221011125142epsmtrp1d972403c617995345b6bc46e2b9bca85~dBMnPheY32654526545epsmtrp1D; Tue, 11 Oct 2022 12:51:42 +0000 (GMT) X-AuditID: b6c32a49-0c7ff70000016970-12-634638ce625f Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 58.0D.14392.DD665436; Tue, 11 Oct 2022 21:51:41 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125138epsmtip1e7c289d1b3c2c222ad1ce0cdc6f672f0~dBMkIdScf2177321773epsmtip11; Tue, 11 Oct 2022 12:51:38 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 01/15] dt-bindings: media: s5p-mfc: Add new DT schema for MFC Date: Tue, 11 Oct 2022 17:55:02 +0530 Message-Id: <20221011122516.32135-2-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTe0zTVxTHd39tfy0a9Ac4vUNAUsMEDNDO0l1YwQ2Z+y1uSyfZXMQIpfxs GaXt2iLMZJuCgKIIuC1CB5RRGAHksdIyYDB5l6lgyJxNJuVVFh5bmLwcDqNrKWz/fe73fM89 5557L4vmPoF7spLkGkolF8nY+DZ6S2+Af9AwOirmFN0ToN9bixlooqwFR/q1GQyN65fpqKfZ xETG+9/QULW5i4F0fcMM9EP3FB19P2uPjhRb6WhG1wDQnHYMRwbbAwaanD+BfmkvwdHVJhMD 1fdZmajKMoKh7wxPMVRhWmGirM4+JrJ2tAB0MbsPex2SN8tuArLVWglIS+USjWzTWpmkvmMO Iw21l3Fy9EEHTjZXfkFm9f9DJ68ZawH5LKOUSeb2WXBy2eBD3l5dZgp3nEwWSClRIqXypeRi RWKSXBLBPhYTdyQulM/hBnHD0KtsX7kohYpgR78jDDqaJLOPge17ViRLtUtCkVrNDokUqBSp GspXqlBrItiUMlGm5CmD1aIUdapcEi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OO/EoCaX/3YOijdghHpvIKEhne5vHQradGPiow N/NRVcMnHN3/+s++zrHhqKegDKDe3HYC6bta+aizbw968/AagS7cq+CjUrONRCWW1xi6qZ/A UFHFMInUdWYS2WorATpz1oythczd/LuAqbYVA8ZSbOcxD3JtJKOt7cUYvS6dYKyttQRTXnyC UTeO4UyGQQeYydPXSUZjthDMkH4O83xkiAx33ScIjmblsUdYbqn4oCAmo2EAxFesOlr4Skee BKd9NcCZgnQgbC4owzRAQAnpGgDbhsaIaTEb/jn7hJxmN3h7smeKhXQaBtVvQxxM0EvgoxIj 4QjPotUAWm6nTzXx6Dwc/s408jWAotzocFje5+YI4PQCONFlxR3sQofAkUsX8emBufDOPSPP wc60GP4seUJMj4XAU4NXsMvAtRA46YAnG69SyBSqgPiAODbJXyVRqBLjZP5RSoUeTH3n51sN qnQ//E0Ao4AJQIonmuUCCtZHCV2iJckpLKeM5BLlrMoEvClc5OHSonkWKaRlkgT2EMvGs9x/ i1HOXicxo/i9qW6RQhsaqVwM2vrrJ9Qr8sQan63nYGORcvMW1bVBY5jo0v4P0WPdwx6lYYFc Zu671EHteFDj47zjW86sWuvUtiH71pX2lvym0f7opHE23XvHnazelCO7L1+t8SqVWKuz/FZe d/+SuMs0kLbY7u8TUWY+WjI8LBBrug0D9U7bQqg9ReGu9esiTKKgjp0GakRtt6ctl0rHM3V7 rd6BGaNhskl3/rrtycHwpdsbbyn9nfv6q3Rivnymcl5nqNSz8oDFnn1e841jV1yYIW1LsrKu CxuOpaSeWxPKdRnUnEfhi4aNq9Xt3TmSbfmbzst+7VSkmW90Bfs2bz7MJstFuCpGEuDH41SS v4BPiMEqAwAA X-CMS-MailID: 20221011125142epcas5p13c858a5f27830fb1de50fa51e9730eca X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125142epcas5p13c858a5f27830fb1de50fa51e9730eca References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy Convert DT schema for s5p-mfc in yaml format Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- .../devicetree/bindings/media/s5p-mfc.txt | 75 -------- .../bindings/media/samsung,s5p-mfc.yaml | 163 ++++++++++++++++++ 2 files changed, 163 insertions(+), 75 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/samsung,s5p-mfc.yaml diff --git a/Documentation/devicetree/bindings/media/s5p-mfc.txt b/Documentation/devicetree/bindings/media/s5p-mfc.txt index aa54c8159d9f..8b137891791f 100644 --- a/Documentation/devicetree/bindings/media/s5p-mfc.txt +++ b/Documentation/devicetree/bindings/media/s5p-mfc.txt @@ -1,76 +1 @@ -* Samsung Multi Format Codec (MFC) -Multi Format Codec (MFC) is the IP present in Samsung SoCs which -supports high resolution decoding and encoding functionalities. -The MFC device driver is a v4l2 driver which can encode/decode -video raw/elementary streams and has support for all popular -video codecs. - -Required properties: - - compatible : value should be either one among the following - (a) "samsung,mfc-v5" for MFC v5 present in Exynos4 SoCs - (b) "samsung,mfc-v6" for MFC v6 present in Exynos5 SoCs - (c) "samsung,mfc-v7" for MFC v7 present in Exynos5420 SoC - (d) "samsung,mfc-v8" for MFC v8 present in Exynos5800 SoC - (e) "samsung,exynos5433-mfc" for MFC v8 present in Exynos5433 SoC - (f) "samsung,mfc-v10" for MFC v10 present in Exynos7880 SoC - - - reg : Physical base address of the IP registers and length of memory - mapped region. - - - interrupts : MFC interrupt number to the CPU. - - clocks : from common clock binding: handle to mfc clock. - - clock-names : from common clock binding: must contain "mfc", - corresponding to entry in the clocks property. - -Optional properties: - - power-domains : power-domain property defined with a phandle - to respective power domain. - - memory-region : from reserved memory binding: phandles to two reserved - memory regions, first is for "left" mfc memory bus interfaces, - second if for the "right" mfc memory bus, used when no SYSMMU - support is available; used only by MFC v5 present in Exynos4 SoCs - -Obsolete properties: - - samsung,mfc-r, samsung,mfc-l : support removed, please use memory-region - property instead - - -Example: -SoC specific DT entry: - -mfc: codec@13400000 { - compatible = "samsung,mfc-v5"; - reg = <0x13400000 0x10000>; - interrupts = <0 94 0>; - power-domains = <&pd_mfc>; - clocks = <&clock 273>; - clock-names = "mfc"; -}; - -Reserved memory specific DT entry for given board (see reserved memory binding -for more information): - -reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - mfc_left: region@51000000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x51000000 0x800000>; - }; - - mfc_right: region@43000000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x43000000 0x800000>; - }; -}; - -Board specific DT entry: - -codec@13400000 { - memory-region = <&mfc_left>, <&mfc_right>; -}; diff --git a/Documentation/devicetree/bindings/media/samsung,s5p-mfc.yaml b/Documentation/devicetree/bindings/media/samsung,s5p-mfc.yaml new file mode 100644 index 000000000000..ad61b509846f --- /dev/null +++ b/Documentation/devicetree/bindings/media/samsung,s5p-mfc.yaml @@ -0,0 +1,163 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/samsung,s5p-mfc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung Exynos Multi Format Codec (MFC) + +maintainers: + - Marek Szyprowski + - Smitha T Murthy + - Aakarsh Jain + +description: + Multi Format Codec (MFC) is the IP present in Samsung SoCs which + supports high resolution decoding and encoding functionalities. + +properties: + compatible: + enum: + - samsung,mfc-v5 # Exynos4 + - samsung,mfc-v6 # Exynos5 + - samsung,mfc-v7 # Exynos5420 + - samsung,mfc-v8 # Exynos5800 + - samsung,exynos5433-mfc # Exynos5433 + - samsung,mfc-v10 # Exynos7880 + + reg: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 3 + + clock-names: + minItems: 1 + maxItems: 3 + + interrupts: + maxItems: 1 + + iommus: + maxItems: 2 + + iommu-names: + maxItems: 2 + + power-domains: + maxItems: 1 + + memory-region: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + +allOf: + - if: + properties: + compatible: + contains: + enum: + - samsung,mfc-v6 + - samsung,mfc-v7 + - samsung,mfc-v8 + - tesla,fsd-mfc + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: mfc + + - if: + properties: + compatible: + contains: + enum: + - samsung,mfc-v5 + then: + properties: + clocks: + minItems: 2 + maxItems: 2 + clock-names: + items: + - const: mfc + - const: sclk_mfc + + - if: + properties: + compatible: + contains: + enum: + - samsung,exynos5433-mfc + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: pclk + - const: aclk + - const: aclk_xiu + + - if: + properties: + compatible: + contains: + enum: + - samsung,mfc-v5 + - samsung,mfc-v6 + - samsung,mfc-v7 + - samsung,mfc-v8 + - samsung,exynos5433-mfc + + then: + properties: + iommus: + minItems: 2 + maxItems: 2 + iommu-names: + items: + - const: left + - const: right + + - if: + properties: + compatible: + contains: + enum: + - tesla,fsd-mfc + then: + properties: + memory-region: + maxItems: 1 + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + codec@13400000 { + compatible = "samsung,mfc-v5"; + reg = <0x13400000 0x10000>; + interrupts = ; + power-domains = <&pd_mfc>; + clocks = <&clock CLK_MFC>, <&clock CLK_SCLK_MFC>; + clock-names = "mfc", "sclk_mfc"; + iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>; + iommu-names = "left", "right"; + + }; From patchwork Tue Oct 11 12:25:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614675 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC943C4332F for ; Wed, 12 Oct 2022 03:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbiJLDsF (ORCPT ); Tue, 11 Oct 2022 23:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiJLDru (ORCPT ); Tue, 11 Oct 2022 23:47:50 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12514A5732 for ; Tue, 11 Oct 2022 20:47:43 -0700 (PDT) Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20221012034741epoutp03f60e4ae5a9e81409dc3365937aa6990d~dNa7GoJK82708227082epoutp03C for ; Wed, 12 Oct 2022 03:47:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20221012034741epoutp03f60e4ae5a9e81409dc3365937aa6990d~dNa7GoJK82708227082epoutp03C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546462; bh=e2QO8IIE0yzcd49QROG9JOjfB9Dl7bhlmZ1b1T/e40I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFQdrYRpEGxEyV1uK/rUcKaGYrNiEMaglD4IvslJjU18EpXIQUDFdugCps0h4Rgqh SBhhsteZsouKOkq/jr462CCjNaRaNBfYBRwGiq5+74Kghqxy12zwaZtPLRu+DZre+w axRXSvPdZyv9zz1UG4SEmg9V7MrqAGMNwfBzAdBg= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20221012034740epcas5p426ba642a18ff116b5c358188e9a509c2~dNa5ynJUQ1445014450epcas5p4T; Wed, 12 Oct 2022 03:47:40 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.179]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4MnJWX3M0Fz4x9Q9; Wed, 12 Oct 2022 03:47:36 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 20.EB.39477.8D836436; Wed, 12 Oct 2022 12:47:36 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20221011125148epcas5p10f1788595398637dbceebe1c4dbf0df2~dBMthaP_n3098030980epcas5p1B; Tue, 11 Oct 2022 12:51:48 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221011125148epsmtrp1d831b2610c551d6a40db53da27afd6ae~dBMtfYLSl2654526545epsmtrp1E; Tue, 11 Oct 2022 12:51:48 +0000 (GMT) X-AuditID: b6c32a4a-259fb70000019a35-4b-634638d8ac0c Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id AB.0D.14392.4E665436; Tue, 11 Oct 2022 21:51:48 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125145epsmtip130e4165128e4af80772d985220791620~dBMqdGuN62344423444epsmtip1X; Tue, 11 Oct 2022 12:51:45 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 03/15] media: s5p-mfc: Rename IS_MFCV10 macro Date: Tue, 11 Oct 2022 17:55:04 +0530 Message-Id: <20221011122516.32135-4-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTfVBUVRjGO/fu3l0g9Ipixy1xuw0WJLiLCx4cvgpx7khjVDM17sTQnd0b EMvutnchokmRhMkVJEomvr8WaEQFXL4/FIINHLNmNg0adFkQCEErAjIM1HZZqP9+7/M+zzlz 3nOOEPcYI0TCRLWe1akZFUW48toGfHz8fkGHFBJLw3Y03VHER+PlbQQyLs9gyGZc5KH+5lYB arlZgqNvhvr4qML8Ix+1f3uHhy7dtXctRVYemqloAGi2eIxApslhPpqYewfd6ColUE5TKx9d NFsFqHbEgqE60yqGqluXBCjrslmArD1tAJ3MNmMRkL5QfgHQHdYaQI/ULOB0Z7FVQBt7ZjHa VH+KoG8P9xB0c81xOuu7f3j0mZZ6QD/OLBPQBvMIQS+avOhrfy0KYjbJk0ISWEbJ6sSsWqFR JqrjQ6not+Ii4wKDJFI/aTDaT4nVTDIbSh18LcbvUKLKPgZKnMqoUuxSDMNx1N6wEJ0mRc+K EzScPpRitUqVVqb155hkLkUd769m9QekEklAoN34XlLCcHkvpp06kDb0aJGfAb6XGoBQCEkZ vLLsagAuQg+yG8AVW4gBuNp5AUBTp43vLB4A2DG6CjYCt+qOOvXLANY2zmHOIguDts5K3LEU QfrB3to+wsHbyBMATn6ud5hw8jMetF5fETgaW8kImNdUvhbgkd4wZ+7WGruTobBgYX7NA8ld 8HxT35ruQobBP2sHCcdCkDztAtutVYTTdBBezfkJd/JWODfUsh4Wwdm87HVWwMnq2XWPCjb2 nOU5ORz23SzlOY6Gkz6wsWuvU94JC641YA7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j8mHSAFaRKWMBBon/DPGYQm0VA VaLn1W0wm1fAVmLqpw9QK+QlVm84ABbnFLCT+Lj0GBuILQRU0/h+KtMERr4FjAyrGCVTC4pz 03OLDQsM81LL9YoTc4tL89L1kvNzNzGCI09Lcwfj9lUf9A4xMnEwHmKU4GBWEuFlnO+ULMSb klhZlVqUH19UmpNafIhRmoNFSZz3QtfJeCGB9MSS1OzU1ILUIpgsEwenVAOTgKgw74PFcqsu ldiUve1ku+wlm6Saddm9KN7/7Nl9kw7VfvrvdHfXyZMvHP+t55mwXLha+IfktF2qsz9VrfEs annVsfJKRk6KbeiOx+bNvN/uu5/8w1Kx4c77vEnNE5Wzzn7rKHA7/frc1CvFP69PETJaNbuC o8ursiRdVDz4P0uAQ0nMIoPtGZn7Lwc4GW0qfbPo9WT5H482NOl+CmKv4H8mFnyRqWdmCbv6 o4bzzcxsXTy3t81ui45vdrp8MekuO/OxncqHbU8Yn7Nm8v27YMHL5+Uxs20PvLqh7XBuWtMi T/67H3/U7SvvlrMonL34KbfDrzNerDkmcRdrO28I58T51zVNZJY97CZ14OdBJZbijERDLeai 4kQAQhLBvSsDAAA= X-CMS-MailID: 20221011125148epcas5p10f1788595398637dbceebe1c4dbf0df2 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125148epcas5p10f1788595398637dbceebe1c4dbf0df2 References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy Renames macro IS_MFCV10 to IS_MFCV10_PLUS so that the MFCv10 code can be resued for MFCv12 support. Since some part of MFCv10 specific code holds good for MFCv12 also. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- .../platform/samsung/s5p-mfc/s5p_mfc_common.h | 10 +++---- .../platform/samsung/s5p-mfc/s5p_mfc_ctrl.c | 2 +- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 28 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h index 5304f42c8c72..e6ec4a43b290 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h @@ -771,11 +771,11 @@ void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq); #define HAS_PORTNUM(dev) (dev ? (dev->variant ? \ (dev->variant->port_num ? 1 : 0) : 0) : 0) #define IS_TWOPORT(dev) (dev->variant->port_num == 2 ? 1 : 0) -#define IS_MFCV6_PLUS(dev) (dev->variant->version >= 0x60 ? 1 : 0) -#define IS_MFCV7_PLUS(dev) (dev->variant->version >= 0x70 ? 1 : 0) -#define IS_MFCV8_PLUS(dev) (dev->variant->version >= 0x80 ? 1 : 0) -#define IS_MFCV10(dev) (dev->variant->version >= 0xA0 ? 1 : 0) -#define FW_HAS_E_MIN_SCRATCH_BUF(dev) (IS_MFCV10(dev)) +#define IS_MFCV6_PLUS(dev) (dev->variant->version >= 0x60) +#define IS_MFCV7_PLUS(dev) (dev->variant->version >= 0x70) +#define IS_MFCV8_PLUS(dev) (dev->variant->version >= 0x80) +#define IS_MFCV10_PLUS(dev) (dev->variant->version >= 0xA0) +#define FW_HAS_E_MIN_SCRATCH_BUF(dev) (IS_MFCV10_PLUS(dev)) #define MFC_V5_BIT BIT(0) #define MFC_V6_BIT BIT(1) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c index 72d70984e99a..ffe9f7e79eca 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c @@ -236,7 +236,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) else mfc_write(dev, 0x3ff, S5P_FIMV_SW_RESET); - if (IS_MFCV10(dev)) + if (IS_MFCV10_PLUS(dev)) mfc_write(dev, 0x0, S5P_FIMV_MFC_CLOCK_OFF_V10); mfc_debug(2, "Will now wait for completion of firmware transfer\n"); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 8227004f6746..728d255e65fc 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -72,9 +72,9 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) ctx->luma_size, ctx->chroma_size, ctx->mv_size); mfc_debug(2, "Totals bufs: %d\n", ctx->total_dpb_count); } else if (ctx->type == MFCINST_ENCODER) { - if (IS_MFCV10(dev)) { + if (IS_MFCV10_PLUS(dev)) ctx->tmv_buffer_size = 0; - } else if (IS_MFCV8_PLUS(dev)) + else if (IS_MFCV8_PLUS(dev)) ctx->tmv_buffer_size = S5P_FIMV_NUM_TMV_BUFFERS_V6 * ALIGN(S5P_FIMV_TMV_BUFFER_SIZE_V8(mb_width, mb_height), S5P_FIMV_TMV_BUFFER_ALIGN_V6); @@ -82,7 +82,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) ctx->tmv_buffer_size = S5P_FIMV_NUM_TMV_BUFFERS_V6 * ALIGN(S5P_FIMV_TMV_BUFFER_SIZE_V6(mb_width, mb_height), S5P_FIMV_TMV_BUFFER_ALIGN_V6); - if (IS_MFCV10(dev)) { + if (IS_MFCV10_PLUS(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) { @@ -133,7 +133,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) switch (ctx->codec_mode) { case S5P_MFC_CODEC_H264_DEC: case S5P_MFC_CODEC_H264_MVC_DEC: - if (IS_MFCV10(dev)) + if (IS_MFCV10_PLUS(dev)) mfc_debug(2, "Use min scratch buffer size\n"); else if (IS_MFCV8_PLUS(dev)) ctx->scratch_buf_size = @@ -152,7 +152,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) (ctx->mv_count * ctx->mv_size); break; case S5P_MFC_CODEC_MPEG4_DEC: - if (IS_MFCV10(dev)) + if (IS_MFCV10_PLUS(dev)) mfc_debug(2, "Use min scratch buffer size\n"); else if (IS_MFCV7_PLUS(dev)) { ctx->scratch_buf_size = @@ -172,7 +172,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) break; case S5P_MFC_CODEC_VC1RCV_DEC: case S5P_MFC_CODEC_VC1_DEC: - if (IS_MFCV10(dev)) + if (IS_MFCV10_PLUS(dev)) mfc_debug(2, "Use min scratch buffer size\n"); else ctx->scratch_buf_size = @@ -189,7 +189,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) ctx->bank2.size = 0; break; case S5P_MFC_CODEC_H263_DEC: - if (IS_MFCV10(dev)) + if (IS_MFCV10_PLUS(dev)) mfc_debug(2, "Use min scratch buffer size\n"); else ctx->scratch_buf_size = @@ -201,7 +201,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) ctx->bank1.size = ctx->scratch_buf_size; break; case S5P_MFC_CODEC_VP8_DEC: - if (IS_MFCV10(dev)) + if (IS_MFCV10_PLUS(dev)) mfc_debug(2, "Use min scratch buffer size\n"); else if (IS_MFCV8_PLUS(dev)) ctx->scratch_buf_size = @@ -230,7 +230,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) DEC_VP9_STATIC_BUFFER_SIZE; break; case S5P_MFC_CODEC_H264_ENC: - if (IS_MFCV10(dev)) { + if (IS_MFCV10_PLUS(dev)) { mfc_debug(2, "Use min scratch buffer size\n"); ctx->me_buffer_size = ALIGN(ENC_V100_H264_ME_SIZE(mb_width, mb_height), 16); @@ -254,7 +254,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) break; case S5P_MFC_CODEC_MPEG4_ENC: case S5P_MFC_CODEC_H263_ENC: - if (IS_MFCV10(dev)) { + if (IS_MFCV10_PLUS(dev)) { mfc_debug(2, "Use min scratch buffer size\n"); ctx->me_buffer_size = ALIGN(ENC_V100_MPEG4_ME_SIZE(mb_width, @@ -273,7 +273,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) ctx->bank2.size = 0; break; case S5P_MFC_CODEC_VP8_ENC: - if (IS_MFCV10(dev)) { + if (IS_MFCV10_PLUS(dev)) { mfc_debug(2, "Use min scratch buffer size\n"); ctx->me_buffer_size = ALIGN(ENC_V100_VP8_ME_SIZE(mb_width, mb_height), @@ -452,7 +452,7 @@ static void s5p_mfc_dec_calc_dpb_size_v6(struct s5p_mfc_ctx *ctx) if (ctx->codec_mode == S5P_MFC_CODEC_H264_DEC || ctx->codec_mode == S5P_MFC_CODEC_H264_MVC_DEC) { - if (IS_MFCV10(dev)) { + if (IS_MFCV10_PLUS(dev)) { ctx->mv_size = S5P_MFC_DEC_MV_SIZE_V10(ctx->img_width, ctx->img_height); } else { @@ -668,7 +668,7 @@ static int s5p_mfc_set_enc_ref_buffer_v6(struct s5p_mfc_ctx *ctx) mfc_debug(2, "Buf1: %p (%d)\n", (void *)buf_addr1, buf_size1); - if (IS_MFCV10(dev)) { + if (IS_MFCV10_PLUS(dev)) { /* start address of per buffer is aligned */ for (i = 0; i < ctx->pb_count; i++) { writel(buf_addr1, mfc_regs->e_luma_dpb + (4 * i)); @@ -2455,7 +2455,7 @@ const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev) R(e_h264_options, S5P_FIMV_E_H264_OPTIONS_V8); R(e_min_scratch_buffer_size, S5P_FIMV_E_MIN_SCRATCH_BUFFER_SIZE_V8); - if (!IS_MFCV10(dev)) + if (!IS_MFCV10_PLUS(dev)) goto done; /* Initialize registers used in MFC v10 only. From patchwork Tue Oct 11 12:25:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614674 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FFF0C4332F for ; Wed, 12 Oct 2022 03:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229520AbiJLDsd (ORCPT ); Tue, 11 Oct 2022 23:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbiJLDsD (ORCPT ); Tue, 11 Oct 2022 23:48:03 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 075E6A8CEE for ; Tue, 11 Oct 2022 20:47:49 -0700 (PDT) Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20221012034747epoutp02b762b26fd28aca14763bc05befe099ef~dNbASnyyR1735617356epoutp02Y for ; Wed, 12 Oct 2022 03:47:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20221012034747epoutp02b762b26fd28aca14763bc05befe099ef~dNbASnyyR1735617356epoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546467; bh=Vod73UxxDDF6/1UwF8ErhkgY2evirPrqZuccBO7Gzrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mm/eoJEIKmcqRMtgebNJW+2q29aAosovxIZAur/f+Bcd8RmSl+xuoXts5mWzDsm81 RWostWLGmQZ7n2rJBSrjj8xTHSWZveu9HJzzyEGVBHq/w4AGM3makZ24aYCxJYv40z KDk/KpG7AzfMCyojcQTCn4222BOyC1YPwcxEPduw= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20221012034746epcas5p30913758ec6eaddf9e3a10c840b1243e3~dNa-b1Lw61683016830epcas5p3G; Wed, 12 Oct 2022 03:47:46 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.177]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4MnJWg3QcBz4x9Ps; Wed, 12 Oct 2022 03:47:43 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 23.2E.26992.FD836436; Wed, 12 Oct 2022 12:47:43 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20221011125155epcas5p1e47309b4dd767e81817c316aa0e8b7ca~dBMz2YuYK3098030980epcas5p1J; Tue, 11 Oct 2022 12:51:55 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221011125155epsmtrp206f24d925e521a9ae8ce504b08b9f26b~dBMz1OKAT1820318203epsmtrp2_; Tue, 11 Oct 2022 12:51:55 +0000 (GMT) X-AuditID: b6c32a49-0c7ff70000016970-48-634638df547a Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id CD.0D.14392.BE665436; Tue, 11 Oct 2022 21:51:55 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125152epsmtip11fb87b5cc95cb155429249f50976d5a8~dBMwvzaTN2178621786epsmtip1s; Tue, 11 Oct 2022 12:51:52 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 05/15] Documention: v4l: Documentation for VP9 CIDs. Date: Tue, 11 Oct 2022 17:55:06 +0530 Message-Id: <20221011122516.32135-6-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTe1BUVRzHO/fevXdhBucGKEcmcOdO2kCw7sbDAwky5NgtGaGpsGya9bbc AWRf7C5mlAkqlgQqFcUriJc0IA+Xh5tC8ViglApEIdSFVWwAZzJlIwGh2uVC/ff5/c73+/vO /M45YtzdRnqLkzVGXq/hVAzpSrT1+PkFTqBdStlSxXr0m7lQhGylbSSqnJ/C0ESlnUDdza0U arlWjKOa/k4RKrP8LEIXuu4Q6Py043So0EqgqbIGgGaKxklkmhwRodv39qLhiyUkymlqFaF6 i5VC1aNDGDprWsJQReufFMrqsFDI2t4G0PETFiwKsudKzwHWbK0C7GjVLM5+W2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QwzK2FI3hL24q/xCiaU4I9FQi7mo OBEAiDX9ZSoDAAA= X-CMS-MailID: 20221011125155epcas5p1e47309b4dd767e81817c316aa0e8b7ca X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125155epcas5p1e47309b4dd767e81817c316aa0e8b7ca References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy Adds V4l2 controls for VP9 encoder documention. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- .../media/v4l/ext-ctrls-codec.rst | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index 2a165ae063fb..2277d83a7cf0 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -2187,6 +2187,16 @@ enum v4l2_mpeg_video_vp8_profile - * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_3`` - Profile 3 +VP9 Control Reference +--------------------- + +The VP9 controls include controls for encoding parameters of VP9 video +codec. + +.. _vp9-control-id: + +VP9 Control IDs + .. _v4l2-mpeg-video-vp9-profile: ``V4L2_CID_MPEG_VIDEO_VP9_PROFILE`` @@ -2253,6 +2263,163 @@ enum v4l2_mpeg_video_vp9_level - * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_6_2`` - Level 6.2 +``V4L2_CID_CODEC_VP9_I_FRAME_QP`` + Quantization parameter for an I frame for VP9. Valid range: from 1 to 255. + +``V4L2_CID_CODEC_VP9_P_FRAME_QP`` + Quantization parameter for an P frame for VP9. Valid range: from 1 to 255. + +``V4L2_CID_CODEC_VP9_MAX_QP`` + Maximum quantization parameter for VP9. Valid range: from 1 to 255. + Recommended range for MFC is from 230 to 255. + +``V4L2_CID_CODEC_VP9_MIN_QP`` + Minimum quantization parameter for VP9. Valid range: from 1 to 255. + Recommended range for MFC is from 1 to 24. + +``V4L2_CID_CODEC_VP9_RC_FRAME_RATE`` + Indicates the number of evenly spaced subintervals, called ticks, within + one second. This is a 16 bit unsigned integer and has a maximum value up to + 0xffff and a minimum value of 1. + +``V4L2_CID_CODEC_VP9_GF_REFRESH_PERIOD`` + Indicates the refresh period of the golden frame for VP9 encoder. + +.. _v4l2-vp9-golden-frame-sel: + +``V4L2_CID_CODEC_VP9_GOLDEN_FRAMESEL`` + (enum) + +enum v4l2_mpeg_vp9_golden_framesel - + Selects the golden frame for encoding. Valid when NUM_OF_REF is 2. + Possible values are: + +.. raw:: latex + + \footnotesize + +.. tabularcolumns:: |p{9.0cm}|p{8.0cm}| + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + + * - ``V4L2_CID_CODEC_VP9_GOLDEN_FRAME_USE_PREV`` + - Use the (n-2)th frame as a golden frame, current frame index being + 'n'. + * - ``V4L2_CID_CODEC_VP9_GOLDEN_FRAME_USE_REF_PERIOD`` + - Use the previous specific frame indicated by + ``V4L2_CID_CODEC_VP9_GF_REFRESH_PERIOD`` as a + golden frame. + +.. raw:: latex + + \normalsize + + +``V4L2_CID_CODEC_VP9_HIERARCHY_QP_ENABLE`` + Allows host to specify the quantization parameter values for each + temporal layer through HIERARCHICAL_QP_LAYER. This is valid only + if HIERARCHICAL_CODING_LAYER is greater than 1. Setting the control + value to 1 enables setting of the QP values for the layers. + +.. _v4l2-vp9-ref-number-of-pframes: + +``V4L2_CID_CODEC_VP9_REF_NUMBER_FOR_PFRAMES`` + (enum) + +enum v4l2_mpeg_vp9_ref_num_for_pframes - + Number of reference pictures for encoding P frames. + +.. raw:: latex + + \footnotesize + +.. tabularcolumns:: |p{9.0cm}|p{8.0cm}| + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + + * - ``V4L2_CID_CODEC_VP9_1_REF_PFRAME`` + - Indicates one reference frame, last encoded frame will be searched. + * - ``V4L2_CID_CODEC_VP9_GOLDEN_FRAME_USE_REF_PERIOD`` + - Indicates 2 reference frames, last encoded frame and golden frame + will be searched. + +.. raw:: latex + + \normalsize + + +``V4L2_CID_CODEC_VP9_HIERARCHICAL_CODING_LAYER`` + Indicates the number of hierarchial coding layer. + In normal encoding (non-hierarchial coding), it should be zero. + VP9 has upto 3 layer of encoder. + +``V4L2_CID_CODEC_VP9_HIERARCHY_RC_ENABLE`` + Indicates enabling of bit rate for hierarchical coding layers VP9 encoder. + +``V4L2_CID_CODEC_VP9_HIER_CODING_L0_BR`` + Indicates bit rate for hierarchical coding layer 0 for VP9 encoder. + +``V4L2_CID_CODEC_VP9_HIER_CODING_L1_BR`` + Indicates bit rate for hierarchical coding layer 1 for VP9 encoder. + +``V4L2_CID_CODEC_VP9_HIER_CODING_L2_BR`` + Indicates bit rate for hierarchical coding layer 2 for VP9 encoder. + +``V4L2_CID_CODEC_VP9_HIER_CODING_L0_QP`` + Indicates quantization parameter for hierarchical coding layer 0. + Valid range: [V4L2_CID_CODEC_VP9_MIN_QP, + V4L2_CID_CODEC_VP9_MAX_QP]. + +``V4L2_CID_CODEC_VP9_HIER_CODING_L1_QP`` + Indicates quantization parameter for hierarchical coding layer 1. + Valid range: [V4L2_CID_CODEC_VP9_MIN_QP, + V4L2_CID_CODEC_VP9_MAX_QP]. + +``V4L2_CID_CODEC_VP9_HIER_CODING_L2_QP`` + Indicates quantization parameter for hierarchical coding layer 2. + Valid range: [V4L2_CID_CODEC_VP9_MIN_QP, + V4L2_CID_CODEC_VP9_MAX_QP]. + +.. _v4l2-vp9-max-partition-depth: + +``V4L2_CID_CODEC_VP9_MAX_PARTITION_DEPTH`` + (enum) + +enum v4l2_mpeg_vp9_num_partitions - + Indicate maximum coding unit depth. + +.. raw:: latex + + \footnotesize + +.. tabularcolumns:: |p{9.0cm}|p{8.0cm}| + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + + * - ``V4L2_CID_CODEC_VP9_0_PARTITION`` + - No coding unit partition depth. + * - ``V4L2_CID_CODEC_VP9_1_PARTITION`` + - Allows one coding unit partition depth. + +.. raw:: latex + + \normalsize + + +``V4L2_CID_CODEC_VP9_DISABLE_INTRA_PU_SPLIT`` + Zero indicates enable intra NxN PU split. + One indicates disable intra NxN PU split. + +``V4L2_CID_CODEC_VP9_DISABLE_IVF_HEADER`` + Indicates IVF header generation. Zero indicates enable IVF format. + One indicates disable IVF format. + High Efficiency Video Coding (HEVC/H.265) Control Reference =========================================================== From patchwork Tue Oct 11 12:25:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614673 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1295CC4332F for ; Wed, 12 Oct 2022 03:49:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbiJLDtO (ORCPT ); Tue, 11 Oct 2022 23:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbiJLDs3 (ORCPT ); Tue, 11 Oct 2022 23:48:29 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FBB4A99DB for ; Tue, 11 Oct 2022 20:47:58 -0700 (PDT) Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20221012034756epoutp04458d6c69ef64fa838a95db4a98332f96~dNbJFF2zV0572305723epoutp04s for ; Wed, 12 Oct 2022 03:47:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20221012034756epoutp04458d6c69ef64fa838a95db4a98332f96~dNbJFF2zV0572305723epoutp04s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546477; bh=WEsZ6wE4E1YB1ommn23BbEZzCmsr2JF0Deqy/8l8VXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uiu7N9hbQVhZQY+VTIyvLD1YjW+4NqAfFfTmcahWZ7c6ZkQu8MKKoT3WENKFsH6e6 frNWZTMSUH6154lDUNXrBz3ioihqAr2eImUKBYH0KYVbFt/Vo3gnqSEMacgVk9fGFm /vDhl1IJDBx3qjNYNCNcqoNOSz+GveEpZuR8/9I0= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20221012034755epcas5p32ad5330ee8ae09bdf106e4e2f6920f71~dNbIBzo0j0326403264epcas5p3P; Wed, 12 Oct 2022 03:47:55 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.177]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4MnJWs0022z4x9Q3; Wed, 12 Oct 2022 03:47:52 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 7A.FB.39477.8E836436; Wed, 12 Oct 2022 12:47:52 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20221011125202epcas5p4ef2d0dc9b6c434912b5c552c20bff4f5~dBM6N0QQx1275512755epcas5p4U; Tue, 11 Oct 2022 12:52:02 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221011125202epsmtrp2032248f9f2abbe404a84eef82ef4b712~dBM6Msbp91820318203epsmtrp2-; Tue, 11 Oct 2022 12:52:02 +0000 (GMT) X-AuditID: b6c32a4a-007ff70000019a35-86-634638e8e36b Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 21.1D.14392.2F665436; Tue, 11 Oct 2022 21:52:02 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125158epsmtip10bec6fea4bb1c315708813869379c2a2~dBM3C96452179321793epsmtip18; Tue, 11 Oct 2022 12:51:58 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 07/15] media: s5p-mfc: Add support for VP9 encoder. Date: Tue, 11 Oct 2022 17:55:08 +0530 Message-Id: <20221011122516.32135-8-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTf1DTZRzHe77f7bsNm34DPZ9IjZvCBQZsMuYDCXXK0TctQrjs0j/m98Y3 4Bjb3EZqZVIyTxE6ubCC+KUwlI2BTcBJ4yCYP5hkiFMO2EikFEZ4CEqcZrQxqP9e97w/78/n fZ/nebi4/wgRyM1UaBm1gpYLCD9WS1doaPgYSpQJ7w+J0R+WEja6W9FCoOq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kXKetf3qDvx2omz7TMM2b7nrN3RA12 M4alitfeWi+5W+2T16Ml3i/3Tz3RL/Z244r+dN79G+7+njSpSPOG/4Ws9Z+k30VlmiQ6O035 WL9SS1qza+Hj94fy3zdl2Bpo3Hy17U7v2QyWpmp7p9qbdUfLF2Rv2sGw//w5JZbijERDLeai 4kQAb6gLvS0DAAA= X-CMS-MailID: 20221011125202epcas5p4ef2d0dc9b6c434912b5c552c20bff4f5 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125202epcas5p4ef2d0dc9b6c434912b5c552c20bff4f5 References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy Add VP9 encoder support and necessary registers, V4L2 CIDs, vp9 encoder parameters. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- .../platform/samsung/s5p-mfc/regs-mfc-v12.h | 8 + .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 3 + .../platform/samsung/s5p-mfc/s5p_mfc_common.h | 27 +- .../platform/samsung/s5p-mfc/s5p_mfc_enc.c | 273 ++++++++++++++++++ .../platform/samsung/s5p-mfc/s5p_mfc_opr.h | 2 + .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 121 ++++++++ 6 files changed, 433 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h b/drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h index 6c68a45082d0..7cb74a9cb769 100644 --- a/drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h +++ b/drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h @@ -12,6 +12,10 @@ #include #include "regs-mfc-v10.h" +/* MFCv12 register definitions*/ +#define S5P_FIMV_E_VP9_OPTION_V12 0xFD90 +#define S5P_FIMV_E_VP9_GOLDEN_FRAME_OPTION_V12 0xFD98 + /* MFCv12 Context buffer sizes */ #define MFC_CTX_BUF_SIZE_V12 (30 * SZ_1K) #define MFC_H264_DEC_CTX_BUF_SIZE_V12 (2 * SZ_1M) @@ -47,4 +51,8 @@ ALIGN((((x + 3) * (y + 3) * 32) \ + (((y * 128) + 2304) * (x + 3) / 4)), 256) +#define ENC_V120_VP9_ME_SIZE(x, y) \ + ((((x * 2) + 3) * ((y * 2) + 3) * 128) \ + + (((y * 256) + 2304) * (x + 1) / 2)) + #endif /*_REGS_MFC_V12_H*/ diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c index f8588e52dfc8..d524815cd38a 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c @@ -121,6 +121,9 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) case S5P_MFC_CODEC_HEVC_ENC: codec_type = S5P_FIMV_CODEC_HEVC_ENC; break; + case S5P_MFC_CODEC_VP9_ENC: + codec_type = S5P_FIMV_CODEC_VP9_ENC; + break; default: codec_type = S5P_FIMV_CODEC_NONE_V6; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h index dd2e9f7704ab..10abaa50d7db 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h @@ -57,7 +57,7 @@ #define MFC_ENC_CAP_PLANE_COUNT 1 #define MFC_ENC_OUT_PLANE_COUNT 2 #define STUFF_BYTE 4 -#define MFC_MAX_CTRLS 128 +#define MFC_MAX_CTRLS 147 #define S5P_MFC_CODEC_NONE -1 #define S5P_MFC_CODEC_H264_DEC 0 @@ -77,6 +77,7 @@ #define S5P_MFC_CODEC_H263_ENC 23 #define S5P_MFC_CODEC_VP8_ENC 24 #define S5P_MFC_CODEC_HEVC_ENC 26 +#define S5P_MFC_CODEC_VP9_ENC 27 #define S5P_MFC_R2H_CMD_EMPTY 0 #define S5P_MFC_R2H_CMD_SYS_INIT_RET 1 @@ -483,6 +484,29 @@ struct s5p_mfc_hevc_enc_params { u8 prepend_sps_pps_to_idr; }; +/** + * struct s5p_mfc_vp9_enc_params - encoding parameters for vp9 + */ +struct s5p_mfc_vp9_enc_params { + u32 rc_framerate; + u8 vp9_profile; + u8 rc_min_qp; + u8 rc_max_qp; + u8 rc_frame_qp; + u8 rc_p_frame_qp; + u8 vp9_goldenframesel; + u8 vp9_gfrefreshperiod; + u8 hier_qp_enable; + u8 hier_qp_layer[3]; + u8 hier_rc_enable; + u32 hier_bit_layer[3]; + u8 num_refs_for_p; + u8 num_hier_layer; + u8 max_partition_depth; + u8 intra_pu_split_disable; + u8 ivf_header; +}; + /* * struct s5p_mfc_enc_params - general encoding parameters */ @@ -521,6 +545,7 @@ struct s5p_mfc_enc_params { struct s5p_mfc_mpeg4_enc_params mpeg4; struct s5p_mfc_vp8_enc_params vp8; struct s5p_mfc_hevc_enc_params hevc; + struct s5p_mfc_vp9_enc_params vp9; } codec; }; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index 143d95fe2f89..197667ab1fbc 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -94,6 +94,14 @@ static struct s5p_mfc_fmt formats[] = { .num_planes = 1, .versions = MFC_V10PLUS_BITS, }, + { + .fourcc = V4L2_PIX_FMT_VP9, + .codec_mode = S5P_FIMV_CODEC_VP9_ENC, + .type = MFC_FMT_ENC, + .num_planes = 1, + .versions = MFC_V12_BIT, + }, + }; #define NUM_FORMATS ARRAY_SIZE(formats) @@ -1055,6 +1063,174 @@ static struct mfc_control controls[] = { .step = 1, .default_value = 0, }, + { + .id = V4L2_CID_MPEG_VIDEO_VP9_PROFILE, + .type = V4L2_CTRL_TYPE_MENU, + .minimum = V4L2_MPEG_VIDEO_VP9_PROFILE_0, + .maximum = V4L2_MPEG_VIDEO_VP9_PROFILE_2, + .step = 1, + .default_value = V4L2_MPEG_VIDEO_VP9_PROFILE_0, + }, + { + .id = V4L2_CID_CODEC_VP9_I_FRAME_QP, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 1, + .maximum = 255, + .step = 1, + .default_value = 1, + }, + { + .id = V4L2_CID_CODEC_VP9_P_FRAME_QP, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 1, + .maximum = 255, + .step = 1, + .default_value = 1, + }, + { + .id = V4L2_CID_CODEC_VP9_MAX_QP, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 230, + .maximum = 255, + .step = 1, + .default_value = 255, + }, + { + .id = V4L2_CID_CODEC_VP9_MIN_QP, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 1, + .maximum = 24, + .step = 1, + .default_value = 1, + }, + { + .id = V4L2_CID_CODEC_VP9_RC_FRAME_RATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 1, + .maximum = (1 << 16) - 1, + .step = 1, + .default_value = 1, + }, + { + .id = V4L2_CID_CODEC_VP9_GOLDEN_FRAMESEL, + .type = V4L2_CTRL_TYPE_MENU, + .minimum = V4L2_CID_CODEC_VP9_GOLDEN_FRAME_USE_PREV, + .maximum = V4L2_CID_CODEC_VP9_GOLDEN_FRAME_USE_REF_PERIOD, + .step = 1, + .default_value = V4L2_CID_CODEC_VP9_GOLDEN_FRAME_USE_PREV, + }, + { + .id = V4L2_CID_CODEC_VP9_GF_REFRESH_PERIOD, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 0, + .maximum = ((1 << 16) - 1), + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIERARCHY_QP_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIERARCHY_RC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIER_CODING_L0_QP, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = INT_MIN, + .maximum = INT_MAX, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIER_CODING_L1_QP, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = INT_MIN, + .maximum = INT_MAX, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIER_CODING_L2_QP, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = INT_MIN, + .maximum = INT_MAX, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_REF_NUMBER_FOR_PFRAMES, + .type = V4L2_CTRL_TYPE_MENU, + .minimum = V4L2_CID_CODEC_VP9_1_REF_PFRAME, + .maximum = V4L2_CID_CODEC_VP9_2_REF_PFRAME, + .step = 1, + .default_value = V4L2_CID_CODEC_VP9_1_REF_PFRAME, + }, + { + .id = V4L2_CID_CODEC_VP9_HIERARCHICAL_CODING_LAYER, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 0, + .maximum = 2, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_MAX_PARTITION_DEPTH, + .type = V4L2_CTRL_TYPE_MENU, + .minimum = V4L2_CID_CODEC_VP9_0_PARTITION, + .maximum = V4L2_CID_CODEC_VP9_1_PARTITION, + .step = 1, + .default_value = V4L2_CID_CODEC_VP9_0_PARTITION, + }, + { + .id = V4L2_CID_CODEC_VP9_DISABLE_INTRA_PU_SPLIT, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIER_CODING_L0_BR, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = INT_MIN, + .maximum = INT_MAX, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIER_CODING_L1_BR, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = INT_MIN, + .maximum = INT_MAX, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_HIER_CODING_L2_BR, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = INT_MIN, + .maximum = INT_MAX, + .step = 1, + .default_value = 0, + }, + { + .id = V4L2_CID_CODEC_VP9_DISABLE_IVF_HEADER, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, + }, { .id = V4L2_CID_MIN_BUFFERS_FOR_OUTPUT, .type = V4L2_CTRL_TYPE_INTEGER, @@ -1791,6 +1967,36 @@ static void __enc_update_hevc_qp_ctrls_range(struct s5p_mfc_ctx *ctx, } } +/* + * Update range of all VP9 quantization parameter controls that depend on the + * V4L2_CID_CODEC_VP9_MIN_QP, V4L2_CID_CODEC_VP9_MAX_QP controls. + */ +static void __enc_update_vp9_qp_ctrls_range(struct s5p_mfc_ctx *ctx, + int min, int max) +{ + static const int __vp9_qp_ctrls[] = { + V4L2_CID_CODEC_VP9_I_FRAME_QP, + V4L2_CID_CODEC_VP9_P_FRAME_QP, + V4L2_CID_CODEC_VP9_HIER_CODING_L0_QP, + V4L2_CID_CODEC_VP9_HIER_CODING_L1_QP, + V4L2_CID_CODEC_VP9_HIER_CODING_L2_QP, + }; + struct v4l2_ctrl *ctrl = NULL; + int i, j; + + for (i = 0; i < ARRAY_SIZE(__vp9_qp_ctrls); i++) { + for (j = 0; j < ARRAY_SIZE(ctx->ctrls); j++) { + if (ctx->ctrls[j]->id == __vp9_qp_ctrls[i]) { + ctrl = ctx->ctrls[j]; + break; + } + } + if (WARN_ON(!ctrl)) + break; + __v4l2_ctrl_modify_range(ctrl, min, max, ctrl->step, min); + } +} + static int s5p_mfc_enc_s_ctrl(struct v4l2_ctrl *ctrl) { struct s5p_mfc_ctx *ctx = ctrl_to_ctx(ctrl); @@ -2194,6 +2400,73 @@ static int s5p_mfc_enc_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR: p->codec.hevc.prepend_sps_pps_to_idr = ctrl->val; break; + case V4L2_CID_MPEG_VIDEO_VP9_PROFILE: + p->codec.vp9.vp9_profile = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_RC_FRAME_RATE: + p->codec.vp9.rc_framerate = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_MIN_QP: + p->codec.vp9.rc_min_qp = ctrl->val; + __enc_update_vp9_qp_ctrls_range(ctx, ctrl->val, + p->codec.vp9.rc_max_qp); + break; + case V4L2_CID_CODEC_VP9_MAX_QP: + p->codec.vp9.rc_max_qp = ctrl->val; + __enc_update_vp9_qp_ctrls_range(ctx, + p->codec.vp9.rc_min_qp, ctrl->val); + break; + case V4L2_CID_CODEC_VP9_I_FRAME_QP: + p->codec.vp9.rc_frame_qp = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_P_FRAME_QP: + p->codec.vp9.rc_p_frame_qp = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_GOLDEN_FRAMESEL: + p->codec.vp9.vp9_goldenframesel = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_GF_REFRESH_PERIOD: + p->codec.vp9.vp9_gfrefreshperiod = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIERARCHY_QP_ENABLE: + p->codec.vp9.hier_qp_enable = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIERARCHY_RC_ENABLE: + p->codec.vp9.hier_rc_enable = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIER_CODING_L0_QP: + p->codec.vp9.hier_qp_layer[0] = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIER_CODING_L1_QP: + p->codec.vp9.hier_qp_layer[1] = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIER_CODING_L2_QP: + p->codec.vp9.hier_qp_layer[2] = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIER_CODING_L0_BR: + p->codec.vp9.hier_bit_layer[0] = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIER_CODING_L1_BR: + p->codec.vp9.hier_bit_layer[1] = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIER_CODING_L2_BR: + p->codec.vp9.hier_bit_layer[2] = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_REF_NUMBER_FOR_PFRAMES: + p->codec.vp9.num_refs_for_p = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_HIERARCHICAL_CODING_LAYER: + p->codec.vp9.num_hier_layer = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_MAX_PARTITION_DEPTH: + p->codec.vp9.max_partition_depth = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_DISABLE_INTRA_PU_SPLIT: + p->codec.vp9.intra_pu_split_disable = ctrl->val; + break; + case V4L2_CID_CODEC_VP9_DISABLE_IVF_HEADER: + p->codec.vp9.ivf_header = ctrl->val; + break; default: v4l2_err(&dev->v4l2_dev, "Invalid control, id=%d, val=%d\n", ctrl->id, ctrl->val); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.h index 87ac56756a16..a005623e2daa 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.h @@ -277,6 +277,8 @@ struct s5p_mfc_regs { void __iomem *e_hevc_lf_beta_offset_div2; /* v10 */ void __iomem *e_hevc_lf_tc_offset_div2; /* v10 */ void __iomem *e_hevc_nal_control; /* v10 */ + void __iomem *e_vp9_options; /* v12 */ + void __iomem *e_vp9_golden_frame_option; /* v12 */ }; struct s5p_mfc_hw_ops { diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 5d14ccf8b4fe..87bd10b34620 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -363,6 +363,17 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) ctx->chroma_dpb_size + ctx->me_buffer_size)); ctx->bank2.size = 0; break; + case S5P_FIMV_CODEC_VP9_ENC: + mfc_debug(2, "Use min scratch buffer size\n"); + ctx->me_buffer_size = + ALIGN(ENC_V120_VP9_ME_SIZE(lcu_width, lcu_height), 16); + ctx->scratch_buf_size = ALIGN(ctx->scratch_buf_size, 256); + ctx->bank1.size = + ctx->scratch_buf_size + ctx->tmv_buffer_size + + (ctx->pb_count * (ctx->luma_dpb_size + + ctx->chroma_dpb_size + ctx->me_buffer_size)); + ctx->bank2.size = 0; + break; default: break; } @@ -418,6 +429,7 @@ static int s5p_mfc_alloc_instance_buffer_v6(struct s5p_mfc_ctx *ctx) case S5P_MFC_CODEC_MPEG4_ENC: case S5P_MFC_CODEC_H263_ENC: case S5P_MFC_CODEC_VP8_ENC: + case S5P_FIMV_CODEC_VP9_ENC: ctx->ctx.size = buf_size->other_enc_ctx; break; default: @@ -1652,6 +1664,102 @@ static int s5p_mfc_set_enc_params_hevc(struct s5p_mfc_ctx *ctx) return 0; } +int s5p_mfc_set_enc_params_vp9(struct s5p_mfc_ctx *ctx) +{ + struct s5p_mfc_dev *dev = ctx->dev; + const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs; + struct s5p_mfc_enc_params *p = &ctx->enc_params; + struct s5p_mfc_vp9_enc_params *p_vp9 = &p->codec.vp9; + unsigned int reg = 0; + int i; + + mfc_debug_enter(); + + s5p_mfc_set_enc_params(ctx); + + /* profile*/ + reg = 0; + reg |= (p_vp9->vp9_profile); + writel(reg, mfc_regs->e_picture_profile); + + reg = 0; + reg |= ((p_vp9->ivf_header & 0x1) << 12); + reg |= ((p_vp9->hier_qp_enable & 0x1) << 11); + reg |= (p_vp9->max_partition_depth & 0x1) << 3; + reg |= (p_vp9->intra_pu_split_disable & 0x1) << 1; + reg |= (p_vp9->num_refs_for_p - 1) & 0x1; + writel(reg, mfc_regs->e_vp9_options); + + reg = 0; + reg |= (p_vp9->vp9_goldenframesel & 0x1); + reg |= (p_vp9->vp9_gfrefreshperiod & 0xffff) << 1; + writel(reg, mfc_regs->e_vp9_golden_frame_option); + + reg = 0; + if (p_vp9->num_hier_layer) { + reg |= p_vp9->num_hier_layer & 0x3; + writel(reg, mfc_regs->e_num_t_layer); + /* QP value for each layer */ + if (p_vp9->hier_qp_enable) { + for (i = 0; i < (p_vp9->num_hier_layer & 0x3); i++) + writel(p_vp9->hier_qp_layer[i], + mfc_regs->e_hier_qp_layer0 + + i * 4); + } + if (p_vp9->hier_rc_enable) { + for (i = 0; i < (p_vp9->num_hier_layer & 0x3); i++) + writel(p_vp9->hier_bit_layer[i], + mfc_regs->e_hier_bit_rate_layer0 + + i * 4); + } + } + /* number of coding layer should be zero when hierarchical is disable */ + reg |= p_vp9->num_hier_layer; + writel(reg, mfc_regs->e_num_t_layer); + + /* qp */ + writel(0x0, mfc_regs->e_fixed_picture_qp); + if (!p->rc_frame && !p->rc_mb) { + reg = 0; + reg &= ~(0xff << 8); + reg |= (p_vp9->rc_p_frame_qp << 8); + reg &= ~(0xff); + reg |= p_vp9->rc_frame_qp; + writel(reg, mfc_regs->e_fixed_picture_qp); + } + + /* frame rate */ + if (p->rc_frame) { + reg = 0; + reg &= ~(0xffff << 16); + reg |= ((p_vp9->rc_framerate * FRAME_DELTA_DEFAULT) << 16); + reg &= ~(0xffff); + reg |= FRAME_DELTA_DEFAULT; + writel(reg, mfc_regs->e_rc_frame_rate); + } + + /* rate control config. */ + reg = readl(mfc_regs->e_rc_config); + /** macroblock level rate control */ + reg &= ~(0x1 << 8); + reg |= ((p->rc_mb & 0x1) << 8); + writel(reg, mfc_regs->e_rc_config); + + /* max & min value of QP */ + reg = 0; + /** max QP */ + reg &= ~(0xFF << 8); + reg |= (p_vp9->rc_max_qp << 8); + /** min QP */ + reg &= ~(0xFF); + reg |= p_vp9->rc_min_qp; + writel(reg, mfc_regs->e_rc_qp_bound); + + mfc_debug_leave(); + + return 0; +} + /* Initialize decoding */ static int s5p_mfc_init_decode_v6(struct s5p_mfc_ctx *ctx) { @@ -1773,6 +1881,8 @@ static int s5p_mfc_init_encode_v6(struct s5p_mfc_ctx *ctx) s5p_mfc_set_enc_params_vp8(ctx); else if (ctx->codec_mode == S5P_FIMV_CODEC_HEVC_ENC) s5p_mfc_set_enc_params_hevc(ctx); + else if (ctx->codec_mode == S5P_FIMV_CODEC_VP9_ENC) + s5p_mfc_set_enc_params_vp9(ctx); else { mfc_err("Unknown codec for encoding (%x).\n", ctx->codec_mode); @@ -2536,6 +2646,17 @@ const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev) R(e_hevc_lf_tc_offset_div2, S5P_FIMV_E_HEVC_LF_TC_OFFSET_DIV2_V10); R(e_hevc_nal_control, S5P_FIMV_E_HEVC_NAL_CONTROL_V10); + if (!IS_MFCV12(dev)) + goto done; + + /* Initialize registers used in MFC v10 only. + * Also, over-write the registers which have + * a different offset for MFC v10. + */ + + R(e_vp9_options, S5P_FIMV_E_VP9_OPTION_V12); + R(e_vp9_golden_frame_option, S5P_FIMV_E_VP9_GOLDEN_FRAME_OPTION_V12); + done: return &mfc_regs; #undef S5P_MFC_REG_ADDR From patchwork Tue Oct 11 12:25:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614672 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99C0DC43219 for ; Wed, 12 Oct 2022 03:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbiJLDti (ORCPT ); Tue, 11 Oct 2022 23:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiJLDss (ORCPT ); Tue, 11 Oct 2022 23:48:48 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE633A7AB7 for ; Tue, 11 Oct 2022 20:48:06 -0700 (PDT) Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20221012034805epoutp04dcb05c3610cdf06a9d016732e791a33a~dNbQoHW5w0497304973epoutp04A for ; Wed, 12 Oct 2022 03:48:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20221012034805epoutp04dcb05c3610cdf06a9d016732e791a33a~dNbQoHW5w0497304973epoutp04A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546485; bh=HwMR3+1hStRRWuRYIIGNTqjehbkPDPwENd53xivaowQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OKjR0qND2EMJcaVKz0VPUJqqKt0js3nWvpoaF8A0eKXlx1SLSR95LfqVHCgJxfj7O fK9t8o+N3kkwGvyGMqR/3u1XymEfIhWjxCSvpXf9Kyyxv86oLfW6uP/LDxOjw84bSI f3jh7UZMyj7VLb7o5sE6n1wEeSxNyr3ZMFQj03MQ= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20221012034804epcas5p4ffd29dd8a75babe87494abf146f1aeea~dNbQEEk3p1445014450epcas5p4M; Wed, 12 Oct 2022 03:48:04 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.177]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4MnJX16cJvz4x9Pp; Wed, 12 Oct 2022 03:48:01 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 3C.2E.26992.1F836436; Wed, 12 Oct 2022 12:48:01 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20221011125212epcas5p2b39bc34805f63de7da5b4a098f10689f~dBNDoVHB-1500015000epcas5p2X; Tue, 11 Oct 2022 12:52:12 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221011125212epsmtrp2a81dc7a3681b22dfe7a95392b9d30525~dBNDmwgc61820118201epsmtrp2L; Tue, 11 Oct 2022 12:52:12 +0000 (GMT) X-AuditID: b6c32a49-319fb70000016970-7d-634638f12efe Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id B4.94.18644.CF665436; Tue, 11 Oct 2022 21:52:12 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125209epsmtip1f5d69eb6332f326b9fbbd3bba1d8c70b~dBNAiJK5G2675426754epsmtip1K; Tue, 11 Oct 2022 12:52:09 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 10/15] media: s5p-mfc: Add support for UHD encoding. Date: Tue, 11 Oct 2022 17:55:11 +0530 Message-Id: <20221011122516.32135-11-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTf1STVRjHz33fd+876AxeQOnGScP3CEd3Ymw45qVALJVeT+nBQydOFq6d 7Q2Isc1tkD86ZSlYCKZhx/FDIAZqoGATkGDqHENOSKBCYOkSQflhBw0WHY5itDGo/z7P936f 57n3uffy8cBBMoSfrjFyeo1CzZC+RFPbamHEJEpQils6o9CD5iIeGixrIpF5ZhRDd80uAtnP N1Kooa8ER6c6bDxU7ujmoQtXhgj0w5h79UaRk0Cj5XUAjRf/TiLLcD8P3XuYjHpbSkmUf66R h846nBSqHriBoZOWWQxVNv5FoZyLDgo5rU0AHch1YOshe6bsDGCbnVWAHaiawtkfi50Ua7aO Y6yl5iuSvdNvJdnzVZ+xOe1PCPZwQw1g//niBMXmOQZI1mVZznZOu6hEv+0ZsWmcQsXpQzmN UqtK16TGMW8myTfIo2ViSYQkBq1lQjWKTC6O2fhWYkRCuto9BiY0W6HOckuJCoOBiVwXq9dm GbnQNK3BGMdwOpVaJ9WJDIpMQ5YmVaThjK9IxOKoaLfxg4w0W1c/ppsJ2DV338TbBw765wE+ H9JSWGuLzgO+/EC6FcCTX3eS3mAKwCPmEsobuACsKbGCxQzbk2Cv3gLg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8fiPS+ZPDat6mTzuHNtD5vH5iX1Hq1H f7F49G1Zxejxr2kuu0fXketsHp83yXmc+vqZPYAvissmJTUnsyy1SN8ugSvjwJlrTAU/BCv+ P5nB2sDYzt/FyMEhIWAiceCXWBcjF4eQwA5Gid33pzJ3MXICxWUk/rcdY4ewhSVW/nvODlHU zCTx/uhUNpAEm4CuxP6lB9hAEiICrYwS11d2MoE4zAKzWSR+TDrAClIlLOAu8fH/FUYQm0VA VeLs0/csIDavgJ3EkW0z2CBWyEus3nAAbDUnUPzj0mNgcSEBW4nG91OZJjDyLWBkWMUomVpQ nJueW2xYYJSXWq5XnJhbXJqXrpecn7uJERx5Wlo7GPes+qB3iJGJg/EQowQHs5IIL+N8p2Qh 3pTEyqrUovz4otKc1OJDjNIcLErivBe6TsYLCaQnlqRmp6YWpBbBZJk4OKUamAzktVfPEfxy 4/EFt87Ofxv01V/X8fvIiZ1QSJ2ofodzkuEdkVcNn1i+rcgKY21P/f75WmL72kWTlnGbfioJ +sX60lDKYla21T/XCatDF85t2aLiw2V2Y2HD+kiztveLr3+VrGLIspeb/W3FecEGuze9TCIy qzaFaKs6Vs7LVVItNFi3xCOQ1eLYBtP/E673nE/N6uzl27svKm+5/Idr/xbHFLrJaHa//v/s wkahh59mvH1mV7ngdJ/M6a75ZqLedryhnGezvewWTQ6SjN2sG/M4tzdhvnLN/+l7y40c5cJ5 HQ/a7CoIZ3ntp8Q39Xr0HI3lb4O47p++2e206kmo3FTZ1X4S3GcPtF4Nf9G+XImlOCPRUIu5 qDgRABFHIC8rAwAA X-CMS-MailID: 20221011125212epcas5p2b39bc34805f63de7da5b4a098f10689f X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125212epcas5p2b39bc34805f63de7da5b4a098f10689f References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy MFC driver had restriction on max resolution of 1080p, updated it for UHD. Added corresponding support to set recommended profile and level for H264 in UHD scenario. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c | 9 ++++++--- .../media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index b761b9a31383..f953a3ed7f20 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -1628,9 +1628,12 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f) mfc_err("Unsupported format by this MFC version.\n"); return -EINVAL; } - - v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1, - &pix_fmt_mp->height, 4, 1080, 1, 0); + if (IS_MFCV12(dev)) + v4l_bound_align_image(&pix_fmt_mp->width, 8, 3840, 1, + &pix_fmt_mp->height, 4, 2160, 1, 0); + else + v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1, + &pix_fmt_mp->height, 4, 1080, 1, 0); } else { mfc_err("invalid buf type\n"); return -EINVAL; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 2194df7b6fbf..c4953419be0e 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -1116,6 +1116,18 @@ static int s5p_mfc_set_enc_params_h264(struct s5p_mfc_ctx *ctx) reg |= ((p->num_b_frame & 0x3) << 16); writel(reg, mfc_regs->e_gop_config); + /* UHD encoding case */ + if ((ctx->img_width == 3840) && ctx->img_height == 2160) { + if (p_h264->level < 51) { + mfc_debug(2, "Set Level 5.1 for UHD\n"); + p_h264->level = 51; + } + if (p_h264->profile != 0x2) { + mfc_debug(2, "Set High profile for UHD\n"); + p_h264->profile = 0x2; + } + } + /* profile & level */ reg = 0; /** level */ From patchwork Tue Oct 11 12:25:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614671 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F30AC433FE for ; Wed, 12 Oct 2022 03:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229802AbiJLDt4 (ORCPT ); Tue, 11 Oct 2022 23:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbiJLDsy (ORCPT ); Tue, 11 Oct 2022 23:48:54 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1026CAA3CE for ; Tue, 11 Oct 2022 20:48:12 -0700 (PDT) Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20221012034810epoutp03f928409a5f579a7f7655fb91efb3cb18~dNbVvzmhF2708227082epoutp03S for ; Wed, 12 Oct 2022 03:48:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20221012034810epoutp03f928409a5f579a7f7655fb91efb3cb18~dNbVvzmhF2708227082epoutp03S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546490; bh=chpvPs1wVCLEiyOjSmKubsXXcJUSnABUBYGI4mNvtZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P02NzfV00THoVTk+QZ6IWlhdJ6hBA0xkv/Yby+yELrMB1jbaT82q3SdsApawvP/LS eTDjeL69EDVCBeqSkMJxejuHdKYr16SyMr3Yj6mmGiP/bYwpW+BALpZvjSWlWlxH8l 1udvrE15FebMYy/ptXMZ0RUaKYL/VkpwvX20pGLs= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20221012034809epcas5p1e25c3ac184dba31acfc1b235d7e03d0b~dNbU7b1240055500555epcas5p1f; Wed, 12 Oct 2022 03:48:09 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.178]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4MnJX53q4Dz4x9Pv; Wed, 12 Oct 2022 03:48:05 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id BE.2E.26992.5F836436; Wed, 12 Oct 2022 12:48:05 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20221011125215epcas5p1021a37aff1bc8956191ff435474e1503~dBNGtzl-U3163231632epcas5p1-; Tue, 11 Oct 2022 12:52:15 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221011125215epsmtrp1618467a7515266d81d8f8246bf757414~dBNGsyAvV2654526545epsmtrp1L; Tue, 11 Oct 2022 12:52:15 +0000 (GMT) X-AuditID: b6c32a49-0c7ff70000016970-86-634638f5a614 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id B6.94.18644.FF665436; Tue, 11 Oct 2022 21:52:15 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125212epsmtip10ce56d162cae548afeecd030a875f51d~dBNDrDPlt2145321453epsmtip1M; Tue, 11 Oct 2022 12:52:12 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 11/15] media: s5p-mfc: Add support for DMABUF for encoder Date: Tue, 11 Oct 2022 17:55:12 +0530 Message-Id: <20221011122516.32135-12-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTf1DTZRzHe77f7buBDb4h5OMuaazDgpMfq20+dICdcuObGUd01dld4tq+ AbKNtQ1LuUsNh4IgwkGLQcP4ZYDAGj8CRkYwRYEjMXJWDjVaOK87cVOOg35tbdR/r8/7eX/u 8+N5HjYeNk9w2XkqHa1RSRV8IpgxMB7zbNwjJJEl1jkhcg7WMdFt0wCBmlcWMXSr2cNAY739 LNQ3V4+jcxOjTNRom2Gir779hYG+vOs9na1zMNBiYzdALuM8gSwL15nozr230PfDDQQqN/cz UZfNwUKt9lkMtVn+wFBT/0MW0n9tYyHHyABAx0ts2EuQOm86D6hBRwug7C1unBoyOlhU84gL oywdpQR18/oIQfW2HKH0F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4oAwAA X-CMS-MailID: 20221011125215epcas5p1021a37aff1bc8956191ff435474e1503 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125215epcas5p1021a37aff1bc8956191ff435474e1503 References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy Add dmabuf support for mfc encoder Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- .../media/platform/samsung/s5p-mfc/s5p_mfc.c | 4 ++-- .../platform/samsung/s5p-mfc/s5p_mfc_enc.c | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index fe07112f013f..ad04ec68921b 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -850,7 +850,7 @@ static int s5p_mfc_open(struct file *file) q->io_modes = VB2_MMAP; q->ops = get_dec_queue_ops(); } else if (vdev == dev->vfd_enc) { - q->io_modes = VB2_MMAP | VB2_USERPTR; + q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; q->ops = get_enc_queue_ops(); } else { ret = -ENOENT; @@ -877,7 +877,7 @@ static int s5p_mfc_open(struct file *file) q->io_modes = VB2_MMAP; q->ops = get_dec_queue_ops(); } else if (vdev == dev->vfd_enc) { - q->io_modes = VB2_MMAP | VB2_USERPTR; + q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; q->ops = get_enc_queue_ops(); } else { ret = -ENOENT; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index f953a3ed7f20..22f6ebc28e40 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -1705,9 +1705,10 @@ static int vidioc_reqbufs(struct file *file, void *priv, struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); int ret = 0; - /* if memory is not mmp or userptr return error */ + /* if memory is not mmp or userptr or dmabuf return error */ if ((reqbufs->memory != V4L2_MEMORY_MMAP) && - (reqbufs->memory != V4L2_MEMORY_USERPTR)) + (reqbufs->memory != V4L2_MEMORY_USERPTR) && + (reqbufs->memory != V4L2_MEMORY_DMABUF)) return -EINVAL; if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { if (reqbufs->count == 0) { @@ -1784,9 +1785,10 @@ static int vidioc_querybuf(struct file *file, void *priv, struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); int ret = 0; - /* if memory is not mmp or userptr return error */ + /* if memory is not mmp or userptr or dmabuf return error */ if ((buf->memory != V4L2_MEMORY_MMAP) && - (buf->memory != V4L2_MEMORY_USERPTR)) + (buf->memory != V4L2_MEMORY_USERPTR) && + (buf->memory != V4L2_MEMORY_DMABUF)) return -EINVAL; if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { if (ctx->state != MFCINST_GOT_INST) { @@ -2842,11 +2844,12 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count) S5P_MFC_R2H_CMD_SEQ_DONE_RET, 0); } - - if (ctx->src_bufs_cnt < ctx->pb_count) { - mfc_err("Need minimum %d OUTPUT buffers\n", - ctx->pb_count); - return -ENOBUFS; + if (q->memory != V4L2_MEMORY_DMABUF) { + if (ctx->src_bufs_cnt < ctx->pb_count) { + mfc_err("Need minimum %d OUTPUT buffers\n", + ctx->pb_count); + return -ENOBUFS; + } } } From patchwork Tue Oct 11 12:25:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614670 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24E63C4332F for ; Wed, 12 Oct 2022 03:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbiJLDuk (ORCPT ); Tue, 11 Oct 2022 23:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbiJLDtS (ORCPT ); Tue, 11 Oct 2022 23:49:18 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F4EABD53 for ; Tue, 11 Oct 2022 20:48:22 -0700 (PDT) Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20221012034821epoutp04f7beb6bc4eec230c7697155b4122dcce~dNbfkZxG20566405664epoutp04_ for ; Wed, 12 Oct 2022 03:48:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20221012034821epoutp04f7beb6bc4eec230c7697155b4122dcce~dNbfkZxG20566405664epoutp04_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546501; bh=VU96B+4AmTLSo76S7TlPprnB1dXScdmwt5AHyPX25pM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lgDVCQcrhCqYV8q9zVhEGSRDdtaD0emcNODozZ2TyzCGOURDy9YQgvRGl3tjf09g/ EG63YaVp6MwiOX50m9+FQStG7cddnDuIY7Q3lye3FlTgw5GkaCM4TdjviKUgIb91Xk UnynSfnENITcmHRDe/odpTpknF9buoblia4MjKu4= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20221012034820epcas5p4ea59d009f3ff9cd18237e0aa9c54ba01~dNbe04Dug0309103091epcas5p47; Wed, 12 Oct 2022 03:48:20 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.175]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4MnJXK6443z4x9Pt; Wed, 12 Oct 2022 03:48:17 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id F6.1C.39477.10936436; Wed, 12 Oct 2022 12:48:17 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20221011125222epcas5p1599424c2b8fe888dd9f9d04c76909c07~dBNNAVtNn1056110561epcas5p1F; Tue, 11 Oct 2022 12:52:22 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221011125222epsmtrp165015956329610abae2d84a3f82bde22~dBNM-AA5-2654526545epsmtrp1O; Tue, 11 Oct 2022 12:52:22 +0000 (GMT) X-AuditID: b6c32a4a-259fb70000019a35-dd-63463901eba4 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E4.1D.14392.60765436; Tue, 11 Oct 2022 21:52:22 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125219epsmtip1fd42a1817ee88692a7c8dc315b836089~dBNJ8oHtt2178621786epsmtip1u; Tue, 11 Oct 2022 12:52:19 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 13/15] media: s5p-mfc: Load firmware for each run in MFCv12. Date: Tue, 11 Oct 2022 17:55:14 +0530 Message-Id: <20221011122516.32135-14-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTe0xTVxzHc+5tbwuu5FrRHYgiKxsqGdhiCwcGuqDWOyUTYpzRbcGmvQFC X+ktzPkH62AwxkRkuImMAaEUE95vkEfAijMD58QRSJwtApO3TnkNwcFKW7b/Pr/v7/c7v8c5 h4vzRwhPbrxaT+vUMqWAcGU139631x+ESOXC4ZZd6GnrdTZ6UthMIOPyBIaGjfMsZG5o4qDG gR9xdONuNxsV9dxno5ZboyxUN2nz9l+3sNBEUTVAU/lWAtWPDbLRyPQZ9HtbAYEu1TaxUVWP hYNMQ/0YKqt/jaGSpgUOSuvs4SBLRzNAX6X3YO9DqrKwElCtllJADZXO4dTNfAuHMnZMYVR9 +TcE9Xiwg6AaSr+g0u6ssKjLjeWAWkv5iUNl9gwR1Hy9F9W7OM+JcjuXEBZHyxS0zptWyzWK eHVsuODEqZjDMZIgochfFIKCBd5qmYoOFxyJjPKXxittaxB4J8mUiTYpSsYwgv0Hw3SaRD3t Hadh9OECWqtQasXaAEamYhLVsQFqWh8qEgoDJbbA8wlx6/+YMK2Re8FUl80xAAMnE7hwISmG ZaODxAbzyXYAp6uwTOBq4zkA2/N/JRzGEoDp833EZkZv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aATx/QUA20+wtwy3ANrvNgHWZJ0RsS7mbYE2OEYS12wpxtq/XgbP15rNs fvtPlL10zwbYmXM3CLZIcOHspD2E7fo2Sezy3yfeeJhTHj3BaaPiU8VHZn9ZEI2JPGWpu0zk gByiCPiRNBVDdxmvYkVATEqp+4D+8Wnqn1hCz17o+MeBtHVmiPgbykPoqsFruE/gVCT90OLE fUJG5QPaZS1EfIOIqkDp6RIn5ksFUjvp0pka1McoFUp3GmxzZyVUPD32elz0t2IpffOuc479 /uy/WjrmGqTUJjr3SxmiA/5VYJ4NLOY0vCpdxUdrotXcSTmvUPFZ6nR5WqbKDua+F76yGTTZ xuVtACFBG6BJESOTAGNimlRyWJF9mtNmpmizlBzfBoJJlFkk6SnqTJFS6YrjXAbHaTjtf4uQ fkE5SHdxZ31i6XSL9X7ABpI5s9cSp+/rOVewq8xtsm8M027XrR2OiHtvrtpRMFRZXrYvKubK mEfaHyANYGK3t7Zcq1UTy56t0QU6heev9qLrNgRQ75Tfl2Cr5d5VGvPBvoGMCe1yV09W/8tE dWqe91m1Gg1LVS74ltx5CcvNXG5kk3TJDO+sGIgdr7k+O1Ls9QQdijxQ4LB+lvu9Mcewo1b9 Zc/CPevrVCtLyhNCqiuro+IF2eaL28QGIZuJnTKLmrszPRFds/tLxZLS3fEa7FdoD+NKeKG7 mm2d/7HJJswcq+h26Be0wwc6WWN2YbuXb09wbl2R1DHoscp0OxkG5Y8oosNFWl7xG1d+CPws AwAA X-CMS-MailID: 20221011125222epcas5p1599424c2b8fe888dd9f9d04c76909c07 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125222epcas5p1599424c2b8fe888dd9f9d04c76909c07 References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy In MFCv12, some section of firmware gets updated at each MFC run. Hence we need to reload original firmware for each run at the start. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c index 877e5bceb75b..a70283d4c519 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c @@ -51,8 +51,9 @@ int s5p_mfc_load_firmware(struct s5p_mfc_dev *dev) * into kernel. */ mfc_debug_enter(); - if (dev->fw_get_done) - return 0; + if (!IS_MFCV12(dev)) + if (dev->fw_get_done) + return 0; for (i = MFC_FW_MAX_VERSIONS - 1; i >= 0; i--) { if (!dev->variant->fw_name[i]) From patchwork Tue Oct 11 12:25:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 614669 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30539C433FE for ; Wed, 12 Oct 2022 03:51:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbiJLDv2 (ORCPT ); Tue, 11 Oct 2022 23:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbiJLDuv (ORCPT ); Tue, 11 Oct 2022 23:50:51 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6789DAC38B for ; Tue, 11 Oct 2022 20:48:56 -0700 (PDT) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20221012034854epoutp01dccf85afa55392516e5637f508d8aeab~dNb_owF2k2322523225epoutp010 for ; Wed, 12 Oct 2022 03:48:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20221012034854epoutp01dccf85afa55392516e5637f508d8aeab~dNb_owF2k2322523225epoutp010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665546534; bh=86XWZgyf4bLUQ6hTi85Z0TENv90n/4TCwhXXF+cdNjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GCzOuxq/Tv5PrDmkMcVxGJheeBtYmG82iUsPPqAtkSl2diHcROOzuQkjl8xRu4Y+w q3qXEHRjE5dx9lTF8CyhGS8D3qKPi+wUxBi4jNMzUyVZTlnWsCSG4b4tes6L8zPXlI mRiUM/55wV2FKDqDx2IP9s/f4I4Xm//u0OUfyWOQ= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20221012034853epcas5p178f3498eb1e358d65cc973b53e1ac922~dNb_DUtzX2005220052epcas5p1A; Wed, 12 Oct 2022 03:48:53 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.175]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4MnJXz1Lxqz4x9QC; Wed, 12 Oct 2022 03:48:51 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 2F.3C.39477.02936436; Wed, 12 Oct 2022 12:48:48 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20221011125225epcas5p1b3504009ef4519a24dd44ba205606fe4~dBNQNAIGG0252702527epcas5p1h; Tue, 11 Oct 2022 12:52:25 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221011125225epsmtrp124d33f618f76af0101417aa27f082076~dBNQL8jdM2656926569epsmtrp1G; Tue, 11 Oct 2022 12:52:25 +0000 (GMT) X-AuditID: b6c32a4a-259fb70000019a35-34-63463920aa7d Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F6.1D.14392.90765436; Tue, 11 Oct 2022 21:52:25 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221011125222epsmtip13cf750c0ca431f1594dffaf426c9d395~dBNNFkVMh2344423444epsmtip1Y; Tue, 11 Oct 2022 12:52:22 +0000 (GMT) From: aakarsh jain To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: 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, smitha.t@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v3 14/15] media: s5p-mfc: DPB Count Independent of VIDIOC_REQBUF Date: Tue, 11 Oct 2022 17:55:15 +0530 Message-Id: <20221011122516.32135-15-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011122516.32135-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VTfUxTVxzNfX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4r3Lnwycq3Bteb+hqt3ab684aGnq7LuTwgq28jeu3t22d osJlWJk9vXGxebBgnpXjG3GtJZ6CByxdlHuzZx2S+6fzWCRXv0Sm4e+sRRUpXK7GP93YTLdZ qYso7+15kJ6gNF32F2MQ52vNvX9azyUvu7CDyXTLN4HeQ9rq3684bXyeevaTyjXT7TefW89L dPhy9nDJtLdzT52uuSncv/UT26YirlLL7HaJCpn6S+fvXdNQ1pRZapa16N4uDy6Zle+fZDHs zzg3h9dgghznkx1h6ft2iZ9c5bLjAK9R1LvpJ8MrNR4tE1kqd0DWSomlOCPRUIu5qDgRAAxo 3yEqAwAA X-CMS-MailID: 20221011125225epcas5p1b3504009ef4519a24dd44ba205606fe4 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221011125225epcas5p1b3504009ef4519a24dd44ba205606fe4 References: <20221011122516.32135-1-aakarsh.jain@samsung.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Smitha T Murthy This patch allows allocation of DPB buffers based on MFC requirement so codec buffers allocations has been moved after state MFCINST_HEAD_PRODUCED. It is taken care that codec buffer allocation is performed in process context from userspace IOCTL call. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy Signed-off-by: Aakarsh Jain --- .../platform/samsung/s5p-mfc/s5p_mfc_enc.c | 17 ++--------------- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 9 ++++++++- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index 22f6ebc28e40..425dcab0cd1c 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -1340,7 +1340,6 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx) struct s5p_mfc_dev *dev = ctx->dev; struct s5p_mfc_enc_params *p = &ctx->enc_params; struct s5p_mfc_buf *dst_mb; - unsigned int enc_pb_count; if (p->seq_hdr_mode == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) { if (!list_empty(&ctx->dst_queue)) { @@ -1362,10 +1361,8 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx) set_work_bit_irqsave(ctx); s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); } else { - enc_pb_count = s5p_mfc_hw_call(dev->mfc_ops, + ctx->pb_count = s5p_mfc_hw_call(dev->mfc_ops, get_enc_dpb_count, dev); - if (ctx->pb_count < enc_pb_count) - ctx->pb_count = enc_pb_count; if (FW_HAS_E_MIN_SCRATCH_BUF(dev)) { ctx->scratch_buf_size = s5p_mfc_hw_call(dev->mfc_ops, get_e_min_scratch_buf_size, dev); @@ -1731,14 +1728,6 @@ static int vidioc_reqbufs(struct file *file, void *priv, } ctx->capture_state = QUEUE_BUFS_REQUESTED; - ret = s5p_mfc_hw_call(ctx->dev->mfc_ops, - alloc_codec_buffers, ctx); - if (ret) { - mfc_err("Failed to allocate encoding buffers\n"); - reqbufs->count = 0; - ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); - return -ENOMEM; - } } else if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { if (reqbufs->count == 0) { mfc_debug(2, "Freeing buffers\n"); @@ -1754,15 +1743,13 @@ static int vidioc_reqbufs(struct file *file, void *priv, return -EINVAL; } - if (IS_MFCV6_PLUS(dev)) { + if (IS_MFCV6_PLUS(dev) && (!IS_MFCV12(dev))) { /* Check for min encoder buffers */ if (ctx->pb_count && (reqbufs->count < ctx->pb_count)) { reqbufs->count = ctx->pb_count; mfc_debug(2, "Minimum %d output buffers needed\n", ctx->pb_count); - } else { - ctx->pb_count = reqbufs->count; } } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index c4953419be0e..c00debe5db76 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -377,7 +377,6 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) default: break; } - /* Allocate only if memory from bank 1 is necessary */ if (ctx->bank1.size > 0) { ret = s5p_mfc_alloc_generic_buf(dev, BANK_L_CTX, &ctx->bank1); @@ -2255,6 +2254,14 @@ static inline int s5p_mfc_run_init_enc_buffers(struct s5p_mfc_ctx *ctx) struct s5p_mfc_dev *dev = ctx->dev; int ret; + ret = s5p_mfc_hw_call(ctx->dev->mfc_ops, + alloc_codec_buffers, ctx); + if (ret) { + mfc_err("Failed to allocate encoding buffers\n"); + return -ENOMEM; + } + mfc_debug(2, "Allocated Internal Encoding Buffers\n"); + dev->curr_ctx = ctx->num; ret = s5p_mfc_set_enc_ref_buffer_v6(ctx); if (ret) {