Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2319184rdg; Sun, 15 Oct 2023 23:44:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBpcnt0KmIIu7DeOPHszRZHImPZ3TRHhoQuiti/+PwHiGtnLEAh2y3q6W9eXOa00SmlqBU X-Received: by 2002:a05:6808:2382:b0:3ad:f866:39bd with SMTP id bp2-20020a056808238200b003adf86639bdmr38260100oib.27.1697438696388; Sun, 15 Oct 2023 23:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697438696; cv=none; d=google.com; s=arc-20160816; b=FN1AYTm9Zy++UcJs4S+q8vApGN32DURU+yv9MXH5ptLB6YOggSRvVTh/DREIvUWQgN MCOWMLQaJVx74JhD9J6ccvTEYRU+0FZaQAv98aJfVlFdL3dG1lVqxarjLDVgIYj+ausF NZlOAGzrXuAW0Z4kCwEDOAJ3OW2qIu/ZH5JqLVd/v5piMOSvPcGAF+rBA/d0Ub8OrbSJ h+xBN2TzwwM5rxwRk/KL5xTMizCWUs4L8L+qebilu1eK7c3BjpDQf3WS8SZCPgEwYFjK 5UlGik9HlD7vn/94uhteuITrbJ8kUv+scPv2V1qENvpAHxumbRSk96XzCekfecOap1VE RgAg== 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=XXnEJawfMwVUWYvNaTATy0A/cpFKd1ImYAIi5ObQDnU=; fh=gRHMJ9i2cT7FUd4yIBh7QA9M5QBw4coTmo3XsCe+R+8=; b=ddvpB88z+4O7w1zatPWvHZ47UDkoqNJ+67s0CHVaYzlM9PFzsSJlbN4D0Rs7C5YFDC g5W9q11N3Bqw22fm9wlUY/i0FywMJxo+5QaFkUqiiHa0EFhFqAxLIV6KBXCNXaYy5i5Z /uV9yd9NvQVgo8G071/iVa//qWVIcbQoqrdL3HjrLdqB8JnqhEUE0TMbJEJ/tGAqtG0u NY1D4vWLLmb3zXMW4Grk9ToHRrUqztpEcyN+IvCXhBrU5Y0Yq2b7rUpXdZNQT5Yf1E7Q 2Cstj2aXFlSUoULLof+PNNa8SJqorzqV5LlOEVNggZMau2Yyi2QEhGSdsTkbeRH5w0xE bGOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=eIR3fklT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ca40-20020a056a0206a800b00589b872029dsi6777183pgb.30.2023.10.15.23.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 23:44:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=eIR3fklT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 226508059063; Sun, 15 Oct 2023 23:44:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbjJPGoE (ORCPT + 99 others); Mon, 16 Oct 2023 02:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbjJPGoD (ORCPT ); Mon, 16 Oct 2023 02:44:03 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6901997; Sun, 15 Oct 2023 23:43:57 -0700 (PDT) X-UUID: 5e9f99fe6bef11eea33bb35ae8d461a2-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=XXnEJawfMwVUWYvNaTATy0A/cpFKd1ImYAIi5ObQDnU=; b=eIR3fklThs+l+haxiaVHZz1E5ED6+51akjp6rzUYxzaaYfVHysofS8ot6+XU8PYsVKds/0Xhmhh/Efq1BCyD8qhoEN2j6Dox3/HQHK7GSNIfDVhSLr9R8692Eax63/7kwYUdQeKLq4x22mzgmwiSm8oWt9qWpxqCh6y3XxX6vIc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:4985995b-9dbf-4062-9052-62031bf620c8,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:7036d6f0-9a6e-4c39-b73e-f2bc08ca3dc5,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: 5e9f99fe6bef11eea33bb35ae8d461a2-20231016 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1165145270; Mon, 16 Oct 2023 14:43:52 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) 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:51 +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:50 +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 4/7] media: mediatek: vcodec: Setting the supported h264 profile for each platform Date: Mon, 16 Oct 2023 14:43:43 +0800 Message-ID: <20231016064346.31451-4-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.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 pete.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 (pete.vger.email [0.0.0.0]); Sun, 15 Oct 2023 23:44:45 -0700 (PDT) The supported format type of different platforms are not the same. Need to set the supported profile according to the chip name. 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