From patchwork Wed Dec 6 06:30:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 97683 Received: from sv.mirrors.kernel.org ([139.178.88.99]) by www.linuxtv.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rAlW1-00CJtX-S7 for patchwork@linuxtv.org; Wed, 06 Dec 2023 06:36:14 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 683702822CE for ; Wed, 6 Dec 2023 06:36:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EA15DDD7; Wed, 6 Dec 2023 06:36:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="tw13r61r" X-Original-To: linux-media@vger.kernel.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F116CD42 for ; Tue, 5 Dec 2023 22:35:59 -0800 (PST) Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20231206063555epoutp03cb92544c8e7a0746bf11cbb8cdb520bd~eKpsnyZOQ1412814128epoutp03E for ; Wed, 6 Dec 2023 06:35:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20231206063555epoutp03cb92544c8e7a0746bf11cbb8cdb520bd~eKpsnyZOQ1412814128epoutp03E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1701844555; bh=eOtPRlkv0GpFVsKpaPi+IxIe9vCjHYKTWVJ1SPsLF98=; h=From:To:Cc:Subject:Date:References:From; b=tw13r61rgtZErPRNssUXCcb7eBmIPq53qnFdtPR29S0Hr68rR/oZ40iuh5ovy0Exv yTG5Q4oi1PkVHlvSewDQ6t+A1govz/6AsvUF2KgK6LDxLHClXzMy3d0oOWavRclKxV avlx9sPbZrTMKbs0783kdSmStRBGjrleaHCWU7Z0= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20231206063554epcas5p2f96c5c1476ef3e5d3fbeebd8b1433b29~eKpr1xLRb2808128081epcas5p2G; Wed, 6 Dec 2023 06:35:54 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4SlSMr6vcfz4x9QC; Wed, 6 Dec 2023 06:35:52 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id CC.56.09634.84610756; Wed, 6 Dec 2023 15:35:52 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20231206063105epcas5p3034f89af2be6922ab04771de099a124a~eKlfV2vOw1077710777epcas5p3L; Wed, 6 Dec 2023 06:31:05 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231206063105epsmtrp2d3d99defbc4fd8f734532fa1e4682e41~eKlfUgH_01483414834epsmtrp22; Wed, 6 Dec 2023 06:31:05 +0000 (GMT) X-AuditID: b6c32a49-eebff700000025a2-0d-657016486f85 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C4.96.07368.92510756; Wed, 6 Dec 2023 15:31:05 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231206063103epsmtip21e1f680b29e1b75c4a90176398c73196~eKlczsc1t3080830808epsmtip2e; Wed, 6 Dec 2023 06:31:03 +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, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, linux-samsung-soc@vger.kernel.org, andi@etezian.org, gost.dev@samsung.com, alim.akhtar@samsung.com, aswani.reddy@samsung.com, pankaj.dubey@samsung.com, ajaykumar.rs@samsung.com, aakarsh.jain@samsung.com Subject: [Patch v5 00/11] Add MFC V12 support Date: Wed, 6 Dec 2023 12:00:34 +0530 Message-Id: <20231206063045.97234-1-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSbUxbZRTee297ewHLroD6rqGOXDc7SApUSrkodd9LDVtCUpMtS5DdtDct 0i/7MVfNsi6jycSxbAY3QbqxwYZSoNgCFigEOzLiInQ6AiKgIFuEMTq26sRIxH6h/57znOe8 5znnPTia4sB4eLnOzBh1tIbEElndtzKzhLIXDUzuPz4J9cBby6YGH3/DomavdGNU4+pvCPVL Y4hF+T1dHKq1fxShrg6NsqnJwR6E+r52hkWdX5hDKff8OJu611uPUec6utjUZ4EBhGobmuFQ N91rCHW963cOZe8f4uxKlU00PUVljb5FROZu+QiTTY/7MJmn6ZTsfGcLkIXcL8vu/BHilOBH K4rUDK1kjBmMTqFXlutUUrJYXra3LF+SKxKKCqkCMkNHaxkpue9gifBAuSY8EJlxnNZYwlQJ bTKROW8WGfUWM5Oh1pvMUpIxKDUGsSHbRGtNFp0qW8eYXxfl5r6WHxYeq1A3rNehBt/WE07n E2ADXbwqkIBDQgyDj0bQKpCIpxB9ADav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XBlLPg/i7lgj3zF6tUf GRsYt0p1MXJySAiYSJxdv4Wpi5GLQ0hgN6PEuZaJLBAJGYn/bcfYIWxhiZX/nrNDFDUzSRz6 +Aqog4ODTUBX4uz2HJC4iEAro8T1lZ1gk5gFpjNLfH3ZCzZJGKjo/K2HjCA2i4CqxNzzi5lB bF4BW4l3W9YzQmyQl1i94QDzBEaeBYwMqxglUwuKc9Nzkw0LDPNSy/WKE3OLS/PS9ZLzczcx goNbS2MH4735//QOMTJxMB5ilOBgVhLhzTmfnyrEm5JYWZValB9fVJqTWnyIUZqDRUmc13DG 7BQhgfTEktTs1NSC1CKYLBMHp1QDk9aN7PT3vnE+EiE3vHsCzu1a98iTe8u12U9nX2LIipL/ UL7zZsbLS6HV0gzP/xiqS1hpCfsv+DUvvjbag1thvqnew22Xl+RuyUnf+vUkz0/L4py5P+4r 3F8w84jVn4Wt1omTis48km9wZj3u6ylcm1Qj5vt53tuIVQcXS03do9rKu/9298vzfV5Xljtc /n4iepl0996u3RmvlWal6pyexjynOvaxzBPpaZoyJ9+UC+0PlfiQvmKjxAOmeBc5S/N/R5aF Pn3zbTXT5e+8Ez55GM852XhEKNNE/5iGbKrEz2WGcqsyamIyY8zP/HWpPuZcvFlnTbuHmriM 4otjZTqvC9Z/t+N4zrN2jjATp8zKjUosxRmJhlrMRcWJACy7k+fdAgAA X-CMS-MailID: 20231206063105epcas5p3034f89af2be6922ab04771de099a124a X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231206063105epcas5p3034f89af2be6922ab04771de099a124a References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-LSpam-Score: -4.8 (----) X-LSpam-Report: No, score=-4.8 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=unavailable autolearn_force=no This patch series adds MFC v12 support. MFC v12 is used in Tesla FSD SoC. This adds support for following: -Add support for YV12 and I420 format (3-plane) -Add support for Rate Control, UHD and DMABUF for encoder -Add support for DPB buffers allocation based on MFC requirement Changes since v4: -Addressed review comments by Krzysztof Kozlowski. As per discussion included iommus property in dt-schema. -Addressed review comments by Hans Verkuil. Fixed checkpatch warnings with --strict flag enabled. Upstreamed s5p-mfc-v12.fw to linux-firmware. Added comment in the patch 9 regarding loading mfc firmware v12 sequentially. -Addressed review comments by Nicolas Dufresne Made use of v4l2-common library to get number of planes needed for particular format in patch 4. v4 link:https://patchwork.kernel.org/project/linux-media/patch/20231025102216.50480-2-aakarsh.jain@samsung.com/ Changes since v3: -Removed vp9 codec support for now and just keeping MFC v12 base patches with necessary hardware controls, decoder, encoder and structural changes. Also covers luma dbp, chroma dpb and mv sizes for each codec as per the UM for MFCv12, along with appropriate alignment. v3 link: https://patchwork.kernel.org/project/linux-media/cover/20221011122516.32135-1-aakarsh.jain@samsung.com/ Changes since v2: -Addressed review comments by Rob Herring. This was regarding the errors found by Rob bot in yaml file. File 'samsung,s5p-mfc.yaml' is already converted into json schema and is merged. -Addressed review comments by Krzysztof Kozlowski. This was regarding depricated properties mentioned in s5p-mfc.txt file. Review comment was addressed and 'samsung,s5p-mfc.yaml' is already merged now. -Addressed review comments by Andi Shyti. This was regarding addition of 'MFC_V10PLUS_BITS' macro in 's5p_mfc_common.h file. v2 link: https://patchwork.kernel.org/project/linux-media/cover/20220907064715.55778-1-smitha.t@samsung.com/ Changes since v1: -Addressed review comments by Krzysztof Kozlowski. Separated bug fixes patches, resent again with fix tag and those are merged now. -Added SoC based compatible string. -Addressed review comments by Andrzej Hajda Assigned width64 and height32 variable with ALIGN(ctx->img_..) used in the code in 's5p_mfc_opr_v6.c' file. v1 link: https://patchwork.kernel.org/project/linux-media/patch/20220517125548.14746-2-smitha.t@samsung.com/ Aakarsh Jain (11): dt-bindings: media: s5p-mfc: Add mfcv12 variant media: s5p-mfc: Rename IS_MFCV10 macro media: s5p-mfc: Add initial support for MFCv12 media: s5p-mfc: Add YV12 and I420 multiplanar format support media: s5p-mfc: Add support for rate controls in MFCv12 media: s5p-mfc: Add support for UHD encoding. media: s5p-mfc: Add support for DMABUF for encoder media: s5p-mfc: Set context for valid case before calling try_run media: s5p-mfc: Load firmware for each run in MFCv12. media: s5p-mfc: DPB Count Independent of VIDIOC_REQBUF arm64: dts: fsd: Add MFC related DT enteries .../bindings/media/samsung,s5p-mfc.yaml | 18 ++ arch/arm64/boot/dts/tesla/fsd.dtsi | 21 ++ .../platform/samsung/s5p-mfc/regs-mfc-v12.h | 52 +++ .../platform/samsung/s5p-mfc/regs-mfc-v7.h | 1 + .../platform/samsung/s5p-mfc/regs-mfc-v8.h | 3 + .../media/platform/samsung/s5p-mfc/s5p_mfc.c | 36 ++- .../platform/samsung/s5p-mfc/s5p_mfc_common.h | 29 +- .../platform/samsung/s5p-mfc/s5p_mfc_ctrl.c | 10 +- .../platform/samsung/s5p-mfc/s5p_mfc_dec.c | 60 +++- .../platform/samsung/s5p-mfc/s5p_mfc_enc.c | 149 ++++++--- .../platform/samsung/s5p-mfc/s5p_mfc_opr.h | 14 +- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c | 12 +- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 300 ++++++++++++++---- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h | 7 +- 14 files changed, 563 insertions(+), 149 deletions(-) create mode 100644 drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h