From patchwork Wed Oct 25 10:22:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aakarsh Jain X-Patchwork-Id: 158015 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2504662vqx; Wed, 25 Oct 2023 03:39:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFG+BPCowkZ6XQbKnVJYmYWMkYDTO34tHUNLV/hHRR4jblxyf3OTz/izpxcgSNEsUEkn+l/ X-Received: by 2002:a25:e74b:0:b0:d9c:fe8a:5ffc with SMTP id e72-20020a25e74b000000b00d9cfe8a5ffcmr13195763ybh.31.1698230397950; Wed, 25 Oct 2023 03:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698230397; cv=none; d=google.com; s=arc-20160816; b=ZYopH+BcIpI98h9z5qnOWKyra/+iFFL1SEvjw/GG88DLnvlQoGAiATRsYy7CMPS0k0 UQCbEy96X59N9dNuz7+S9aqHAmArLNj2deEsw2n3B7Ttx2/RdovY7IoPVi19iV0rXeSx nDQjHTm3jpth9eSXVTYlIyzWzUBTcit+l4xDEGjUp3DdqCXZX8qmQW6tPmIo8ui8DcRa nVxyb/gID1svhMqOU7ob7x5keSZqCQu1qEJdItGosXOl9ysnNoZsQZe4DWi0kFIdyLuE WXy9DnJgdjVHV27rt7ep86lgrEbpLNx2hSJ68yEo7Cin+7j7n5yxjt7rERsl0OY4pgd7 XHLw== 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=9GpUiOqgpaKnK/kt4FXCA/fW7cvkvm7nRH/fpn+snG0=; fh=giZyg+MdRlhxiFmDMcnvxP+cZVcWgH5RhY+nWyyKemM=; b=OQrUwdumbwYz78eiKTK0x/aTlJwMpUvgUUEUT0g3mFpF/KNyxk30LfNo91I2XvPeaL /cNu5haH/eDrEVASqg8Ih5zkvYiAlhpcORAjc8Iybh41/FJSaAyFnsNc1a73GMDbKwBi rFQfx+SzfSI9vohwKcG55RmHm1q19EZJXiPgKlSDPSubYrXe4XEipg7vLHKOYgVLC2C1 tOT28KJoL/9MrLRBXbJ2PhVpzodOruQkKUDaFbFewONlmfKYcZLgEf+BnEuGsJfRSPYI 9BC5IiTvXmUcD6dMROdOphjpn0KpsFlfto5sHzZ7X+UI4uxaaQ2viVWhIUvwcZAuZcl9 zEqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ibubbp6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id g138-20020a25db90000000b00da06fb44e62si1579403ybf.300.2023.10.25.03.39.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:39:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ibubbp6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 7F81780E6586; Wed, 25 Oct 2023 03:39:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234618AbjJYKjx (ORCPT + 26 others); Wed, 25 Oct 2023 06:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343812AbjJYKgK (ORCPT ); Wed, 25 Oct 2023 06:36:10 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F54119A9 for ; Wed, 25 Oct 2023 03:35:20 -0700 (PDT) Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20231025103518epoutp02dd493960de866d76f303c8108fad2d0b~RU0uQxdqo0470004700epoutp02T for ; Wed, 25 Oct 2023 10:35:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20231025103518epoutp02dd493960de866d76f303c8108fad2d0b~RU0uQxdqo0470004700epoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1698230118; bh=9GpUiOqgpaKnK/kt4FXCA/fW7cvkvm7nRH/fpn+snG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ibubbp6IfWwMPntT8N7UReZe/3qzSoN/hByEZKrHAuJfQc7RDEoHXbY/eUk+Mwh4n tQoGSoGt9oXK1B+dn0/0vdnF/hh4jjToLaRRV3q9w9N5dV3CC/nfvGXE8v7cWitb6x IWCmIVRB+9+6tB4LjDsQM3UBUXpr4+bsCX8MbCWo= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20231025103517epcas5p17763402a4b1ac8faa3eee9f79362a8ab~RU0try1qR1904419044epcas5p1W; Wed, 25 Oct 2023 10:35:17 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.179]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4SFlgR4ltrz4x9Pr; Wed, 25 Oct 2023 10:35:15 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 8B.1C.10009.36FE8356; Wed, 25 Oct 2023 19:35:15 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20231025102250epcas5p375603c0f150fd508f0c0aa3ec6305517~RUp1rWPd61181411814epcas5p3q; Wed, 25 Oct 2023 10:22:50 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231025102250epsmtrp2af06661f42d6497db2de54ef3cc0015c~RUp1qdt2a0882508825epsmtrp2L; Wed, 25 Oct 2023 10:22:50 +0000 (GMT) X-AuditID: b6c32a4a-ff1ff70000002719-57-6538ef637724 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 82.70.07368.A7CE8356; Wed, 25 Oct 2023 19:22:50 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231025102247epsmtip1ac3813ce37c72c5dcd07a91526f6e1a4~RUpymxxfS0719907199epsmtip1w; Wed, 25 Oct 2023 10:22:47 +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, 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 Subject: [Patch v4 06/11] media: s5p-mfc: Add support for UHD encoding. Date: Wed, 25 Oct 2023 15:52:11 +0530 Message-Id: <20231025102216.50480-7-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: H4sIAAAAAAAAA0WTfUxTVxjGd+697S3Esiu47EA2JM0kYAZSKXgQypbw4VVJBnGLsGXDu/au JZS2a8s2+GfC7KZ1KBJkg0B10OKGCFgoH0q1fBhUWBecwgigfKpQh44yZV8ySmH773ee87x5 zvuec3i4721uAC9LqWM1SkYh4HoTrT2hIWGSx4iNuNsfiGbbyznI/riLQBPGVi6qWX6AoXs1 LgJ1N1tJVG9zYOhcn52DzvQ6OKita4pAI/YODA2WjxPoxMNJHFmmhzhocv4g+vlSJRd93WTl oG9/uoKhC73jJDIPD2Ko1vI3hqqtSyTS23pJdKTAxHkT0vXGekAPmxZxuqNinKRrOucw2lJ3 jEuPDXVy6WbT57T+2p8EfaKlDtDPC6tI2mUJpG/+7iJTN72bHSdnGSmrCWKVEpU0SykTC/Yf yEzIjIqOEIYJY9AuQZCSyWHFgsSU1LDkLMVq84KgTxhF7qqUymi1gh3xcRpVro4Nkqu0OrGA VUsVapE6XMvkaHOVsnAlq9stjIjYGbVqPJQtb6t6QKj7N3921DrAOQymfAzAiwcpERy2WDkG 4M3zpS4DeHHmJO5ZLALYs6IHnsVTAEsKm4mNktGCpTX2pWwANpaJPSY9Bh9Z2kgD4PG4VBj8 sU3h9myhCgCcPqpze3DqGwJON7hI94YftQc2DIxibiaobbB+ZAW4a/mUGN4tjfFkbYXnm+y4 m72oeHj2aSHp0Zd5sMmU4OFEWPy8muNhPzjf17LuCYCuBRvXwxI4XT2He1gBGztL13t5A9pv VxLuWJwKhY2XdnjkV+Hpmw1rJ8MpH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2Z20wgNouAqsSam//BmnkFbCXu TbGEWCAvsXrDAWYQm1PATmLBtyawViGgkvv3fzBOYORbwMiwilEytaA4Nz032bDAMC+1XK84 Mbe4NC9dLzk/dxMjOMa0NHYw3pv/T+8QIxMH4yFGCQ5mJRHeSB+LVCHelMTKqtSi/Pii0pzU 4kOM0hwsSuK8hjNmpwgJpCeWpGanphakFsFkmTg4pRqYepn1+S8pxr9dsl4her9q10trVQMn RoO/YjIXvy64+b9bkevMgSnN9TmdVy9fmT/VOfdRs4J16FWzvOBAd4vsHTuClVedVTAs46+Y kW1xXu696XTD4ye28rv8yd4ovkbvwkKZHrkte2rZJ2ivO9E4/eWF8h1sB7e/2//r0feUGc5X 7ug9Xx/gxLKZqXSprssqlnjjgqBDDIvYZgQ5zm4/dJ2thLnj+aPp69rfWclcPv20+taDhIyP R5p7f7G63gm+F/+mde3r7s5473nahfo7thyR+fN8M18c8zyOinz7msuWUnnfd64tfutd7Pnw me+J2zzHjzHPPD5rz5VpuhHts6fcKf50rvp0hplVlM58fSWW4oxEQy3mouJEAD45mC8gAwAA X-CMS-MailID: 20231025102250epcas5p375603c0f150fd508f0c0aa3ec6305517 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231025102250epcas5p375603c0f150fd508f0c0aa3ec6305517 References: <20231025102216.50480-1-aakarsh.jain@samsung.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 03:39:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780723637762313237 X-GMAIL-MSGID: 1780723637762313237 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 0eec04eb3ef3..0afa8426ca4e 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -1460,9 +1460,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 bed45857bd6c..290d82e99940 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 @@ -1104,6 +1104,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 */