Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp155706rda; Sat, 21 Oct 2023 02:30:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEB8MFSFX/kp/5pUzr21ObTrImvUavWPCl+ghX/mUsymElOG4GMrBDXajWylUyG9LE2i7eh X-Received: by 2002:a17:903:3093:b0:1c3:749f:6a5d with SMTP id u19-20020a170903309300b001c3749f6a5dmr2983861plc.4.1697880639939; Sat, 21 Oct 2023 02:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697880639; cv=none; d=google.com; s=arc-20160816; b=SKuk9ocopVGbakWwOFfa3JKrAZaDlYEsCoP06pRlY2frsuYQSQF764146dyzA00X9u ua54N9WfTYSu7xlTQiH+ooWtNNY1HVqBUZtHWCWXK4XnB0AvMBvDzqowLsgaKKF0LmAu c8Mi5JWaHBcFD7fR9lhswkOYmeFvorf+JmGeVS/BnRWn0Vbzwwk9ZHrCMe2wyX0f2PC5 UkKKiiiGQeHRJOgoLjMIMiY9Qy7oRhwQCqhmA9esUZydA62huqFIxgwhaWt3Lt97x9QH BmenqJzYIoSRR090zCYb+i2z3sZm8JM0lGxPl5/N/HABtIeYHRJySOTXZs9aQYmlQaF/ M8dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6y2gXlRdtzXTaq6v+BA9TkH2R2yiN37qe/KHZmxbbac=; fh=hadP/Qit0fP83aE7jDic8vfKKSMzMzFbjuOmlm+1S4s=; b=FhvqetLh+f3Y1zarUSmYEh1H9AtE6Qtjr/qcSwjnubyecIcEd6uLIBIby8BSYxhy2R IeoC10iJd5hWZ6oSUsjPER8MUgW79yXITOObR0vVhvgHEi54jFvPRGn5oaWVFb7yqeIR iyl/4FM56gH8nJrF2hheEL9lBr2Eg3bgUMT+3MgCxQlYg4wXcM8Teb+6IT+j2i17E5U3 iuSvQKSt5zFW5m7ARXsKJPx2NXB8DNdzN1vxJHMCoj9pHNPRKsjEvKDvLnu8e5eUI330 6Jmdzx5Tu+3h4g/VLtMi0D+7Y5g1TdY7rsFkXeYbEVDuV3vJVLGsN0crhB/aTvtZwhhN ogZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Erh31D8S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y18-20020a17090322d200b001c434b3659bsi3507601plg.354.2023.10.21.02.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 02:30:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Erh31D8S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 40CDA80F4E22; Sat, 21 Oct 2023 02:30:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229472AbjJUJaE (ORCPT + 99 others); Sat, 21 Oct 2023 05:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjJUJaD (ORCPT ); Sat, 21 Oct 2023 05:30:03 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F9E01FD7; Sat, 21 Oct 2023 02:29:10 -0700 (PDT) Received: from localhost (89-26-75-29.dyn.cablelink.at [89.26.75.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sebastianfricke) by madras.collabora.co.uk (Postfix) with ESMTPSA id ABD166607314; Sat, 21 Oct 2023 10:29:08 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697880548; bh=aQtNimE6rMiK4hkbZev8rihShUq7g5Dtf27fF9JILH8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Erh31D8SWBe5fAxVy+TVG8eZhahyevoC9CyPijcL+n8XVxF7E3y2/6PHu4cabcEet GCMwNwNP3GsxxUewiOaP9qjGSxAcWMbq+pBLpqq6XlNsGHwzVJGqrtdxu8nBiJ2boh YtpZ7J+cyc0Rq3sYORA+UrIm8OYPn9GNYdLQrr2n2xO+THygeeBIWf/MtWbvfn46oA Y3Imy0GelxjATRBWZ0yKPqXbQORHpvtILiDhNDNWiPJrP3XmGplWuKfQvuGQx4wzqe cwTK8j5g2bN+RUwlhv2kK98+VzkAg15dDMXLlQc0Mb0dNRob+6laxO28AN62PfM/zY D+/AWprsG83Dg== Date: Sat, 21 Oct 2023 11:29:05 +0200 From: Sebastian Fricke To: Yunfei Dong Cc: =?utf-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4=?= Prado , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com Subject: Re: [PATCH 4/7] media: mediatek: vcodec: Setting the supported h264 profile for each platform Message-ID: <20231021092905.3uxfwckgn5ndon6x@basti-XPS-13-9310> References: <20231016064346.31451-1-yunfei.dong@mediatek.com> <20231016064346.31451-4-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20231016064346.31451-4-yunfei.dong@mediatek.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 02:30:35 -0700 (PDT) Hey Yunfei, On 16.10.2023 14:43, Yunfei Dong wrote: >The supported format type of different platforms are not the >same. Need to set the supported profile according to the chip name. I would suggest the following rewording: Set the maximum H264 codec profile for each platform. The various mediatek platforms support different profiles for decoding, the profile of the codec limits the capabilities for decoding. With that you can add: Reviewed-by: Sebastian Fricke Regards, Sebastian > >Signed-off-by: Yunfei Dong >--- > .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c >index 1fdb21dbacb8..84c0bed577ed 100644 >--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c >+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c >@@ -559,6 +559,20 @@ static void mtk_vcodec_dec_fill_h264_level(struct v4l2_ctrl_config *cfg, > }; > } > >+static void mtk_vcodec_dec_fill_h264_profile(struct v4l2_ctrl_config *cfg, >+ struct mtk_vcodec_dec_ctx *ctx) >+{ >+ switch (ctx->dev->chip_name) { >+ case MTK_VDEC_MT8188: >+ case MTK_VDEC_MT8195: >+ cfg->max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10; >+ break; >+ default: >+ cfg->max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH; >+ break; >+ }; >+} >+ > static void mtk_vcodec_dec_fill_h265_level(struct v4l2_ctrl_config *cfg, > struct mtk_vcodec_dec_ctx *ctx) > { >@@ -585,6 +599,11 @@ static void mtk_vcodec_dec_reset_controls(struct v4l2_ctrl_config *cfg, > mtk_vcodec_dec_fill_h265_level(cfg, ctx); > mtk_v4l2_vdec_dbg(3, ctx, "h265 supported level: %lld %lld", cfg->max, cfg->def); > break; >+ case V4L2_CID_MPEG_VIDEO_H264_PROFILE: >+ mtk_vcodec_dec_fill_h264_profile(cfg, ctx); >+ mtk_v4l2_vdec_dbg(3, ctx, "h264 supported profile: %lld %lld", cfg->max, >+ cfg->menu_skip_mask); >+ break; > default: > break; > }; >-- >2.18.0 >