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: 13004632 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 ABD5EC4332F for ; Wed, 12 Oct 2022 03:51:49 +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=hIxOH1LNwle++FluLrjjMakXFA6mI6F449w08FMWbWE=; b=RVoibMU4vuCyiE 5oJ5WQhHT1btKhmR3VflaqLWfwuQHQgPy9qIiUE9W8mwp44XAdTaA8XcGKTDEY2TiafzkulVTgWWb gANkorR1opSYxtrn+fiiQ8mgxcucGmaH/mJy6wKWYian5Qu/caUlJFU0/RdtL0MxtIQhIbWTMH0PQ REZv7DqatDMa/ors1dthwivUb8CJ8K6cdaIFWnJ04wkGH05qyvgt/Jcr7TikhUPv3frVZF1Je9/u/ y/S0LlGTnKAEaJ0gKZnU0ipLGYVNNCJZKUj57EpK7SOos7mai8TfjNrdZkNaFxgsloVD3/RKC2tUo vXxpsLmSVah0Ogxj0VYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiSlR-006enA-6A; Wed, 12 Oct 2022 03:50:37 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiSj1-006dle-33 for linux-arm-kernel@lists.infradead.org; Wed, 12 Oct 2022 03:48:09 +0000 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20221012034805epoutp023e68d74489b72e4e633d523b583d7b64~dNbQoTTbZ1764317643epoutp02h for ; Wed, 12 Oct 2022 03:48:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20221012034805epoutp023e68d74489b72e4e633d523b583d7b64~dNbQoTTbZ1764317643epoutp02h 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 GbnQNK3BGMdwOpVaJ9WJDIpMQ5YmVaThjK9IxOKoaLfxg4w0W1c/ppsJ2DV338TbBw765wE+ H9JSWGuLzgO+/EC6FcCTX3eS3mAKwCPmEsobuACsKbGCxQzbk2Cv3gLgqbpbuDfIwWDhzV/c gQ+fpCPg5Wob6eEl9OcADn9p9Jhwej8BnV1PKc9CEP0GnJzrAx4m6DD484PHhIcF9DroaDLN J0P6JVh7zjZf1MetT1Zfnd8fpA/5wLPfFWBe00Z48FEJ4eUg+LCjgfJyCHQ9urhQSAmHK8dx L6thvfXYgj8e2vpKCc/RcHo1rG+J9MrL4LeddfPlcdoPFjy9v9BKAJvLFjkclt6Z4Xn5RdhW Ww28zMKO2YqFqRwFsPK3bnAELC/+v0UFADXgBU5nyEzlDNE6iYb7+L9bU2ozLWD+qQs3NwPn 4J8iO8D4wA4gH2eWCED568pAgUqxew+n18r1WWr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7uJERx5Wlo7GPes+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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_204807_485272_51EDC69C X-CRM114-Status: GOOD ( 17.88 ) 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 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 */