From mboxrd@z Thu Jan 1 00:00:00 1970 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 9EB11C433F5 for ; Wed, 18 May 2022 09:51:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234608AbiERJvp (ORCPT ); Wed, 18 May 2022 05:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234679AbiERJuz (ORCPT ); Wed, 18 May 2022 05:50:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D78F2C138; Wed, 18 May 2022 02:50:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 51975B81EFB; Wed, 18 May 2022 09:50:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28623C34113; Wed, 18 May 2022 09:50:44 +0000 (UTC) Message-ID: Date: Wed, 18 May 2022 11:50:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH 11/20] media: s5p-mfc: Add support for UHD encoding. Content-Language: en-US To: Smitha T Murthy , 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, 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 References: <20220517125548.14746-1-smitha.t@samsung.com> <20220517125548.14746-12-smitha.t@samsung.com> From: Hans Verkuil In-Reply-To: <20220517125548.14746-12-smitha.t@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Smitha, On 5/17/22 14:55, Smitha T Murthy wrote: > 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 | 4 ++-- > .../media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 12 ++++++++++++ > 2 files changed, 14 insertions(+), 2 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 456edcfebba7..9b624f17e32b 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > @@ -1630,8 +1630,8 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f) > return -EINVAL; > } > > - v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1, > - &pix_fmt_mp->height, 4, 1080, 1, 0); > + v4l_bound_align_image(&pix_fmt_mp->width, 8, 3840, 1, > + &pix_fmt_mp->height, 4, 2160, 1, 0); Is this supported by older MFC versions as well? This seems to enable UHD support for all MFC versions. Regards, Hans > } 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 7db7945ea80f..2b6d6259a209 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 > @@ -1127,6 +1127,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 */ From mboxrd@z Thu Jan 1 00:00:00 1970 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 8856AC433F5 for ; Wed, 18 May 2022 09:52:02 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1f18Yd8Qe/odRnImCVKsrI6+kvmNK2nE9ETtqN9bCpU=; b=U3MlFJrQK/y3hV sYvjEIdzfo7ch4aTYsxCSgoKkeDhYS/+KWMbl/6fPK7qDjFdueeausV4xywqJUIo5lp/3SMxJ96qS npcTRlulryBGrzVrENLaAvS2r3T1BV2UlktJ8D4ciDhSGaeCTTXLTKEARemjiF7vg7uf4uf7+Q94U d7yT/miHkFedoLgfet//zVfih2rsKjB+ukV8NFiJQzVgxlONN0KNjEQ24qbq11RCJKiUs6TW5DTJ5 cTifhO2AAlokJ/515d/JgbTgqJJvwvt4kOVsI9OBtLBRtDFl7yE4jvw/SWuX8urLM608FYDxhx2i8 +B9wFDA7F6QM4YPaPxsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrGKW-001BdJ-4l; Wed, 18 May 2022 09:50:56 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrGKR-001Bao-Kj for linux-arm-kernel@lists.infradead.org; Wed, 18 May 2022 09:50:53 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 48170B81EF3; Wed, 18 May 2022 09:50:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28623C34113; Wed, 18 May 2022 09:50:44 +0000 (UTC) Message-ID: Date: Wed, 18 May 2022 11:50:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH 11/20] media: s5p-mfc: Add support for UHD encoding. Content-Language: en-US To: Smitha T Murthy , 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, 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 References: <20220517125548.14746-1-smitha.t@samsung.com> <20220517125548.14746-12-smitha.t@samsung.com> From: Hans Verkuil In-Reply-To: <20220517125548.14746-12-smitha.t@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220518_025051_840167_5DDF0CE0 X-CRM114-Status: GOOD ( 19.21 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Smitha, On 5/17/22 14:55, Smitha T Murthy wrote: > 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 | 4 ++-- > .../media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 12 ++++++++++++ > 2 files changed, 14 insertions(+), 2 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 456edcfebba7..9b624f17e32b 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > @@ -1630,8 +1630,8 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f) > return -EINVAL; > } > > - v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1, > - &pix_fmt_mp->height, 4, 1080, 1, 0); > + v4l_bound_align_image(&pix_fmt_mp->width, 8, 3840, 1, > + &pix_fmt_mp->height, 4, 2160, 1, 0); Is this supported by older MFC versions as well? This seems to enable UHD support for all MFC versions. Regards, Hans > } 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 7db7945ea80f..2b6d6259a209 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 > @@ -1127,6 +1127,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 */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel