[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a08d95f2-1861-98fc-5a6a-d9400e5dca30@xs4all.nl>
Date: Wed, 18 May 2022 11:50:43 +0200
From: Hans Verkuil <hverkuil-cisco@...all.nl>
To: Smitha T Murthy <smitha.t@...sung.com>,
linux-arm-kernel@...ts.infradead.org, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Cc: m.szyprowski@...sung.com, andrzej.hajda@...el.com,
mchehab@...nel.org, ezequiel@...guardiasur.com.ar,
jernej.skrabec@...il.com, benjamin.gaignard@...labora.com,
stanimir.varbanov@...aro.org, dillon.minfei@...il.com,
david.plowman@...pberrypi.com, mark.rutland@....com,
robh+dt@...nel.org, krzk+dt@...nel.org, andi@...zian.org,
alim.akhtar@...sung.com, aswani.reddy@...sung.com,
pankaj.dubey@...sung.com, linux-fsd@...la.com
Subject: Re: [PATCH 11/20] media: s5p-mfc: Add support for UHD encoding.
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@...la.com
> Signed-off-by: Smitha T Murthy <smitha.t@...sung.com>
> ---
> 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 */
Powered by blists - more mailing lists