From patchwork Wed Sep 7 06:47:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smitha T Murthy X-Patchwork-Id: 12968498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D8D9C38145 for ; Wed, 7 Sep 2022 06:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BzC/3C684l+ItU87bQbmvv/JQHjy7zCHE1MoTvXDUaI=; b=kzApYuPmiidgo8 VQwMBjDSh4Zz8OUNSXWqhM1pSbHU3Ir4ec9aE3uXHcp+PGPXivH+n94K7a913Qz4LlkgsweE7HAW3 p+YEZhMfZzuO1wKXZGOuWlZDMK6y5IofZm8sUZpvW89eag3cIqj6MXDjeR5o5DG2NJKrCd8Y/VFDn uINT84yTOK1FBV48Nl4ooV+035U7w2KxhrvIeOSR46qn/GwVIoA2nBZQrEiez+ur3CEa8Vz95el16 gaYRwnkMlGEa3zxEZyX5fhPPhuAt286Y0e2hjwowhPhBfq7LQmUYyk2yxocbj9a9sC6M1Ziuq98JO tVxpR1S47jY9ttRE+W4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVolE-003JPl-EV; Wed, 07 Sep 2022 06:42:08 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVogO-003H8R-PV for linux-arm-kernel@lists.infradead.org; Wed, 07 Sep 2022 06:37:13 +0000 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220907063706epoutp01ffc974b593022cbcdbae261641f7e822~SgJ2cMr4X0748707487epoutp01N for ; Wed, 7 Sep 2022 06:37:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220907063706epoutp01ffc974b593022cbcdbae261641f7e822~SgJ2cMr4X0748707487epoutp01N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1662532626; bh=pebp5yhzcAp0RQ70IsF3Fog/Q377n/Hruoo7FPLqIqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kAt0JgDf2wghMhWOuvLcyNswxk0YEfCShtjYa4VVNEaVTnC8KHFbwMspyN++uYa2i f80n1lTGYsbxH1sazej9O0VZ/8s6SjBzETnSO74OMmbcbFaPDICAgQzfmGpgwUaURV 7Vect9fQ0FY/ghwioeFnHro8IQaikmktGJZDG9Sk= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20220907063706epcas5p1c3a5dbd1254217814d578fc45116d976~SgJ19FYWt2134521345epcas5p17; Wed, 7 Sep 2022 06:37:06 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.183]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4MMsx95WFhz4x9Q2; Wed, 7 Sep 2022 06:37:01 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C2.77.59633.A0C38136; Wed, 7 Sep 2022 15:36:58 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20220907063352epcas5p2deb747c1a6a293fcc7275aed05010552~SgHBQsIy70472404724epcas5p2D; Wed, 7 Sep 2022 06:33:52 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220907063352epsmtrp2f704ac93ae696291dc5efcbbd8ffcbbc~SgHBORNiY1916519165epsmtrp2L; Wed, 7 Sep 2022 06:33:52 +0000 (GMT) X-AuditID: b6c32a49-dfdff7000000e8f1-58-63183c0a9910 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id BE.DC.14392.05B38136; Wed, 7 Sep 2022 15:33:52 +0900 (KST) Received: from Jaguar.sa.corp.samsungelectronics.net (unknown [107.109.115.6]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220907063348epsmtip1175500c4c56e238da9991a56fd227f41~SgG98Bvrg2482524825epsmtip1k; Wed, 7 Sep 2022 06:33:48 +0000 (GMT) From: Smitha T Murthy 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 v2 10/15] media: s5p-mfc: Add support for UHD encoding. Date: Wed, 7 Sep 2022 12:17:10 +0530 Message-Id: <20220907064715.55778-11-smitha.t@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220907064715.55778-1-smitha.t@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTeVBTVxTGvS/JS2AafCKOVypL3+hUKGBSyeOydUGnPIswdOw+tfAmeQJD tuYF3KhlqRUYWTpjZUSBDiAySCkNSwChIk0GFGuHFo2ljYBAU2g1rQG6UNsmJLT//c4537nf vefeK+L5TuP+oiy1ntWpGSWJe/O7vwgJDfeOg3LJYl0Qmus5K0BTtd04avjdhqHJBgcfDXV0 CVHn+Dkeujg8KEB1ppsCZLx6j48++9FZHTtr5SNbXRtA89V3cWSYuS1A0wuvoW/6zuPoVHuX AH1isgrRBcsYhpoMf2GovmtRiE4MmITI2t8N0PsfmLDnIN1a2wroHmsjoC2ND3l0b7VVSDf0 z2O0oaUEp7+/3Y/THY3v0SfMf/Lp8s4WQP9dWCOkS00WnHYYAunrSw5hqs+b2XGZLKNgdcGs Wq5RZKkz4smk/Wm702SURBoujUZRZLCaUbHx5J59qeEvZCmdYyCDcxlljjOVynAcufOZOJ0m R88GZ2o4fTzJahVKbaQ2gmNUXI46I0LN6mOkEsnTMqcwPTuzb9iMaSs3HL5mMeP5oNWnFHiJ IBEJLw4+wkuBt8iXuAxg7VUjzx08BLDtjhm4g2UA+4drwFqLpdfIdxcGAFwpb8TcQREGS6vc KpwIg8v2UdzFfkQBgDPFepeIRxTxofXGitBV2EgkwnxLvsDFfGI7/Nw+4lxWJBITMdA+T7nd guCl9kGei72c6bHTIwLXOpA46QXrpn/C3KI9sKBsTuDmjXBhuFPoZn/oeDCAuzkDTjqKPEfQ wpr8Tk/vs3Bw/PyqL48IgZ/27XSnA+BH19tWJTzCB5atzHrkYthTu8YkrL8x4rGC8Nb9Ls8W aFg50O6ZUBmA31aUCCtBYPX/Fh8D0AK2sFpOlcFyMq1UzR7679rkGpUBrL710L09wDr1S8QQ wERgCEARj/QTK3r85L5iBXPkKKvTpOlylCw3BGTO+X3I898k1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CvCmJ lVWpRfnxRaU5qcWHGKU5WJTEeS90nYwXEkhPLEnNTk0tSC2CyTJxcEo1MLHE2P9NNr7oETph oa6dYT9v/fvZEnb2bJ/37V5aGBjTIbC7S1/kysnlOx7ONTX8OiX+deKDeVwH82Xc5aInCGtd dY+4788uypXf3vPnZKRd+NP1G2/9fu4ae8PUqE+Y7fk15e/iG277aN65zXKvXnxdo2336o3v gzYtXZkeJsCkKif5e7XSnetCmU7sQmf2fFv87JulDpPm73tfHn4KuXI4jmF+57vaz+qN3rOV TY9P+H5m0g2BzFMCzmu0jLfqP9ghc7Y25vyXX8e/dpV5Wxnae3tMtumMf6plf3B//7QzAZwd nrsm5lh35P3jChbj17hxparmmrpj+Mvl8ZNsF575tq6uOyxJxdC5v531tRJLcUaioRZzUXEi AIbg8hkrAwAA X-CMS-MailID: 20220907063352epcas5p2deb747c1a6a293fcc7275aed05010552 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220907063352epcas5p2deb747c1a6a293fcc7275aed05010552 References: <20220907064715.55778-1-smitha.t@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_233709_289499_D67C7FBB X-CRM114-Status: GOOD ( 20.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 3eac592f369f..119e55c6f759 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -1627,9 +1627,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 c0b8434812e0..db06e3387d14 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 @@ -1118,6 +1118,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 */