From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64AF7606A329 for ; Tue, 17 Nov 2026 08:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=BstXJp4y; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=kSYayXId DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=LBfT8oUpRSb3ROp3Fan4y8yitsmseW9MM+ckcXN8DP4=; b=BstXJp4yP6IgDIuMgP+7tGv/ds t6Fv2fF2KLwjdrFN5YhWvPI7Vyy1D85CCWuqXj8rGS0KQNM7xPIlLCwyO5UkkpQrPyJRP2jYe7KGa 5VDN6625CUeeyzHPjlpcrXpUyKBEH7WZu0EST1M5x1ZQRr0W6fpIOZRtNYqXvr1/ePymEObzbSGXq ZRtwiIjhpwXUarCdTo9aFC2g6JnG2eXQE8CuYbubx3JNQVAqijwOgtQOvbFeQlYB9f+j8cB5Lyg0e BIEsngUan9yaYQkWXMEBz2m+qa07n2y0+HaxwoOweEh3cRKLNF13ipSH/txRgm5/NAmGO8JGYzEOZ t4/ogV7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xTF21-00000004yzm-0H2h; Tue, 17 Nov 2026 08:59:13 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xTF1d-00000004yb6-0MRI; Tue, 17 Nov 2026 08:58:52 +0000 X-UUID: 16e16a4ee26511f1afed4741b24580c9-20261117 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=LBfT8oUpRSb3ROp3Fan4y8yitsmseW9MM+ckcXN8DP4=; b=kSYayXId4CO1AizjxgHVcJs0lnA1PFpbJaXlujjjftril69jEa016ZfvgqgpKvHZYM4Gk/sOPK1xF4QPSCnlmYeT34QOJK6PwvUkz8W2s0VJLWA2r2gwMPbaPuSIrDiyIZ4Q2tWHrVJ9fj9QgpoCEiMZ2oNWSChCyKOR+6emQ6Y=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.21,REQID:f0d8b9a7-b4e5-4e76-beec-d92d23278aee,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:b0318ac,CLOUDID:c2b86866-4b51-4c95-bb1b-80ac6aad9c96,B ulkID:nil,BulkQuantity:0,SF:81|82|102|836|865|888|898,TC:-5,Content:0|15|5 0|99,EDM:-3,IP:nil,URL:0,File:130,RT:0,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,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 16e16a4ee26511f1afed4741b24580c9-20261117 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1760822913; Tue, 17 Nov 2026 01:58:42 -0700 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 17 Nov 2026 16:58:40 +0800 Received: from gcnsap21.gcn.mediatek.inc (10.17.81.22) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Tue, 17 Nov 2026 16:58:39 +0800 From: Kyrie Wu To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Kyrie Wu , Hans Verkuil , Nicolas Dufresne , Nathan Hebert , Arnd Bergmann , Irui Wang , George Sun , , , , , CC: Neil Armstrong , Andrzej Pietrasiewicz , Yilong Zhou Subject: [PATCH v12 02/10] media: mediatek: decoder: Add a new platform data member Date: Tue, 17 Nov 2026 16:58:25 +0800 Message-ID: <20261117085834.1464723-3-kyrie.wu@mediatek.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261117085834.1464723-1-kyrie.wu@mediatek.com> References: <20261117085834.1464723-1-kyrie.wu@mediatek.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261117_005849_195776_F63F4EAA X-CRM114-Status: GOOD ( 20.84 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Move the chip model information into the codec match data and remove the second compatible matching code. Signed-off-by: Kyrie Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nicolas Dufresne --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 2 +- .../mediatek/vcodec/decoder/mtk_vcodec_dec.h | 5 + .../vcodec/decoder/mtk_vcodec_dec_drv.c | 40 ++----- .../vcodec/decoder/mtk_vcodec_dec_drv.h | 17 +-- .../vcodec/decoder/mtk_vcodec_dec_hw.c | 2 +- .../vcodec/decoder/mtk_vcodec_dec_stateful.c | 1 + .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 104 +++++++++++++----- 7 files changed, 96 insertions(+), 75 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 d76e891f7..13d70acda 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c @@ -263,7 +263,7 @@ static int vidioc_vdec_querycap(struct file *file, void *priv, struct device *dev = &ctx->dev->plat_dev->dev; strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); - snprintf(cap->card, sizeof(cap->card), "MT%d video decoder", ctx->dev->chip_name); + snprintf(cap->card, sizeof(cap->card), "MT%d video decoder", ctx->dev->chip_model); return 0; } diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.h b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.h index 1af075fc0..80cb46f1c 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.h +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.h @@ -69,6 +69,11 @@ extern const struct v4l2_m2m_ops mtk_vdec_m2m_ops; extern const struct media_device_ops mtk_vcodec_media_ops; extern const struct mtk_vcodec_dec_pdata mtk_vdec_8173_pdata; extern const struct mtk_vcodec_dec_pdata mtk_vdec_8183_pdata; +extern const struct mtk_vcodec_dec_pdata mtk_vdec_8186_pdata; +extern const struct mtk_vcodec_dec_pdata mtk_vdec_8188_pdata; +extern const struct mtk_vcodec_dec_pdata mtk_vdec_8192_pdata; +extern const struct mtk_vcodec_dec_pdata mtk_vdec_8195_pdata; +extern const struct mtk_vcodec_dec_pdata mtk_vdec_8196_pdata; extern const struct mtk_vcodec_dec_pdata mtk_lat_sig_core_pdata; extern const struct mtk_vcodec_dec_pdata mtk_vdec_single_core_pdata; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c index 0296b39d9..75e495b1a 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c @@ -331,26 +331,9 @@ static const struct v4l2_file_operations mtk_vcodec_fops = { .mmap = v4l2_m2m_fop_mmap, }; -static void mtk_vcodec_dec_get_chip_name(struct mtk_vcodec_dec_dev *vdec_dev) +static void mtk_vcodec_dec_get_chip_model(struct mtk_vcodec_dec_dev *vdec_dev) { - struct device *dev = &vdec_dev->plat_dev->dev; - - if (of_device_is_compatible(dev->of_node, "mediatek,mt8173-vcodec-dec")) - vdec_dev->chip_name = MTK_VDEC_MT8173; - else if (of_device_is_compatible(dev->of_node, "mediatek,mt8183-vcodec-dec")) - vdec_dev->chip_name = MTK_VDEC_MT8183; - else if (of_device_is_compatible(dev->of_node, "mediatek,mt8192-vcodec-dec")) - vdec_dev->chip_name = MTK_VDEC_MT8192; - else if (of_device_is_compatible(dev->of_node, "mediatek,mt8195-vcodec-dec")) - vdec_dev->chip_name = MTK_VDEC_MT8195; - else if (of_device_is_compatible(dev->of_node, "mediatek,mt8186-vcodec-dec")) - vdec_dev->chip_name = MTK_VDEC_MT8186; - else if (of_device_is_compatible(dev->of_node, "mediatek,mt8188-vcodec-dec")) - vdec_dev->chip_name = MTK_VDEC_MT8188; - else if (of_device_is_compatible(dev->of_node, "mediatek,mt8196-vcodec-dec")) - vdec_dev->chip_name = MTK_VDEC_MT8196; - else - vdec_dev->chip_name = MTK_VDEC_INVAL; + vdec_dev->chip_model = vdec_dev->vdec_pdata->chip_model; } static int mtk_vcodec_probe(struct platform_device *pdev) @@ -367,13 +350,8 @@ static int mtk_vcodec_probe(struct platform_device *pdev) INIT_LIST_HEAD(&dev->ctx_list); dev->plat_dev = pdev; - mtk_vcodec_dec_get_chip_name(dev); - if (dev->chip_name == MTK_VDEC_INVAL) { - dev_err(&pdev->dev, "Failed to get decoder chip name"); - return -EINVAL; - } - dev->vdec_pdata = of_device_get_match_data(&pdev->dev); + mtk_vcodec_dec_get_chip_model(dev); if (!of_property_read_u32(pdev->dev.of_node, "mediatek,vpu", &rproc_phandle)) { dev->fw_init = mtk_vcodec_fw_vpu_init; @@ -388,7 +366,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev) return -ENODEV; } dma_set_max_seg_size(&pdev->dev, UINT_MAX); - if (dev->chip_name == MTK_VDEC_MT8196) { + if (dev->chip_model == 8196) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36)); if (ret) { dev_err(&pdev->dev, "Failed to enable 36-bit DMA: %d\n", ret); @@ -557,23 +535,23 @@ static const struct of_device_id mtk_vcodec_match[] = { }, { .compatible = "mediatek,mt8192-vcodec-dec", - .data = &mtk_lat_sig_core_pdata, + .data = &mtk_vdec_8192_pdata, }, { .compatible = "mediatek,mt8186-vcodec-dec", - .data = &mtk_vdec_single_core_pdata, + .data = &mtk_vdec_8186_pdata, }, { .compatible = "mediatek,mt8195-vcodec-dec", - .data = &mtk_lat_sig_core_pdata, + .data = &mtk_vdec_8195_pdata, }, { .compatible = "mediatek,mt8188-vcodec-dec", - .data = &mtk_lat_sig_core_pdata, + .data = &mtk_vdec_8188_pdata, }, { .compatible = "mediatek,mt8196-vcodec-dec", - .data = &mtk_lat_sig_core_pdata, + .data = &mtk_vdec_8196_pdata, }, {}, }; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h index 53d1708b0..153c617df 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h @@ -21,17 +21,6 @@ #define IS_VDEC_INNER_RACING(capability) ((capability) & MTK_VCODEC_INNER_RACING) #define IS_VDEC_SUPPORT_EXT(capability) ((capability) & MTK_VDEC_IS_SUPPORT_EXT) -enum mtk_vcodec_dec_chip_name { - MTK_VDEC_INVAL = 0, - MTK_VDEC_MT8173 = 8173, - MTK_VDEC_MT8183 = 8183, - MTK_VDEC_MT8186 = 8186, - MTK_VDEC_MT8188 = 8188, - MTK_VDEC_MT8192 = 8192, - MTK_VDEC_MT8195 = 8195, - MTK_VDEC_MT8196 = 8196, -}; - /* * enum mtk_vdec_format_types - Structure used to get supported * format types according to decoder capability @@ -108,6 +97,7 @@ struct vdec_pic_info { * * @is_subdev_supported: whether support parent-node architecture(subdev) * @uses_stateless_api: whether the decoder uses the stateless API with requests + * @chip_model: platforms configuration values */ struct mtk_vcodec_dec_pdata { void (*init_vdec_params)(struct mtk_vcodec_dec_ctx *ctx); @@ -129,6 +119,7 @@ struct mtk_vcodec_dec_pdata { bool is_subdev_supported; bool uses_stateless_api; + unsigned int chip_model; }; /** @@ -277,7 +268,7 @@ struct mtk_vcodec_dec_ctx { * @dec_racing_info_mutex: mutex lock used for inner racing mode * @dbgfs: debug log related information * - * @chip_name: used to distinguish platforms and select the correct codec configuration values + * @chip_model: used to distinguish platforms and select the correct codec configuration values */ struct mtk_vcodec_dec_dev { struct v4l2_device v4l2_dev; @@ -321,7 +312,7 @@ struct mtk_vcodec_dec_dev { struct mutex dec_racing_info_mutex; struct mtk_vcodec_dbgfs dbgfs; - enum mtk_vcodec_dec_chip_name chip_name; + unsigned int chip_model; }; static inline struct mtk_vcodec_dec_ctx *fh_to_dec_ctx(struct v4l2_fh *fh) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c index e75fe79d0..8fbc9289c 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c @@ -77,7 +77,7 @@ static void mtk_vdec_hw_clean_xpc(struct mtk_vdec_hw_dev *dev) unsigned long flags; u32 val, mask, addr = VDEC_XPC_CLEAN_ADDR; - if (dev->main_dev->chip_name != MTK_VDEC_MT8196) + if (dev->main_dev->chip_model != 8196) return; val = dev->hw_idx == MTK_VDEC_LAT0 ? VDEC_XPC_LAT_VAL : VDEC_XPC_CORE_VAL; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.c index aa9bdee7a..0e702d6a4 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.c @@ -618,4 +618,5 @@ const struct mtk_vcodec_dec_pdata mtk_vdec_8173_pdata = { .flush_decoder = mtk_vdec_flush_decoder, .is_subdev_supported = false, .hw_arch = MTK_VDEC_PURE_SINGLE_CORE, + .chip_model = 8173, }; 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 472ece571..5ecbfc169 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 @@ -571,17 +571,17 @@ static const struct v4l2_ctrl_ops mtk_vcodec_dec_ctrl_ops = { static void mtk_vcodec_dec_fill_h264_level(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { - switch (ctx->dev->chip_name) { - case MTK_VDEC_MT8192: - case MTK_VDEC_MT8188: + switch (ctx->dev->chip_model) { + case 8192: + case 8188: cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_5_2; break; - case MTK_VDEC_MT8195: - case MTK_VDEC_MT8196: + case 8195: + case 8196: cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_6_0; break; - case MTK_VDEC_MT8183: - case MTK_VDEC_MT8186: + case 8183: + case 8186: cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_4_2; break; default: @@ -593,10 +593,10 @@ static void mtk_vcodec_dec_fill_h264_level(struct v4l2_ctrl_config *cfg, static void mtk_vcodec_dec_fill_h264_profile(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { - switch (ctx->dev->chip_name) { - case MTK_VDEC_MT8188: - case MTK_VDEC_MT8195: - case MTK_VDEC_MT8196: + switch (ctx->dev->chip_model) { + case 8188: + case 8195: + case 8196: cfg->max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10; break; default: @@ -608,12 +608,12 @@ static void mtk_vcodec_dec_fill_h264_profile(struct v4l2_ctrl_config *cfg, static void mtk_vcodec_dec_fill_h265_level(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { - switch (ctx->dev->chip_name) { - case MTK_VDEC_MT8188: + switch (ctx->dev->chip_model) { + case 8188: cfg->max = V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1; break; - case MTK_VDEC_MT8195: - case MTK_VDEC_MT8196: + case 8195: + case 8196: cfg->max = V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2; break; default: @@ -625,10 +625,10 @@ static void mtk_vcodec_dec_fill_h265_level(struct v4l2_ctrl_config *cfg, static void mtk_vcodec_dec_fill_h265_profile(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { - switch (ctx->dev->chip_name) { - case MTK_VDEC_MT8188: - case MTK_VDEC_MT8195: - case MTK_VDEC_MT8196: + switch (ctx->dev->chip_model) { + case 8188: + case 8195: + case 8196: cfg->max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10; break; default: @@ -640,16 +640,16 @@ static void mtk_vcodec_dec_fill_h265_profile(struct v4l2_ctrl_config *cfg, static void mtk_vcodec_dec_fill_vp9_level(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { - switch (ctx->dev->chip_name) { - case MTK_VDEC_MT8192: - case MTK_VDEC_MT8188: + switch (ctx->dev->chip_model) { + case 8192: + case 8188: cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_1; break; - case MTK_VDEC_MT8195: - case MTK_VDEC_MT8196: + case 8195: + case 8196: cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_2; break; - case MTK_VDEC_MT8186: + case 8186: cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_4_1; break; default: @@ -661,10 +661,10 @@ static void mtk_vcodec_dec_fill_vp9_level(struct v4l2_ctrl_config *cfg, static void mtk_vcodec_dec_fill_vp9_profile(struct v4l2_ctrl_config *cfg, struct mtk_vcodec_dec_ctx *ctx) { - switch (ctx->dev->chip_name) { - case MTK_VDEC_MT8188: - case MTK_VDEC_MT8195: - case MTK_VDEC_MT8196: + switch (ctx->dev->chip_model) { + case 8188: + case 8195: + case 8196: cfg->max = V4L2_MPEG_VIDEO_VP9_PROFILE_2; break; default: @@ -935,6 +935,7 @@ const struct mtk_vcodec_dec_pdata mtk_vdec_8183_pdata = { .get_cap_buffer = vdec_get_cap_buffer, .is_subdev_supported = false, .hw_arch = MTK_VDEC_PURE_SINGLE_CORE, + .chip_model = 8183, }; /* This platform data is used for one lat and one core architecture. */ @@ -955,6 +956,45 @@ const struct mtk_vcodec_dec_pdata mtk_lat_sig_core_pdata = { .hw_arch = MTK_VDEC_LAT_SINGLE_CORE, }; +#define MTK_STATELESS_DEC_DATA \ + .init_vdec_params = mtk_init_vdec_params, \ + .ctrls_setup = mtk_vcodec_dec_ctrls_setup, \ + .vdec_vb2_ops = &mtk_vdec_request_vb2_ops, \ + .vdec_formats = mtk_video_formats, \ + .num_formats = &num_formats, \ + .default_out_fmt = &default_out_format, \ + .default_cap_fmt = &default_cap_format, \ + .uses_stateless_api = true, \ + .worker = mtk_vdec_worker, \ + .flush_decoder = mtk_vdec_flush_decoder, \ + .cap_to_disp = mtk_vdec_stateless_cap_to_disp, \ + .get_cap_buffer = vdec_get_cap_buffer, \ + .is_subdev_supported = true + +const struct mtk_vcodec_dec_pdata mtk_vdec_8188_pdata = { + MTK_STATELESS_DEC_DATA, + .hw_arch = MTK_VDEC_LAT_SINGLE_CORE, + .chip_model = 8188, +}; + +const struct mtk_vcodec_dec_pdata mtk_vdec_8192_pdata = { + MTK_STATELESS_DEC_DATA, + .hw_arch = MTK_VDEC_LAT_SINGLE_CORE, + .chip_model = 8192, +}; + +const struct mtk_vcodec_dec_pdata mtk_vdec_8195_pdata = { + MTK_STATELESS_DEC_DATA, + .hw_arch = MTK_VDEC_LAT_SINGLE_CORE, + .chip_model = 8195, +}; + +const struct mtk_vcodec_dec_pdata mtk_vdec_8196_pdata = { + MTK_STATELESS_DEC_DATA, + .hw_arch = MTK_VDEC_LAT_SINGLE_CORE, + .chip_model = 8196, +}; + const struct mtk_vcodec_dec_pdata mtk_vdec_single_core_pdata = { .init_vdec_params = mtk_init_vdec_params, .ctrls_setup = mtk_vcodec_dec_ctrls_setup, @@ -971,3 +1011,9 @@ const struct mtk_vcodec_dec_pdata mtk_vdec_single_core_pdata = { .is_subdev_supported = true, .hw_arch = MTK_VDEC_PURE_SINGLE_CORE, }; + +const struct mtk_vcodec_dec_pdata mtk_vdec_8186_pdata = { + MTK_STATELESS_DEC_DATA, + .hw_arch = MTK_VDEC_PURE_SINGLE_CORE, + .chip_model = 8186, +}; -- 2.51.0.windows.2