From patchwork Mon Oct 23 03:06:38 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: 156649 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1048140vqx; Sun, 22 Oct 2023 20:08:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJY+YRDKE2SkAiOuk4+o66zHcbJ3130KhXHV7RomWDNKF3gKoyiCReyjfhX3USRFVJBoc7 X-Received: by 2002:a17:90b:4f46:b0:27d:6dd:fb7e with SMTP id pj6-20020a17090b4f4600b0027d06ddfb7emr5697003pjb.17.1698030519689; Sun, 22 Oct 2023 20:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698030519; cv=none; d=google.com; s=arc-20160816; b=F/cqBtFBy2uePdaEZ6g/kkuacDg29/gOB58epxH1AHNKhSiC5k31iGGZhXw8fWOx97 /h0JYcEJhL7w5aPmErBWq7JDVHUcSoT1TvlrQWO4NZPeVHYvH3SMB+BsegdE97a/QkYu iEhidsEJPYEeqz6y4uUcqM+88EN9WOZKVPhVtTearY36GjmayVI8cMwzRUtFy7sHKgBt eiLPTZTOT0gGSKlww3rtwGcOnyd8rquvh7WIRlmIm0bRBFazSGZ8gOSGnX5TxhWtqpVx 3z+YJJ6CpYnrLdobIJXbwLjYH0DU9Bf06fj1/XRUp8aC5VtIuJe9qGkA8CoxBXtmSPno Z2nQ== 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=1IUxc0c+YfrX4JXNY0hM5aD/EtsHmHvZfjhJ7yPKZYc=; fh=oCgJB/6tNp9Dz/wee7aP7sfCfoY3k5AmVYabluBOivE=; b=Luerw2y9wHhtKtiS13dc/YgWpIMnz87jZHTuzewVdMTTMBWiYPk7Jf+2uM39eAOZSJ JCSqz78ks/DnqfwkXTS/3LWX1uxsS3T4fQGQj57S1o2pAjLbsyUwQkFTaW6VArFfWk46 szOhv3+wmGoNPndto1/4/UU7GiIJK71obYNsNb0WbnQ4uDqctvEaSSZHqkznQ+sMrYuS iBzVxAj20UiKm6J/jv+UVtnSuddwd2m/fOeYYzum5Jp0X46hXJLehxsGtn/IXwNqjJjI KBfwFRwG/VTagzuEaz3SVC68Rau8zBqK6S8FLeHh56y2D9HVNYaRq1CT00NFJLWj6lbp E6SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CGB+wgfN; 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id oj16-20020a17090b4d9000b0027ce5a78453si5872463pjb.29.2023.10.22.20.08.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 20:08:39 -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=CGB+wgfN; 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 1A9B1805ECE0; Sun, 22 Oct 2023 20:07:59 -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 S233308AbjJWDHf (ORCPT + 26 others); Sun, 22 Oct 2023 23:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233209AbjJWDHB (ORCPT ); Sun, 22 Oct 2023 23:07:01 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C9D4D53; Sun, 22 Oct 2023 20:06:55 -0700 (PDT) X-UUID: 3521a632715111eea33bb35ae8d461a2-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=1IUxc0c+YfrX4JXNY0hM5aD/EtsHmHvZfjhJ7yPKZYc=; b=CGB+wgfN1C4+EKoPEdUG/c/lMaO071vICPjKg/c2wlV6MjsseCvnY686WeLgJ/sJG4stbR9cBpaHUEt0pf7Lj1A/RAoKFL2EtihrqbnEW+JHTAExqbGWh51jt6tx/V8LTPavZWDUgIIJUvM6w7yYFgJG+Cj3jyNrvBrz8/1oVYc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:ec95c6c6-3b30-423a-9442-9f29109a30d9,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:8695067d-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: 3521a632715111eea33bb35ae8d461a2-20231023 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 615106489; Mon, 23 Oct 2023 11:06:49 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) 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, 23 Oct 2023 11:06:47 +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:46 +0800 From: Yunfei Dong To: Sebastian Fricke , =?utf-8?q?N=C3=ADcola?= =?utf-8?q?s_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 v2,5/7] media: mediatek: vcodec: Set the supported h265 profile for each platform Date: Mon, 23 Oct 2023 11:06:38 +0800 Message-ID: <20231023030640.16393-6-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 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_SPF_TEMPERROR, UNPARSEABLE_RELAY autolearn=ham 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, 22 Oct 2023 20:07:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780514050051410309 X-GMAIL-MSGID: 1780514050051410309 Set the maximum H265 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 Reviewed-by: AngeloGioacchino Del Regno --- .../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 a93098b3a390..816709fe0f18 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 @@ -589,6 +589,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) { @@ -606,6 +620,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; };