Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp978492rda; Sun, 22 Oct 2023 20:09:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdR4hOYJ0JrraeuZ/bjgTZxr4pzoGONYdKxy03GDcvvRx+q8nytF852hR4pAIimSMDZ+zn X-Received: by 2002:a05:6830:719c:b0:6c6:3926:8055 with SMTP id el28-20020a056830719c00b006c639268055mr10542710otb.6.1698030549170; Sun, 22 Oct 2023 20:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698030549; cv=none; d=google.com; s=arc-20160816; b=0JulSMZBAUytVXZPxZReCBbBq/86DM/gLJ1N2l5YO5X8vSL030feoj7sNZnJ5q5/dZ 4n4BLxp4XjGTy7zx4myY34J1ZhbbB3I5skNFWtiKqdmSltPHkzXUI0sZH5ii2hFuzmvO k07FI0ZBiSm8eJwNOL/rOhLJNgd3F3SMkH7vQSI4UG+8oE/yghfuZ0MZR9TrUmoXbOON Q+Qi9lo7gPSQZq5igEu/wr6pK6t7RLqQ1+ae0Azzmm4GUmQCNo3SRA8Xn6FQunw/HDUq bPvtsSAoXkSDf+3ZC1zJIp5jvJBXvjONTpqUkViLKH1BjBEBBDTCspjFlnaBkM7z3SFT /Rjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZQ1NjhPsU7dNA1sK9qG3FSyb5+AVMYaFXUWI4kNaVBc=; fh=7Q1zA1easzsurnDULhsHBjNBSNp3vIf28hkFgmjcwo0=; b=qGN8W6NWS9LJCA8NgRqNe7+aN2J1FQr6dV2PjU+5r5i8diu6wKeGd7Zupu8C1bbWQG RN5DZxWMRUi4dfnkT6XxFyqTp7EdUkB5dJ+pw36etsOwoAL47IfsyjqULctRBK/UhhaR cGxm9pj1CUdY1TZQBiF+6+1b2nHe4nNV0mxretGQEFf081KeZz6Fzk6lI/40lESQ1UIZ fkawLlHbc4C/kgp8ZO2V4mOlYlhfWcmNA+oazRRcwsQnO86xH0FGOodqlHmZiJ5ji87q HG6btEOh480DTBhSp6RPqCBAekYwoUgK9pxZ/K+egvP7rRh/Sh+UMhYaM8pZhfmkqpTn +mjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="Png/+S8R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id q22-20020a656a96000000b005afc5ea43fdsi5380806pgu.849.2023.10.22.20.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 20:09:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="Png/+S8R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 34768807C77E; Sun, 22 Oct 2023 20:07:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233218AbjJWDHB (ORCPT + 99 others); Sun, 22 Oct 2023 23:07:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjJWDG6 (ORCPT ); Sun, 22 Oct 2023 23:06:58 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12FF4188; Sun, 22 Oct 2023 20:06:51 -0700 (PDT) X-UUID: 340da5de715111ee8051498923ad61e6-20231023 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ZQ1NjhPsU7dNA1sK9qG3FSyb5+AVMYaFXUWI4kNaVBc=; b=Png/+S8RNljW/HDm+6iLast0xh4Ntny3K2N7qpi8PshbBgoA3tbjQaM3Dl4K3ejis961nCcKAztleO5AsbEqseGjavowS/pSij1vT1SieCo2rbds78zb8YX2N9+3l5zXTXYqAaRCffJacWjm4wlDoUwTt+M7NifBuLzTXsk22jY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:78fda730-fc0d-44d5-b1b5-0a56ae1127c0,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:5f78ec9,CLOUDID:6395067d-ccd9-4df5-91ce-9df5fea3ae01,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 340da5de715111ee8051498923ad61e6-20231023 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 624181583; Mon, 23 Oct 2023 11:06:47 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 23 Oct 2023 11:06:46 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 23 Oct 2023 11:06:45 +0800 From: Yunfei Dong To: Sebastian Fricke , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert CC: Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , "Steve Cho" , Yunfei Dong , , , , , , Subject: [PATCH v2,4/7] media: mediatek: vcodec: Set the supported h264 profile for each platform Date: Mon, 23 Oct 2023 11:06:37 +0800 Message-ID: <20231023030640.16393-5-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231023030640.16393-1-yunfei.dong@mediatek.com> References: <20231023030640.16393-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--3.972300-8.000000 X-TMASE-MatchedRID: ZA2hMjGumYJVFKZEeIVgtWNW0DAjL5p+l7aD0tm/2DXfUZT83lbkEN6M yUV+2+DZbTGz+QnmOR/a/g/NGTW3MuF/B1jEjV+6LOHZFLbgrPxT4DtiSkMnWLw2tvOM+/MndoQ vACo0J3qQNsi/UkztHoAy6p60ZV62G2i4y8P2xXndB/CxWTRRuwihQpoXbuXFIs7NDKhLjV0BCy n5H5eEedb0p/kS7YOUCPk+pX9b1zs83mBmdU6tgrS1puMaJrEPKWiuJAW3Ma9C12VA/HPlLo0Le 9ayv60qaaeeX2Q5bK9+HGPweyal2mGdUezV59DHQZpgl3CshRSeqD9WtJkSIw== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.972300-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 5E5A17C03F313A23E9B9C59E5D5232F1E98FCC0DF81C46472A39CDDDC52C3B762000:8 X-MTK: N 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,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Sun, 22 Oct 2023 20:07:21 -0700 (PDT) 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. Signed-off-by: Yunfei Dong Reviewed-by: Sebastian Fricke --- .../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 f68518ba57c5..a93098b3a390 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) { @@ -587,6 +601,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