Message ID | 20230317030833.16836-2-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 j10csp121112wrt; Thu, 16 Mar 2023 20:21:25 -0700 (PDT) X-Google-Smtp-Source: AK7set9KEwNA5XK0IRKlVCISfC4Umy3aiARskF70YCb69f/mQGIUxv0FMmMi4+ZErH9jthmIrV2o X-Received: by 2002:a17:902:c40c:b0:19a:a815:2868 with SMTP id k12-20020a170902c40c00b0019aa8152868mr6603466plk.44.1679023285281; Thu, 16 Mar 2023 20:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679023285; cv=none; d=google.com; s=arc-20160816; b=P24tgSwoUzrGAdaaS15N8Dx7C6Ym4da8l/HM3kcdQHq5YS0NIO/bk7ezlaXku/OXQ9 ADMCCA55Raz7ptRch2R0gLSyA+bDHLRsfZDX7QZoY8Pq6rx1vScTpEg426PMOWx6w1Jb MVtGWGMc4qw5R8wrCuFsqL2gdqgUO6yURSOivw78bVLf//gbe00nAj17BQfzgSbZ59+p nfTREn0sRWL+f52EP9K41vUo6bGO7f8hJuNbTVN5CZXxsX3lbgToDu2WlmvnCkcQZdQu mtzcLaZw0e9olcl+eMJ98pr215DRIGYkTn19L2hM1Hc/6IBqbAVrPCLrA30Cm4z8/+q6 BggQ== 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=R5Xe9zYM3rwVYaJvJAQuuKTtJxWoPUf9jJ9amzAM90A=; b=hgbtMYknPnwmZECXODk1uW29MJoeQ8f4/3nq+nq7metiFBraODpFX2i6Z1WcfmEqOp d7P3n4ChRCNWdF66zD/SwAz9u45HYhu9GPtSm/Ua71FP7VexoZLUVrob/RnR/Ly1VanZ aybFBVJJVVj9+LXPcpmKsn0vUM+1wqLQiUDlkTr6uc4NrUGbfH1LgiBujnHfvJ7c/6hF cHMk9ZGJOQNy4dgvUtoUuGVTANrDlBfuZARKcJi2gjdifdnMY58k2L0XescwpAyDy6EW TCJ8W+hTxIFsJgf/53iYeUrkDBKZ6yZgtVf+fYuQTbq5zkR9J++GevBvFnvNb46g+1go dZOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=gpy6nhzs; 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 i9-20020a17090332c900b001a1a252c4b1si1383335plr.13.2023.03.16.20.21.10; Thu, 16 Mar 2023 20:21:25 -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=gpy6nhzs; 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 S229840AbjCQDLO (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Thu, 16 Mar 2023 23:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbjCQDKf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Mar 2023 23:10:35 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81356B1ED1; Thu, 16 Mar 2023 20:08:43 -0700 (PDT) X-UUID: 02b8d6b2c47111edbd2e61cc88cc8f98-20230317 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=R5Xe9zYM3rwVYaJvJAQuuKTtJxWoPUf9jJ9amzAM90A=; b=gpy6nhzsVeEgW/iFMqYMFWy+BJu4D1p7aHv6PbG0TgO2i/kYT4YeYouNv4ofQXpqHhIswY32PLpvyO9JtoYBiscz5nn9eARDbLqXBrRWd10+AOvgNNNFGXwM4qqg7bV0an30fzrl4fAogXAOBEeQ4GPPGW/lXUQPc4Ui17NUaao=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.21,REQID:d678e151-af5d-4759-a1cc-a3db4bf2be4f,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:757d83b3-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,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 02b8d6b2c47111edbd2e61cc88cc8f98-20230317 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 6471511; Fri, 17 Mar 2023 11:08:37 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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.25; Fri, 17 Mar 2023 11:08:36 +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; Fri, 17 Mar 2023 11:08:35 +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 v4,2/2] media: mediatek: vcodec: Using MM21 as the default capture format Date: Fri, 17 Mar 2023 11:08:33 +0800 Message-ID: <20230317030833.16836-2-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317030833.16836-1-yunfei.dong@mediatek.com> References: <20230317030833.16836-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=-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?1760583520512369986?= X-GMAIL-MSGID: =?utf-8?q?1760583520512369986?= |
Series |
[v4,1/2] media: mediatek: vcodec: Force capture queue format to MM21
|
|
Commit Message
Yunfei Dong (董云飞)
March 17, 2023, 3:08 a.m. UTC
For the capture queue only support MM21 format with LibYuv, need to set MM21 as the
default format.
Fixes: 7501edef6b1f ("media: mediatek: vcodec: Different codec using different capture format")
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
---
.../platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
Hi Yunfei, thanks for the patch. The commit title should be in imperative, so I suggest: media: mediatek: vcodec: Make MM21 the default capture format On Fri, Mar 17, 2023 at 11:08:33AM +0800, Yunfei Dong wrote: > For the capture queue only support MM21 format with LibYuv, need to set MM21 as the > default format. Again, I think this commit message could be improved a bit. Here's a suggestion: 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 Also, I think it would be slightly better if this was the first patch in the series, so that v4l2-compliance doesn't fail in between the patches. > > Fixes: 7501edef6b1f ("media: mediatek: vcodec: Different codec using different capture format") > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> With this change I've confirmed that all v4l2-compliance tests are passing again: Total for mtk-vcodec-dec device /dev/video2: 46, Succeeded: 46, Failed: 0, Warnings: 0 So, after the above comments are addressed, Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Thanks, Nícolas
Hi Nicolas, Thanks for your suggestion and test result. On Fri, 2023-03-17 at 12:16 -0400, Nícolas F. R. A. Prado wrote: > Hi Yunfei, > > thanks for the patch. > > The commit title should be in imperative, so I suggest: > > media: mediatek: vcodec: Make MM21 the default capture format > Accepted in next patch v4. > On Fri, Mar 17, 2023 at 11:08:33AM +0800, Yunfei Dong wrote: > > For the capture queue only support MM21 format with LibYuv, need to > > set MM21 as the > > default format. > > Again, I think this commit message could be improved a bit. Here's a > suggestion: > > 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 > > Also, I think it would be slightly better if this was the first patch > in the > series, so that v4l2-compliance doesn't fail in between the patches. > Accepted in next patch v4. Best Regards, Yunfei Dong > > > > Fixes: 7501edef6b1f ("media: mediatek: vcodec: Different codec > > using different capture format") > > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> > > With this change I've confirmed that all v4l2-compliance tests are > passing again: > > Total for mtk-vcodec-dec device /dev/video2: 46, Succeeded: 46, > Failed: 0, Warnings: 0 > > So, after the above comments are addressed, > > Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > Thanks, > Nícolas
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++;