Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp246946lqo; Thu, 16 May 2024 05:24:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZxtUrh+RSXP63A/3jHyh3dr3817u1OzVzPFq02ZXK8+iUYlWS0GpYKT0hi9dPObGcdLX0KyiqpeEX9d4ASsNsgRSUgZhxQzLcu8E+iw== X-Google-Smtp-Source: AGHT+IEaD+A6E8RgSYX4o0JM65S2enH/h7a29Qg6Cld4b6Q/DsQDYHNiNOL3UW/DIScPksnfQcHQ X-Received: by 2002:a05:6512:3f08:b0:51a:d9a3:dbf5 with SMTP id 2adb3069b0e04-5221016b4a2mr20210856e87.47.1715862286725; Thu, 16 May 2024 05:24:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715862286; cv=pass; d=google.com; s=arc-20160816; b=efSg/Dxi10+ucD8t4IqCDdyhpIk/taRvMUcJRo569JPePS6zJ5knF69XJMtQfY8o3D IJQPBK7LTttYt2zstPbMGKSA4LnwbSHAKILlDctRmE7tRkes368wvd9iw//Np2ZJPVma 36CVpyfe73TKXtQkX0lW0m50Rk/3RcDFKf2hGxQi8pnFxEUYR9qTQ9Fwu3LrY0myqulr VSWmzdilC37kTEkKsIQORaMzqZfE3CugmEyZS27kYIxNs0OoMl0WFfPJZbsHH0nbhJRF 8cUCjWNxRCv3KdTUuBBGdhU46kvo9Xsyhs4bQtN1lPHmB21WCNCHDocpvW19CSlUyE7L FTzA== 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=JwaEfrQ3AzPxG6n0wLSUxf07Klgy0nIHPcoaC9dlkBc=; fh=biKe3ab6vu9B2YV/BY0rSGdgJ9M/b05dGcvzyA7ivrs=; b=Gx1kWB5WGVHgEqbXX/T3Ee7b8ZxIiuhW1MeF5KI1rWL52GfOboSrRC9Vt9ua3OMotE PrbvFk5CaABSMCTMGpX2Y/U+j81YtchR6PZOSRWyMLQ55oir3rGu4ytl43uqkxF6VF6f rcvnoAq7lf7++kXj+BO5basoqsYPMbbTYTDwp44z/w7/V6LEYumR+Y/uBVP9Tm7LXD8y lwOjRi087a/EQnHGQhCc2ZK5xmrXMvTkgwuAyL5QltTOnOdxyBjQLEj5M0enhvK0Y8Wl M+Wa3COCg0DQZS4apB2hElcCZ1mLHgEahYOBk5gkUN2o/PIkuPlswI/tYEbKy/VRtp4q 6R2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=gGRj0l9N; 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-181007-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181007-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d48d2si3718958a12.236.2024.05.16.05.24.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 05:24:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181007-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=gGRj0l9N; 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-181007-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181007-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 41FD91F21C5D for ; Thu, 16 May 2024 12:24:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE9511514D4; Thu, 16 May 2024 12:21:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="gGRj0l9N" Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (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 E50D614F109; Thu, 16 May 2024 12:21:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715862094; cv=none; b=gzieaqhQwl2IIpyG7wziYid5M59M5eke7E0pzNKa4wUXzDKjwRYTb2HsLlmm07BC2lWL0cZIo8HI595ZvsIpdY78XNar/B6LJ7BsA5+XGHiPok4flOruLkuCMRv4wUb7lZ+vbfhltJZJVK9ZwPSZxwjYBCaR89nJbEIG8Hcq6ys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715862094; c=relaxed/simple; bh=176KMAHe/Yat1euOIZVc5d+ndoRSMUkKqRCeVOmEl6o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HDhAw2mx+aeCcYyYXjuW7x0MitUjCNjT5IiLXWqRKxWpNhd4Owj8AiWsWqm09G9UlyhDX7+XdSEE5qfGw3Gzc/UtOJCmbv4FE4rdFfqjGzGCVRu4YUFb9t+tBOWkGgyiiuosV7oq965jDSWQoNrV3t++8bmKjUje2hhNOp11Dw8= 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=gGRj0l9N; arc=none smtp.client-ip=60.244.123.138 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: d34a4a74137e11efb92737409a0e9459-20240516 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=JwaEfrQ3AzPxG6n0wLSUxf07Klgy0nIHPcoaC9dlkBc=; b=gGRj0l9NMQrPG+rUDBwMDbPBgpeJC8i9TutQ3d6z/ncYrgstvVlwEWLy+iBD/pc78NsSmXycItnK/m6IGuNGCQBelr1R8P8Fhv2JVwQmNpRoMpwoCgsvjR/RwN9bWnQB/8GdYv32iSVuqHAssX+S6CjmJ0lId/47bbrN6Ph5UJo=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:f93b2ea9-0a31-4d67-ace9-777c94a17aa0,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:82c5f88,CLOUDID:d6537087-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: d34a4a74137e11efb92737409a0e9459-20240516 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 636509584; Thu, 16 May 2024 20:21:30 +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; Thu, 16 May 2024 20:21:29 +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; Thu, 16 May 2024 20:21:27 +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 v6,15/24] media: mediatek: vcodec: Add one plane format Date: Thu, 16 May 2024 20:20:53 +0800 Message-ID: <20240516122102.16379-16-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240516122102.16379-1-yunfei.dong@mediatek.com> References: <20240516122102.16379-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.25.1