Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2099933pxb; Sat, 22 Jan 2022 16:15:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5BH9Ub29ecvsvNuBL6tcdWwtrtGQO+4wcICWP7McJPJ8+ezfmPlCsIyw+eppsReBowJIF X-Received: by 2002:a17:90a:7604:: with SMTP id s4mr6892503pjk.69.1642896934835; Sat, 22 Jan 2022 16:15:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642896934; cv=none; d=google.com; s=arc-20160816; b=of9SUB2ci8/WChXewVu4E7tnYS2T4yoMDVlmZeSvmUqj082GU6klhl8XOH8CLIWmym T2hBueIrfq7vOYIyNIavfkzU6TTYvYGoFSYssBwebCTTKufjhs/k1+uVhsB7IOImHKCX RshplNoXsuIYW6Shr/2g2rH+4yZqrtq7GvE2vAiTPLMfvDO28kPTjmyUDL6pjU/7rQ0y 78SiMbs/08sjrY6j8tBGD8TPfnbSsyGZMec/3uw6mOnDK/3J6WVWI8LKQSDNsolu0p/0 KnSUermFio07XzRpMTXmltuHsi/XP8Kn8ZBSGUpEpXS9QwszOPeDz7XEIRkrRcAcNB3s 2Bzw== 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; bh=XQJN+psOdUJC+KGZG92i3Vu91XKq1w3BJjWSDucIuaY=; b=cxVBBpWVcZdBi+bx7p6MyPrYSKMPJzeYhF+M1SMc491h+YKDBCUbJwAgpvJiisKHLb fxwpM58oEkdQRpwZge2HVhk/b94CpYvP/8mJj88Qcuy9em4ImFSWICsu+0lgq3v5BV/b jSFJgVOsEG/yhr6Kyr4qlJr8qMKE0ZQV9lr+9jekluzyJ6r8+ayUbPxL7i5+htSzW2EH hl+qUX6NDTf6dCOjlcevSoo0amwdy0EgTYnxO95x4x99i4RFYZ0ilD2Gd2+tImlfPWXi HK4xcELqbhhLcomKvfPUvsseras8VobzM9CbULQTRj/LZC+CcI92AsMtwGkDXv38F94A tPYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si10954945pfv.259.2022.01.22.16.15.23; Sat, 22 Jan 2022 16:15:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232629AbiAVDxt (ORCPT + 99 others); Fri, 21 Jan 2022 22:53:49 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:52030 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232560AbiAVDxg (ORCPT ); Fri, 21 Jan 2022 22:53:36 -0500 X-UUID: e9896c77192048b5ae7bc04c4cff6698-20220122 X-UUID: e9896c77192048b5ae7bc04c4cff6698-20220122 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1812656702; Sat, 22 Jan 2022 11:53:33 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 22 Jan 2022 11:53:32 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 22 Jan 2022 11:53:31 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 22 Jan 2022 11:53:30 +0800 From: Yunfei Dong To: Yunfei Dong , Alexandre Courbot , Hans Verkuil , "Tzung-Bi Shih" , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: George Sun , Xiaoyong Lu , Hsin-Yi Wang , Fritz Koenig , Dafna Hirschfeld , Benjamin Gaignard , Daniel Vetter , dri-devel , Irui Wang , AngeloGioacchino Del Regno , Steve Cho , , , , , , , Subject: [PATCH v6, 08/15] media: mtk-vcodec: Add format to support MT21C Date: Sat, 22 Jan 2022 11:53:09 +0800 Message-ID: <20220122035316.18179-9-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220122035316.18179-1-yunfei.dong@mediatek.com> References: <20220122035316.18179-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Needs to use mediatek compressed mode for mt8192 decoder. Signed-off-by: Yunfei Dong --- .../media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c | 7 ++++++- drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c index e51d935bd21d..9333e3418b98 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c @@ -81,7 +81,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[2]; +static struct mtk_video_fmt mtk_video_formats[3]; static struct mtk_codec_framesizes mtk_vdec_framesizes[1]; static struct mtk_video_fmt default_out_format; @@ -359,6 +359,7 @@ static void mtk_vcodec_add_formats(unsigned int fourcc, num_framesizes++; break; case V4L2_PIX_FMT_MM21: + case V4L2_PIX_FMT_MT21C: mtk_video_formats[count_formats].fourcc = fourcc; mtk_video_formats[count_formats].type = MTK_FMT_FRAME; mtk_video_formats[count_formats].num_planes = 2; @@ -384,6 +385,10 @@ static void mtk_vcodec_get_supported_formats(struct mtk_vcodec_ctx *ctx) 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_H264_SLICE) { mtk_vcodec_add_formats(V4L2_PIX_FMT_H264_SLICE, ctx); out_format_count++; diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index 13c12de85edf..aa608ab0a247 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -353,6 +353,7 @@ enum mtk_vdec_hw_arch { */ enum mtk_vdec_format_types { MTK_VDEC_FORMAT_MM21 = 0x20, + MTK_VDEC_FORMAT_MT21C = 0x40, MTK_VDEC_FORMAT_H264_SLICE = 0x100, }; -- 2.25.1