Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp20403lql; Fri, 12 Apr 2024 02:13:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJZM44jBRbjYStJcwRAvjaJDgQVNMEPhx/n0LACc2xP9u1mGUmyUCRlxABGLiyJXh/lwJGGPVZJkzYQfZ+RImeJ8ZShpj5U6Sk6A1HmQ== X-Google-Smtp-Source: AGHT+IFfIWS2GHDy2c27PXyTTrs7pDDYFUr5CdFTN8/JIpkdhsp/arKDyhphy/H55Gavo+Go07XD X-Received: by 2002:a17:906:3292:b0:a51:c720:5107 with SMTP id 18-20020a170906329200b00a51c7205107mr1768477ejw.22.1712913190844; Fri, 12 Apr 2024 02:13:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712913190; cv=pass; d=google.com; s=arc-20160816; b=ANcYJh4IlbAgQfrQmDhGLFV9lRfL2SZ1Efqv5dg2fXITorsGQ2URjsa0StN0rVZEtn dIHsE0beu6zHb5gVHYpwo/dqDK/6dFDtHMSYkNSqFcs+0XTbxMc/WJYD7Kx1iXubiqkT QqHLqWQVpPhq4u7enB2SA4JYwceuQptdnF0dqZQFck2+/BwfELoVyLxY+QyTiG0eUJzS oLh/A9EBYjjImqkRCJnaDsbavSYq2VwG1cN56/7JxrR9UvdipWlONAZBiHRJH3pNAx1x zdBcFCZdjQDvbfn1FHu5u0aVcTuy2WBjYJGP+kco8JyjFiY5HY2wERdOF+No9kjtVy0U qs4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yBJQVDaTUe1NSxbYBhVQnV6Wx8yFNPfMZu1T60/ESF4=; fh=biKe3ab6vu9B2YV/BY0rSGdgJ9M/b05dGcvzyA7ivrs=; b=t/E15jddAlYLNUTyikU6V8OKw/3OKaWcn4DO7QXLRPvbZtdO6X4GLZplQwTjMYJD2v J+kr7J+Sv6DnVBFzmb9qqy5jbSPW4azqLIBuBcsYo6Tirm/XyAAMEPWDs/8+EDggzcyR PvK2vwLPNwpa0JoKBDy28U/BIJCZCiSeI09FUM4DPl7ZapbPoBpo8mhh6TuOe0zYt9TD ILuGbMLCWtE0HlBOTRAOeOdMZ5RRjGkaJHuzw+m2d7gDAV1IIiIba1VsjFbVJJEyBis1 FeIhBnm2a5ABR/H1h3B+cj+r+/oMpdW4agCHQiutEkQQf/kop4KkTDCkv5+7cJEYG/vf LQxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=JdPpyxrc; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-142355-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id do17-20020a170906c11100b00a51bd9d3e7csi1605880ejc.158.2024.04.12.02.13.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142355-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=JdPpyxrc; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-142355-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6ACB41F20FB5 for ; Fri, 12 Apr 2024 09:13:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FB845A0F1; Fri, 12 Apr 2024 09:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="JdPpyxrc" Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBC3658AA7; Fri, 12 Apr 2024 09:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912964; cv=none; b=ELs7hbuOM81PTKaBqRR8/TUYu+96JnpBUULvMXo8PUjuGvumPba6OK0jJworZe14Q9lWzN9jCPeqJHl5a01a3cuqRNAxkoo8NTb5/UD/saFMBm8hZi5llU87g0uCpW//ueH9UrcKAz+heJYqHBtZPN1TuqeLV7Cmvi9dpG4Mdnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912964; c=relaxed/simple; bh=Ch38JZLFFZb/hqWLunGeOTntmqMuWA1P2C6iG3pTtOM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pISETimWhh1GpgxiZlDselcgWKe8U7LZBFTRCgxHNTmPNsL+JPmQ6MH5POx5a1fpdOVQk5xmyzye6hLc5elFNms1mb4hJ/vLPMe+enoeCFi15JoG6m6AYqtCoXcHsEzSo4d7MR6VvjVkwZ72fWxY6sODjUentq36lt+sYu3Bovc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=JdPpyxrc; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 57bfb124f8ac11ee935d6952f98a51a9-20240412 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=yBJQVDaTUe1NSxbYBhVQnV6Wx8yFNPfMZu1T60/ESF4=; b=JdPpyxrchZjGjgSrrm0KbFCtrIijQhib2MVIJxW9JvAe0p+h/QbipuSQSHcCIaTywCmn7tisDJ5BhefcY86XiPdyvUZKsEGpxfREBbpwlVoqirdNroasI4BfXtgH0l+2nR+CrLgJx0SmrU9i+XwyagMNk/Ue/4wnD7JezYUFUu0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:de76cbc7-45f2-4354-9757-1f0d0b308f78,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:6f543d0,CLOUDID:a4b01986-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT: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: 57bfb124f8ac11ee935d6952f98a51a9-20240412 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 963250428; Fri, 12 Apr 2024 17:09:18 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS09N1.mediatek.inc (172.21.101.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 12 Apr 2024 02:09:17 -0700 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; Fri, 12 Apr 2024 17:09:15 +0800 From: Yunfei Dong To: Jeffrey Kardatzke , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nathan Hebert , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Sebastian Fricke , Tomasz Figa , Mauro Carvalho Chehab , Marek Szyprowski CC: Chen-Yu Tsai , Yong Wu , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , Sumit Semwal , Brian Starkey , John Stultz , "T . J . Mercier" , =?UTF-8?q?Christian=20K=C3=B6nig?= , Matthias Brugger , , , , , , Subject: [PATCH v5,15/23] media: mediatek: vcodec: Add one plane format Date: Fri, 12 Apr 2024 17:08:43 +0800 Message-ID: <20240412090851.24999-16-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240412090851.24999-1-yunfei.dong@mediatek.com> References: <20240412090851.24999-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N Adding capture formats to support V4L2_PIX_FMT_MS21. This format has one plane and only be used for secure video playback at current period. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c | 4 +++- .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c index 9107707de6c4..192b01ff3ede 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c @@ -49,7 +49,9 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_dec_ctx *ctx, int format_inde num_frame_count++; } - if (num_frame_count == 1 || (!ctx->is_10bit_bitstream && fmt->fourcc == V4L2_PIX_FMT_MM21)) + if ((!ctx->is_10bit_bitstream && fmt->fourcc == V4L2_PIX_FMT_MM21) || + (ctx->is_secure_playback && fmt->fourcc == V4L2_PIX_FMT_MS21) || + num_frame_count == 1) return true; q_data = &ctx->q_data[MTK_Q_DATA_SRC]; 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 b903e39fee89..fbea00517565 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 @@ -229,7 +229,7 @@ static const struct mtk_stateless_control mtk_stateless_controls[] = { #define NUM_CTRLS ARRAY_SIZE(mtk_stateless_controls) -static struct mtk_video_fmt mtk_video_formats[9]; +static struct mtk_video_fmt mtk_video_formats[10]; static struct mtk_video_fmt default_out_format; static struct mtk_video_fmt default_cap_format; @@ -770,6 +770,11 @@ static void mtk_vcodec_add_formats(unsigned int fourcc, mtk_video_formats[count_formats].type = MTK_FMT_FRAME; mtk_video_formats[count_formats].num_planes = 2; break; + case V4L2_PIX_FMT_MS21: + mtk_video_formats[count_formats].fourcc = fourcc; + mtk_video_formats[count_formats].type = MTK_FMT_FRAME; + mtk_video_formats[count_formats].num_planes = 1; + break; default: mtk_v4l2_vdec_err(ctx, "Can not add unsupported format type"); return; @@ -798,6 +803,8 @@ static void mtk_vcodec_get_supported_formats(struct mtk_vcodec_dec_ctx *ctx) cap_format_count++; } if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_MM21) { + mtk_vcodec_add_formats(V4L2_PIX_FMT_MS21, ctx); + cap_format_count++; mtk_vcodec_add_formats(V4L2_PIX_FMT_MM21, ctx); cap_format_count++; } -- 2.18.0