Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp330714iob; Wed, 18 May 2022 03:12:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjvoJZl+wmtNbv+B+7y2CuduMY7vGxk6fhuk6TWD/irM7tZMFk0yiOrcXc77zPYBIwrqF4 X-Received: by 2002:a05:6a00:18a9:b0:50d:d41b:7240 with SMTP id x41-20020a056a0018a900b0050dd41b7240mr26881667pfh.66.1652868770506; Wed, 18 May 2022 03:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652868770; cv=none; d=google.com; s=arc-20160816; b=KYDf0JD4wuXbjh0aUSUOszw8SJAaJLDZwBFWZYmNBnMpK4h2dnvpWqLJb6xEAy1zDt IfbD6ZKGZXTu2NKUC6kayBiE8yHDdBscu8NgEhI/HJmMzupjIDrV9gY6U06WEtmY2zLu y9lZt1MTe7/ihNNccnGXHLvyW2A8HrUKrgBPHJDLQHg7hl4CIDvBbj2o/hl2VEcHGb9a vPtK+Z4FsMzPvgGGGbY4gVwfzv1sOfKvmc+naLGwu6jpHy1WRi+rsB14EVVYEYl7r1VI t3eAknRRPcZkTs/26PvDH25v9nUNeIacx4kQ+B4bTHkzEke19gMRDmoa+KnN69ee9ouL WT0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=sJkLpQ/gYijXi99UGQnfjsbTqjx5Cf52ARuUufS/01U=; b=1DQ1gx1afzHxXDAYofCHqTPmkLURU/UvcjLWP67F6OhcQrlCs3/TNRavlrAk+QpEBx Vh2IbV4eP9C/hDR+4BBJHzxVwU3fZtxjp2mYXNDjJDUKQb3L0dir9Cd2V42vBlx6o5n/ KOt+pg1a8eY/bk9X5ba6RRA6jt32q08YtKRZninZBa81fpFyMICJOd75dLamK4lvQkAt tpooBOK87ek9PBTj5z2NYxiTEirRNlE4EgWdE3i19CIGAMlWg91QjQboI1Mj9+gNIZXG 9+aYsx78knUbtsrimi4jZ6D0njxQjCufeYbxHvY82NOo37yM6wug2DCDDUVTVRx5pmZX fB+A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lb17-20020a17090b4a5100b001dc7161ffcesi7825805pjb.96.2022.05.18.03.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 03:12:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE16C4D615; Wed, 18 May 2022 02:51:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234675AbiERJvj (ORCPT + 99 others); Wed, 18 May 2022 05:51:39 -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 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 */