Message ID | 20230318035651.27454-1-yunfei.dong@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp117980wrt; Fri, 17 Mar 2023 21:04:38 -0700 (PDT) X-Google-Smtp-Source: AK7set/yY01A3hfKbZNlCGEcTg/QZlsbCga5OtxFNMEz8R1Jc4uAvB6krgwo2ITqYdT7KWsHYbDQ X-Received: by 2002:a05:6a20:3d89:b0:cc:fced:f740 with SMTP id s9-20020a056a203d8900b000ccfcedf740mr11858822pzi.0.1679112278467; Fri, 17 Mar 2023 21:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679112278; cv=none; d=google.com; s=arc-20160816; b=Q6K+cPitAOfKWCk7l4JLYX3ZiMQ6oUGzJgqAHZNmjtdqHAywIjGP98lcRgY7FhqyiX qwFPAqQibyN+/pgQIxgLOB+afLO6/wpUQiXcd45lj3wPdMQTHEkmnBp3GQ7hJl1vv9b4 Px9Y5KDYXjavNPxgRGMCf1vFgt5cMOosz+2MBYIZsBc9JfoQnEU+ckcaILvGSyohqPgN G6/XT1oVCcK4psaho3tSDf3+rxD81GHyHEz3CSjvdrdFDN8zOgrJXGEoW6MdR9X4CNx/ ZhObouJcAuHIl7euQSIiN3D5Jd2fpOQpOWhk+vQ/fI4aLEJr27k1SWujp+Q37g44ppts EwRg== 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=w7qxzHJ9OUqVOD3dN5cCe1joMzyhA01hfu1aWr/0RaU=; b=E+llmJsJCmkJwt21UqY/OrtASik5dcqAymd+UkdU1e4fkmkM/dzNhhFAE4j5APfTLw MMagKToxejlp63P2eY8Di0B9Gd5uI3ziOsW6PqWILyiAcWRtxiT7XaKO0cL68LYtgPos 4wymuJSeaJyBOWs1JqNwJhwhVIQR32E9rA5Q08F9iiaIOr2Uo4UOrOOff3wjdD/9GdC3 tqIla+HDl2SglX2Tbiy+0pmxbw329waxWtPI9ts7DexInnazq2L9pI1qXkJaeCQAn0Ku Y7rSw7XjROrKqAwVO46rbOjpwJx2OTVSGKr85LcsoZbrHKZkqdeP+sUj9HV1hMlKVNfX 4NfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rXMaKEqB; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020aa79f83000000b005a8a56ac57esi4022437pfr.246.2023.03.17.21.04.26; Fri, 17 Mar 2023 21:04:38 -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=rXMaKEqB; 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 S229943AbjCRD5J (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Fri, 17 Mar 2023 23:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjCRD5G (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 17 Mar 2023 23:57:06 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95CAD8ABFF; Fri, 17 Mar 2023 20:57:04 -0700 (PDT) X-UUID: eccf5aeec54011edbd2e61cc88cc8f98-20230318 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=w7qxzHJ9OUqVOD3dN5cCe1joMzyhA01hfu1aWr/0RaU=; b=rXMaKEqBmJKsDZANeYJEHu4SiT1TqZjm4BGfZiTh1lsSkhioqRQiQtcmPTR5pAsAuQzHSnH0dX+flL1/3oiNGiH4NiKAuK/HKoUEuaxWUSP0WMpKE3RXSKy7nCJN0DNmbZIYguf+enWaH8JQ2+I3xHn2U5lnFcXPKm0C+1G3OxI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.21,REQID:81598128-9a66-467a-bdc4-73c1944b7de8,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:83295aa,CLOUDID:f35d9cb3-beed-4dfc-bd9c-e1b22fa6ccc4,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 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: eccf5aeec54011edbd2e61cc88cc8f98-20230318 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from <yunfei.dong@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2130231030; Sat, 18 Mar 2023 11:56:55 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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.1118.25; Sat, 18 Mar 2023 11:56:54 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Sat, 18 Mar 2023 11:56:53 +0800 From: Yunfei Dong <yunfei.dong@mediatek.com> To: Yunfei Dong <yunfei.dong@mediatek.com>, Chen-Yu Tsai <wenst@chromium.org>, Nicolas Dufresne <nicolas@ndufresne.ca>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Benjamin Gaignard <benjamin.gaignard@collabora.com>, =?utf-8?q?N=C3=ADcolas?= =?utf-8?q?_F_=2E_R_=2E_A_=2E_Prado?= <nfraprado@collabora.com> CC: Matthias Brugger <matthias.bgg@gmail.com>, Hsin-Yi Wang <hsinyi@chromium.org>, Fritz Koenig <frkoenig@chromium.org>, Daniel Vetter <daniel@ffwll.ch>, Steve Cho <stevecho@chromium.org>, <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com> Subject: [PATCH v5,1/2] media: mediatek: vcodec: Make MM21 the default capture format Date: Sat, 18 Mar 2023 11:56:50 +0800 Message-ID: <20230318035651.27454-1-yunfei.dong@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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760676836278120771?= X-GMAIL-MSGID: =?utf-8?q?1760676836278120771?= |
Series |
[v5,1/2] media: mediatek: vcodec: Make MM21 the default capture format
|
|
Commit Message
Yunfei Dong (董云飞)
March 18, 2023, 3:56 a.m. UTC
Given that only the MM21 capture format is supported by userspace tools (like gstreamer and libyuv), make it the default capture format. This allows us to force the MM21 format even when a MM21 and MT21C capable firmware is available (which is needed while dynamic format switching isn't implemented in the driver), without causing the following regressions on v4l2-compliance: fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT test VIDIOC_G_FMT: FAIL fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT test VIDIOC_TRY_FMT: FAIL fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT test VIDIOC_S_FMT: FAIL Fixes: 7501edef6b1f ("media: mediatek: vcodec: Different codec using different capture format") Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-by: Nicolas F. R. A. Prado <nfraprado@collabora.com> Tested-by: Nicolas F. R. A. Prado <nfraprado@collabora.com> --- changed with v4: - change the patch order. - re-write the title and commit message for patch 1. --- .../platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Comments
Il 18/03/23 04:56, Yunfei Dong ha scritto: > Given that only the MM21 capture format is supported by userspace tools (like > gstreamer and libyuv), make it the default capture format. > > This allows us to force the MM21 format even when a MM21 and MT21C capable > firmware is available (which is needed while dynamic format switching isn't > implemented in the driver), without causing the following regressions on > v4l2-compliance: > > fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT > test VIDIOC_G_FMT: FAIL > fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT > test VIDIOC_TRY_FMT: FAIL > fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT > test VIDIOC_S_FMT: FAIL > > Fixes: 7501edef6b1f ("media: mediatek: vcodec: Different codec using different capture format") > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> > Reviewed-by: Nicolas F. R. A. Prado <nfraprado@collabora.com> > Tested-by: Nicolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c index 04beb3f08eea..3000db975e5f 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c @@ -392,14 +392,14 @@ static void mtk_vcodec_get_supported_formats(struct mtk_vcodec_ctx *ctx) if (num_formats) return; - if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_MM21) { - mtk_vcodec_add_formats(V4L2_PIX_FMT_MM21, ctx); - cap_format_count++; - } if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_MT21C) { mtk_vcodec_add_formats(V4L2_PIX_FMT_MT21C, ctx); cap_format_count++; } + if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_MM21) { + mtk_vcodec_add_formats(V4L2_PIX_FMT_MM21, ctx); + cap_format_count++; + } if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_H264_SLICE) { mtk_vcodec_add_formats(V4L2_PIX_FMT_H264_SLICE, ctx); out_format_count++;