Message ID | 20231025102216.50480-6-aakarsh.jain@samsung.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2503058vqx; Wed, 25 Oct 2023 03:36:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc3n3KQ8UDqji9+njTS1t9d1lsswe+d1Q405EsKwvdDn5ZwIVFMc7DP82I93t2Tkdutmvn X-Received: by 2002:a05:690c:ec2:b0:5a7:af46:d79d with SMTP id cs2-20020a05690c0ec200b005a7af46d79dmr21216324ywb.43.1698230172337; Wed, 25 Oct 2023 03:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698230172; cv=none; d=google.com; s=arc-20160816; b=iFiPpSNS/m5OQpO5CbZziQcR/JDuWcosfpIPi/6aIGNFtOdq0Ma8hUyAbST2TxFpsU bm+wi+zqPFNpon3MVtUF+zhNY1evvA5S8RGL95s6z57n6cntM9Dxb/LKmSa5eBI1uOC1 KbAEtkWd69v/zTcxjz+Hti3G/9xyBFE1TL+TPy+UVvqJsmdvQ73NlbalfXvbwtjxvTkg ik8N7gvoVQ/v67Ff8ZejMwd+bkQtri85P775VyVt4LYHJUls8waJbzI24BMKyEbmJg1v 1D0vWey4w00Rkjm6za5/gcyh1jMOusEtBwtrFzKPpo8A/D7RCeqiTSzFEKEX8+HjV7WZ u0MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=Z+KKbPVPr965VdQGjwihOK7YJEPYhTFdKL7s8gr9R5I=; fh=giZyg+MdRlhxiFmDMcnvxP+cZVcWgH5RhY+nWyyKemM=; b=ylmbJnQdSlyMAe3VTxC2fTfqJAWx9UGZDYHVIQ7Ru32LjtvMHzsK+SpPNP/xU0c4r7 u4BKphFc8AJOzznJQquSybFlM3wJiIXlfa4ER1jHNNM4K6bjEAtUHETCmN0Yd/bFp2ZR bu0rYqfCy5JKFrR+adxDEkT1mPSkgB7MXDxyvTf4r5K3rLzuJVcGYATQWLpBo/Pg19bZ OPFQLsVQgFgeedOUTAyssebBSCnRgk58njsL/SU9nNSz8q7znVJSve7PVgR76MgdALsb lxff7Zs413cFGigzQwT6Et340MbsD6PzOEqhst31N8Pb3SnFr4g2dwcm7l/dGEye3WrQ v84w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="ch/SYzkM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j17-20020a819211000000b0056d2b499fcasi10531171ywg.95.2023.10.25.03.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="ch/SYzkM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6572B807E90F; Wed, 25 Oct 2023 03:35:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234931AbjJYKfZ (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Wed, 25 Oct 2023 06:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234945AbjJYKfB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Oct 2023 06:35:01 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B2E9170B for <linux-kernel@vger.kernel.org>; Wed, 25 Oct 2023 03:34:48 -0700 (PDT) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231025103446epoutp04eeca6de90f9127d488bf67f1779f6689~RU0Qatd-e1961119611epoutp04h for <linux-kernel@vger.kernel.org>; Wed, 25 Oct 2023 10:34:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231025103446epoutp04eeca6de90f9127d488bf67f1779f6689~RU0Qatd-e1961119611epoutp04h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1698230086; bh=Z+KKbPVPr965VdQGjwihOK7YJEPYhTFdKL7s8gr9R5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ch/SYzkM4DZHoJpdS1NHOIhnzgS0I3kBjXTYNv62tzCWZDAQqCIXF+m6ELNQrJj14 lvFEyQv2aeY413HMp0Wysd0nmRuBrR/tUwOGco8rdPZ5cznyLGu5MhTOpOuJcOpZ28 2HeURVU/ofdJAuIFCPXebvpGaBsZTQXWR/sKvJZQ= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20231025103445epcas5p1e4dbabb8af54cd509b820ad7d25c0826~RU0P54RZj1501915019epcas5p1E; Wed, 25 Oct 2023 10:34:45 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.183]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4SFlfr1YXFz4x9Py; Wed, 25 Oct 2023 10:34:44 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id F2.C5.09672.34FE8356; Wed, 25 Oct 2023 19:34:44 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20231025102247epcas5p1103ae6d3194f2ffc354984e263ab7b4a~RUpyjUwAa2162221622epcas5p1G; Wed, 25 Oct 2023 10:22:47 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231025102247epsmtrp1b1aa4014eec5498ebd9a9f47c0acd370~RUpyg6Wk32140421404epsmtrp14; Wed, 25 Oct 2023 10:22:47 +0000 (GMT) X-AuditID: b6c32a4b-39fff700000025c8-8a-6538ef439205 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 61.40.18939.77CE8356; Wed, 25 Oct 2023 19:22:47 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231025102243epsmtip1fe0e041b500a410447cf8821b871a749~RUpvbjkYQ0054700547epsmtip1O; Wed, 25 Oct 2023 10:22:43 +0000 (GMT) From: Aakarsh Jain <aakarsh.jain@samsung.com> 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, dillon.minfei@gmail.com, david.plowman@raspberrypi.com, mark.rutland@arm.com, 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, linux-fsd@tesla.com, Smitha T Murthy <smithatmurthy@gmail.com> Subject: [Patch v4 05/11] media: s5p-mfc: Add support for rate controls in MFCv12 Date: Wed, 25 Oct 2023 15:52:10 +0530 Message-Id: <20231025102216.50480-6-aakarsh.jain@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231025102216.50480-1-aakarsh.jain@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTe0xTVxzHd+697S3Gspsq4awRx5rIAhNope0Oi9WpnVyGbgRdmPIHa+gd EEp701s2BskGxhLHxsONobxKEZgOEEkRKAgOCo7oAgRFCUYmBckGPkA7CMyNraXo/vv8vuf7 e5yXABeN8cWCVL2JMeo1Ogl/E9HeHxwcql5AjDS/Bkez9jIe6l3oI9CUpZ2Pald+x9D9WheB HK1tJGrqGcbQ+cFeHqoeGOahjr5pAk30dmJotGySQIV/OHFkm7nDQ875eHSrq5KPvm1p46Gz I1cxdHFgkkT146MY+tH2N4bOtf1JInPPAIlO5tbx3oV0k6UJ0ON1z3C6s3ySpGu75zDa1vA1 n753p5tPt9Z9RZuv/UXQhZcbAL12ooqkXbbt9I0lFxm7+Xja7hRGo2WMgYw+yaBN1SerJDFH Eg8kKpRSWagsEr0tCdRr0hmVRH0oNvRgqs69eUngZxpdhluK1XCcJHzPbqMhw8QEphg4k0rC sFodK2fDOE06l6FPDtMzpndkUukuhdv4SVrKwtgIxj6nMqeLBvEcUOqbD3wEkJLDoopVMh9s EoioKwB2rD3GvMEzAEvsLv7LwFU14bYJ1lMK14569U4Aiy124A3MGGx/9JjnMfGpUDjUofO0 2ErlAjhzyuTx4NQZAs40u0jPwhbqCCx1XCQ8TFA74FBd1ToLKRV8ODhLeOd7HTa29OIe9qH2 QOvyifVZIbUogFP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ASKy0j8bzvGDmELS6z895wdoqiZSWLPjHksIM1s AroSZ7fngMRFBFqBmld2MoE4zALrWSSObFgC1i0sECjxdeZRMJtFQFXi7JK5LCA2r4CtxOvj T1kgNshLrN5wgBnE5hSwk1jwrQmsXgio5v79H4wTGPkWMDKsYhRNLSjOTc9NLjDUK07MLS7N S9dLzs/dxAiOLa2gHYzL1v/VO8TIxMF4iFGCg1lJhDfSxyJViDclsbIqtSg/vqg0J7X4EKM0 B4uSOK9yTmeKkEB6YklqdmpqQWoRTJaJg1OqgcnD+kClUdYbh7R3IZtZJKenyrN/WnCC+b3T x6bk45d9dqScXXTLn7FWe7fNGXW5rS1ScqKxD7oNLnwV7DdT82nme797X86sufPDdNw2Jk/Y kPFK84zNobfinnw/PX22dede+KDG+OSIq3yRxvzOyg1buPz/7etg5u0672NjbXvCQnRG0gzb HV5LQwKOmnxVl+xIPpS2YKrFxUTZ270MSoHdRjma9lusOkwvTtErLrRx0F1duWPfSR/hsxGs c4wY3Oxs3J6ffb+i7M/08gXiwnELDdSi5xac+/FQfDFHgvb3n81lWv//2Ab6P6z34GG1KaqV fKl+9cSXYyrGPp05m+K2fbe8eCjwx6x/u/rKlFiKMxINtZiLihMBk9NIlhwDAAA= X-CMS-MailID: 20231025102247epcas5p1103ae6d3194f2ffc354984e263ab7b4a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231025102247epcas5p1103ae6d3194f2ffc354984e263ab7b4a References: <20231025102216.50480-1-aakarsh.jain@samsung.com> <CGME20231025102247epcas5p1103ae6d3194f2ffc354984e263ab7b4a@epcas5p1.samsung.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 03:35:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780723401395038474 X-GMAIL-MSGID: 1780723401395038474 |
Series |
Add MFC V12 support
|
|
Commit Message
Aakarsh Jain
Oct. 25, 2023, 10:22 a.m. UTC
In MFCv12, the rc configs are changed with support for CBR loose, CBR tight and Variable Bitrate (VBR) added. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy <smithatmurthy@gmail.com> Signed-off-by: Aakarsh Jain <aakarsh.jain@samsung.com> --- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 22 +++++++++++++++---- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h | 1 + 2 files changed, 19 insertions(+), 4 deletions(-)
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 e579c765e902..bed45857bd6c 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 @@ -1025,10 +1025,24 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx) /* reaction coefficient */ if (p->rc_frame) { - if (p->rc_reaction_coeff < TIGHT_CBR_MAX) /* tight CBR */ - writel(1, mfc_regs->e_rc_mode); - else /* loose CBR */ - writel(2, mfc_regs->e_rc_mode); + if (IS_MFCV12(dev)) { + /* loose CBR */ + if (p->rc_reaction_coeff < LOOSE_CBR_MAX) + writel(1, mfc_regs->e_rc_mode); + /* tight CBR */ + else if (p->rc_reaction_coeff < TIGHT_CBR_MAX) + writel(0, mfc_regs->e_rc_mode); + /* VBR */ + else + writel(2, mfc_regs->e_rc_mode); + } else { + /* tight CBR */ + if (p->rc_reaction_coeff < TIGHT_CBR_MAX) + writel(1, mfc_regs->e_rc_mode); + /* loose CBR */ + else + writel(2, mfc_regs->e_rc_mode); + } } /* seq header ctrl */ diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h index 30269f3e68e8..24752a712fbf 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h @@ -40,6 +40,7 @@ #define ENC_H264_LEVEL_MAX 42 #define ENC_MPEG4_VOP_TIME_RES_MAX ((1 << 16) - 1) #define FRAME_DELTA_H264_H263 1 +#define LOOSE_CBR_MAX 5 #define TIGHT_CBR_MAX 10 #define ENC_HEVC_RC_FRAME_RATE_MAX ((1 << 16) - 1) #define ENC_HEVC_QP_INDEX_MIN -12