Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp554234rwb; Mon, 26 Sep 2022 02:46:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4cQ7twF/q8yGFkWUGxcqAOXqJaHmWAVBPn1P2rNcEXARg6UlC1NStXz316UN2dNu0SvFTq X-Received: by 2002:aa7:8d05:0:b0:557:f0c1:6413 with SMTP id j5-20020aa78d05000000b00557f0c16413mr7755383pfe.19.1664185573254; Mon, 26 Sep 2022 02:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664185573; cv=none; d=google.com; s=arc-20160816; b=TAKnpj3dqcTOm/h8kyWN80UuW67zw9TEPJlnE/CIc7L/xm/Z6eXzGWKB+tCOZVth6u DkS/J/gdKRFoYAg9MCOYn4nGuQZXcbJUhpYv0DTAUbJu27jKoa/hLhhOWE1CGipQF+eE Bm8iz41XoLM6cpOY45JKVz4Hc2fTYnGah9gEsvozlAaCV/mckwBmOqH7VUyJpb7O4+V3 zwEQ8Xfqkeo6CcAqyfQwtbQeeHxIzLYB/PHW+9GZ4kHi0nfbxuBElReHFO5ISrWkXIJP EFoXHfWuimFGVrnkm6R2bleGqZ79AwDZm3qHjnMBsIhEEYxgXMgC4VVbx/X4vRA9oTG+ 0oug== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=H+SYdkbHp/cDLX4mENwizZnmtVaNtoheJG/XM3EMbdA=; b=YeCsp2P3jRz0dvkH6+C41loIcLp98J15GD43o5WSLV+R4QazEn5yjI1+iV7eEmLyRI yTrt0echr/lnbBbb3fOukj7m9cd140sO5NAblViGUrshP4Gv7nNS98pIyruXVIeCi1BQ ZusBae2emdM1DOObh+Y3E98Q5AJhW2OFFmaYDBGMDOCR1fy+/7Ko7XDvlITCTi09C23v LO+IZqoqvohE+qWZIgFV+mH+u7PPevlvKq4wAAxjGa2RwYtMDT9jhnKdAOFn6AvJgUCV sll0SbevM+5vCi8+iRNWCKnI8p1q9oVbTcq1yYHYOyIwwKZ5wdTtkB0p48dVgASN4YDM kF9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=MOoMGwle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090a9a8800b002031257f74asi9747687pjp.92.2022.09.26.02.45.59; Mon, 26 Sep 2022 02:46:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=MOoMGwle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbiIZJfV (ORCPT + 99 others); Mon, 26 Sep 2022 05:35:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234112AbiIZJfT (ORCPT ); Mon, 26 Sep 2022 05:35:19 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C7AC165A7; Mon, 26 Sep 2022 02:35:11 -0700 (PDT) X-UUID: 052695737cbd4371aa3e9cb94c2c7ed1-20220926 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:Message-ID:Date:Subject:CC:To:From; bh=H+SYdkbHp/cDLX4mENwizZnmtVaNtoheJG/XM3EMbdA=; b=MOoMGwleQLlgYV4UGVrO8NZaZbcRQOamSRomDJeKJOvN6kqZccP/f6/ZAyNwwjDkvVrcnjqaWBEpoYEAtgcXYKoCkrr1hIz281LVfEGXGadaxAJuetrdtQZPcaqjXkMn3dIN/g+oVAVhp8jes65kd7/JWTQ2r8uFaDTkfpnUHsw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:72ed0038-030a-4d2a-8755-5903b5bcad91,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:39a5ff1,CLOUDID:eba60807-1cee-4c38-b21b-a45f9682fdc0,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 052695737cbd4371aa3e9cb94c2c7ed1-20220926 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 975954962; Mon, 26 Sep 2022 17:35:06 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Mon, 26 Sep 2022 17:35:04 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 26 Sep 2022 17:35:03 +0800 From: Irui Wang To: Hans Verkuil , Alexandre Courbot , Tiffany Lin , "Mauro Carvalho Chehab" , Rob Herring , Matthias Brugger , Hsin-Yi Wang , , CC: Maoguang Meng , Longfei Wang , Yunfei Dong , "Irui Wang" , , , , , , Subject: [PATCH] media: mediatek: vcodec: Skip unsupported h264 encoder profile Date: Mon, 26 Sep 2022 17:35:01 +0800 Message-ID: <20220926093501.26466-1-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_SPF_TEMPERROR, UNPARSEABLE_RELAY,URIBL_CSS 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 The encoder driver support h264 baseline, main, high encoder profile, set mask for V4L2_CID_MPEG_VIDEO_H264_PROFILE to skip the unsupported profile. get supported h264_profile by command: v4l2-ctl -d /dev/videoX -L h264_profile 0x00990a6b (menu) : min=0 max=4 default=4 value=4 0: Baseline 2: Main 4: High Signed-off-by: Irui Wang --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c index d810a78dde51..d65800a3b89d 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c @@ -1397,7 +1397,10 @@ int mtk_vcodec_enc_ctrls_setup(struct mtk_vcodec_ctx *ctx) 0, V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE); v4l2_ctrl_new_std_menu(handler, ops, V4L2_CID_MPEG_VIDEO_H264_PROFILE, V4L2_MPEG_VIDEO_H264_PROFILE_HIGH, - 0, V4L2_MPEG_VIDEO_H264_PROFILE_HIGH); + ~((1 << V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) | + (1 << V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) | + (1 << V4L2_MPEG_VIDEO_H264_PROFILE_HIGH)), + V4L2_MPEG_VIDEO_H264_PROFILE_HIGH); v4l2_ctrl_new_std_menu(handler, ops, V4L2_CID_MPEG_VIDEO_H264_LEVEL, h264_max_level, 0, V4L2_MPEG_VIDEO_H264_LEVEL_4_0); -- 2.18.0