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 GbnQNK3BGMdwOpVaJ9WJDIpM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9dYLR6+Cre4vGsOm0XPhq2sFmuP3GW3WHr9IpPFsk1/mCwWbf3CbtG69wi7xd09 2xgtWtqOMDlIeKyZt4bRY8fdJYwe15d8YvbYOesuu8fiPS+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 */