From patchwork Mon Oct 16 06:43:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WXVuZmVpIERvbmcgKOiRo+S6kemjnik=?= X-Patchwork-Id: 153225 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3275165vqb; Sun, 15 Oct 2023 23:44:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyGo05wmJswndGg9tFty4e3HuxYhW6a5q8S9qTyU8OsC1KWyVQLJ6ugFtti5gIb5zgxpXt X-Received: by 2002:a17:902:fac6:b0:1ca:549c:cd72 with SMTP id ld6-20020a170902fac600b001ca549ccd72mr3975883plb.6.1697438661519; Sun, 15 Oct 2023 23:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697438661; cv=none; d=google.com; s=arc-20160816; b=Mc7uSJ8nVYij7hJ9bsZyHNa1izw4E8pqLsmyTFCy3t7t7/tFmx/3S7+ygaQoy8BDe4 tupwjdtohQayHrMbTYeLjY9HM7GENah5CSrZRQH9r70vqmiFFPvcVP6caiqyxYSs/Mm2 wl6+TG7+Jer40e2hmEaoOKbysmu/gxzZXUUyd1h2dn/isSa1BWhDBW7+RM3Mgg3tb8hI EMvizL9AQC8NylfUMasxSqmwq61tsoO2HMbJFC4u3txMOmlxvxOBQS+4Op9yas37nAEU rIKK9WRFzj3HB/hr6ozqBwV1+dRWnEaGvMV9N9tU4FAm21l4Tdl7KC4cSmm++5UHx2Yf E7zQ== 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=6EoJTFPk3OcDoDfa0roCH0fjLEhDHS1CyVUa75lVhus=; fh=gRHMJ9i2cT7FUd4yIBh7QA9M5QBw4coTmo3XsCe+R+8=; b=mSBbK7Iicfk+7TjQiMohw5038DzaQTrKnZZl3hftw2ZM5tdxQqDPuF8UvIE51/M+Ef nB6LXjelI3z1P8czxn3SsKvFAqGdG3qjUQVRzVTFYUbTvdviO7oimiMFiiA4wm35fGBW dZ/zKulaoestq4CQfXuVnv9k5IOmNAESQveEDdnfF1Y341Cp853/Hq1Um9uDSYBUz2Tv gyFbqKsHc/wtksZ+Oy0HoVDt1XwBBOTOqRbzbnaL53GyOsvysqGcOIH6c9FYZfgNPtqb JzrGW1bQxwfddHJF/pl3gFj1983L4/3Kk48dmEtvNom4pAMqdrGi8K+kJBdiawFYS5yP 60Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=TMimnu2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id v7-20020a170902b7c700b001c4062a0e43si9445446plz.169.2023.10.15.23.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 23:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=TMimnu2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 6C74780C1610; Sun, 15 Oct 2023 23:44:16 -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 S231738AbjJPGoG (ORCPT + 18 others); Mon, 16 Oct 2023 02:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjJPGoD (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 82CEC8E; Sun, 15 Oct 2023 23:43:56 -0700 (PDT) X-UUID: 5ea156d66bef11eea33bb35ae8d461a2-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=6EoJTFPk3OcDoDfa0roCH0fjLEhDHS1CyVUa75lVhus=; b=TMimnu2uLWaUPG/oQG92iDG0NXg/BS6KYVoslKk19DBrv5Q4aKaX36V5wqrGaAXAUmDLk+1sxtRyfaWPYOVQdVxGA1350Ji5IBY1B7m51xHzktOJG7XgaB4omAnY9izo0ol0fJCylsBFGmvczJDZjLnw3ruQ11s63KBInHWuTCA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:1030e1ba-c34c-481b-be99-425256d3a29e,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:6f36d6f0-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: 5ea156d66bef11eea33bb35ae8d461a2-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 110624402; 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:52 +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:51 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , 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 5/7] media: mediatek: vcodec: Setting the supported h265 profile for each platform Date: Mon, 16 Oct 2023 14:43:44 +0800 Message-ID: <20231016064346.31451-5-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 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, 15 Oct 2023 23:44:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779893442021851190 X-GMAIL-MSGID: 1779893442021851190 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 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 84c0bed577ed..b15ed773374f 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 @@ -587,6 +587,20 @@ static void mtk_vcodec_dec_fill_h265_level(struct v4l2_ctrl_config *cfg, }; } +static void mtk_vcodec_dec_fill_h265_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_HEVC_PROFILE_MAIN_10; + break; + default: + cfg->max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE; + break; + }; +} + static void mtk_vcodec_dec_reset_controls(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { @@ -604,6 +618,11 @@ static void mtk_vcodec_dec_reset_controls(struct v4l2_ctrl_config *cfg, mtk_v4l2_vdec_dbg(3, ctx, "h264 supported profile: %lld %lld", cfg->max, cfg->menu_skip_mask); break; + case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE: + mtk_vcodec_dec_fill_h265_profile(cfg, ctx); + mtk_v4l2_vdec_dbg(3, ctx, "h265 supported profile: %lld %lld", cfg->max, + cfg->menu_skip_mask); + break; default: break; };