Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2319057rdg; Sun, 15 Oct 2023 23:44:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9VLtyJFVvKckB3oeR0AWVTQO7edBU899PxGjYlYobBw2JTbjVCEhYql28w5zizzm0JVMz X-Received: by 2002:a05:6a00:acb:b0:68e:3bc8:17d1 with SMTP id c11-20020a056a000acb00b0068e3bc817d1mr30424417pfl.29.1697438668493; Sun, 15 Oct 2023 23:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697438668; cv=none; d=google.com; s=arc-20160816; b=gFDUZaDUo9lG7jdWPOxioGR8e4khrouJnKR31L8fN+qD2S0O3UnLTU7GWA3AjI+YVF j1jKbhKhlZl9UHQWYxpebfUi7OXS8jirIyfghwo0/hrimSfa1t5am0LhuP58X8HB9+yd FvEdA4392Bpg8JzTBNR6bQkVDL9TIpYipZsDMBqQFFNaJsLglnlW6LLDiHobWMAbgOtV UpE3Gr4hXqlgx9q2WQdOIpK1pj2Nb8o4eOzj73nxj8xuITRD5uLsmLkggRM/eTmjkL/r 1PxFC/7N/qygYWkionMomoRIXbf16IPj5D+3uqjSaCj3CgWToemqTJ2xCVXuyyQxo6G1 arvw== 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=s43GiVflyZ0zUgGP1LD/Snp+bolRWnC8QJNjMV51hPY=; fh=gRHMJ9i2cT7FUd4yIBh7QA9M5QBw4coTmo3XsCe+R+8=; b=nlaYZxFx7Qbc+tgHgpFVduexE/oN02zAUCsnPo/oxh0LIsApGKxHb+KMuErXWBhpHG I4VgQqU86NZD0S+F6XlR8cyMrLptTqkQeUeVMCuVliySKsWBuJ5YV/IjRoXmdw3Ovl8I LSJ1FyEFx7gXtYB8GhKoz1l2Ge/QKa9Ufle/IVzZbxNp+MP91UjLSpO2pUSGU/gHClH4 aZtPr/mZAdBy6chFzsGOk5yQr5I87nbI2ptai8o4J0tv3mf5CFP2caSj54bkq2Wol/HQ 9i7YFxXtT7onS0bv3Q0ZDtf17XWfE11ShBaGHcRLDjd+otKDc3gYuaV1avHwwa+G2yPp W2rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=fI68lx52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d19-20020a056a00199300b006be322191dasi946918pfl.140.2023.10.15.23.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 23:44:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=fI68lx52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 62A9980B1D3B; Sun, 15 Oct 2023 23:44:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbjJPGoU (ORCPT + 99 others); Mon, 16 Oct 2023 02:44:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbjJPGoH (ORCPT ); Mon, 16 Oct 2023 02:44:07 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21275DC; Sun, 15 Oct 2023 23:44:00 -0700 (PDT) X-UUID: 5dec1e746bef11ee8051498923ad61e6-20231016 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=s43GiVflyZ0zUgGP1LD/Snp+bolRWnC8QJNjMV51hPY=; b=fI68lx52+grAvsC0kG6w7hVGbg6sbmp0b/t1zsW8jhjx1W93xAfsvEi0rg01GB1+SPaS57UblJ0Ll+VrasfUkWt7yQ1Gj5fUUYQucxe14Rp3gE9UtSHqst0Uk5Af94IusgW3tGQF1c8grvq1r9p7eVpmoyZw6JMuovMretmk1fk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:70fa640e-50b4-4aa8-986f-3ce46a8121f2,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:b3121415-4929-4845-9571-38c601e9c3c9,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 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 5dec1e746bef11ee8051498923ad61e6-20231016 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1343892729; Mon, 16 Oct 2023 14:43:51 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 16 Oct 2023 14:43:50 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 16 Oct 2023 14:43:49 +0800 From: Yunfei Dong To: =?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 3/7] media: mediatek: vcodec: Setting the supported h265 level for each platform Date: Mon, 16 Oct 2023 14:43:42 +0800 Message-ID: <20231016064346.31451-3-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231016064346.31451-1-yunfei.dong@mediatek.com> References: <20231016064346.31451-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-0.3 required=5.0 tests=APP_DEVELOPMENT_NORDNS, BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,SPF_HELO_PASS,T_SPF_TEMPERROR, UNPARSEABLE_RELAY autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 15 Oct 2023 23:44:27 -0700 (PDT) The supported resolution and fps of different platforms are not the same. Need to set the supported level according to the chip name. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 28 +++++++++++++++++++ 1 file changed, 28 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 f4af81bddc58..1fdb21dbacb8 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 @@ -147,6 +147,16 @@ static const struct mtk_stateless_control mtk_stateless_controls[] = { }, .codec_type = V4L2_PIX_FMT_HEVC_SLICE, }, + { + .cfg = { + .id = V4L2_CID_MPEG_VIDEO_HEVC_LEVEL, + .min = V4L2_MPEG_VIDEO_HEVC_LEVEL_1, + .def = V4L2_MPEG_VIDEO_HEVC_LEVEL_4, + .max = V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1, + }, + .codec_type = V4L2_PIX_FMT_HEVC_SLICE, + }, + { .cfg = { .id = V4L2_CID_STATELESS_HEVC_DECODE_MODE, @@ -549,6 +559,20 @@ static void mtk_vcodec_dec_fill_h264_level(struct v4l2_ctrl_config *cfg, }; } +static void mtk_vcodec_dec_fill_h265_level(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_HEVC_LEVEL_5_1; + break; + default: + cfg->max = V4L2_MPEG_VIDEO_HEVC_LEVEL_4; + break; + }; +} + static void mtk_vcodec_dec_reset_controls(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { @@ -557,6 +581,10 @@ static void mtk_vcodec_dec_reset_controls(struct v4l2_ctrl_config *cfg, mtk_vcodec_dec_fill_h264_level(cfg, ctx); mtk_v4l2_vdec_dbg(3, ctx, "h264 supported level: %lld %lld", cfg->max, cfg->def); break; + case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL: + mtk_vcodec_dec_fill_h265_level(cfg, ctx); + mtk_v4l2_vdec_dbg(3, ctx, "h265 supported level: %lld %lld", cfg->max, cfg->def); + break; default: break; }; -- 2.18.0