Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp820920rdb; Wed, 6 Dec 2023 00:18:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGt5OzWbBalnfAO1ui3IW/kqqxJm2al2F2gPkOMrNKasgMrRPcqcEcXcoLznIzjJ+tWESm X-Received: by 2002:a05:6808:2396:b0:3a7:d566:8b5e with SMTP id bp22-20020a056808239600b003a7d5668b5emr694084oib.44.1701850707938; Wed, 06 Dec 2023 00:18:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701850707; cv=none; d=google.com; s=arc-20160816; b=mJq/QHTAYDohNClzdg0fA+vLh3+B0aiDBelGIGo5yVlXCvDy5BI/ynhfYLnG7m1GIW Vw9XCVByCUvqjfNUtro10l6HKx1zNfqyB/XOn7j97YeHKqyg54RanYpQ6D7H/TN8Pzhc Swp6NQAUsOCln/NTxVFJp9aO/Jp5a9wtZWoT89QL3a2kQHuF77vJvKWsXVM1q32nl+JP lbj0lK6HJPq3MIEcFtv7iXvIzJ1VnqNSW5f1VEh9XG7GbcQF3h9MS9eszlwkIANY2GnV q8cR9Hkj1e2A+6m+ae6EUC79dxwUPTEtb6iVpEwLSezpHr2tCUAchSbi4nZc3L2E41a7 OTSw== 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=kC7KzWLgDHvbqhzMWnc/8P0WK0I0J12Fa3NbbNqI088=; fh=wcqrfUTA4c9nkJHA4kqbuH5WL/x/W2/AFDhttE+DJkw=; b=G8FukdDoAHEptDA6a05m9PDYnQTHMx1ZZfp+ml57xl23/9Z64GmlOPsZtLd3ElMGwJ sJf/6nWZsl8M7p41D3DZDcyUuxqjTkrS1Ta5AGl1E1Es7vxx6INIjEk2p2ovd7m1quRr L/Nk6KO29h+foofWUDs+cpfSAisuMQH740T0OtesaG+QwwLu8RSxGnvTlv/MWTR3rOz9 VwqkBKMn2xBeVoMIfSvZbcvx48txaz82wXPvkh5OmgZwOl1StwFJJiERCx2sMW5VIgic 05asCQ6D5AkMYndLQ+lGW2tQHI1WgluKYniWvHR7667jKkKAz6R72P4BHk/dg4ct3OiZ uBIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=DRgY0xCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z27-20020a630a5b000000b005c1cc7273basi11241237pgk.257.2023.12.06.00.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 00:18:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=DRgY0xCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7DDBE80BEF09; Wed, 6 Dec 2023 00:18:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377361AbjLFIRZ (ORCPT + 99 others); Wed, 6 Dec 2023 03:17:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377315AbjLFIQr (ORCPT ); Wed, 6 Dec 2023 03:16:47 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5576E199E; Wed, 6 Dec 2023 00:16:16 -0800 (PST) X-UUID: b4edff10940f11ee8051498923ad61e6-20231206 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=kC7KzWLgDHvbqhzMWnc/8P0WK0I0J12Fa3NbbNqI088=; b=DRgY0xCz2XKjDEUTrQLh5nBlVtY87KqKA/vZ1ToLL9WmUItuVnxQpasK9nM0ldv7Y/kkWe5z8ag7jL/1fjbHBBqG3P3bIhs3ng3zEoSWUoWC6qXg8HVJ9JFvqzplyKrOTg5L7QrdC6tBAnpXG4WiegqyYhI5kXm7S9pGqrZhUzc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.34,REQID:0b6040a7-3dbc-4ac0-bb21-ed69f2d0860c,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:abefa75,CLOUDID:bf863596-10ce-4e4b-85c2-c9b5229ff92b,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,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: b4edff10940f11ee8051498923ad61e6-20231206 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 991676486; Wed, 06 Dec 2023 16:16:07 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 6 Dec 2023 16:16:06 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 6 Dec 2023 16:16:05 +0800 From: Yunfei Dong To: Jeffrey Kardatzke , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert 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 v3,20/21] media: medkatek: vcodec: support tee decoder Date: Wed, 6 Dec 2023 16:15:37 +0800 Message-ID: <20231206081538.17056-21-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231206081538.17056-1-yunfei.dong@mediatek.com> References: <20231206081538.17056-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10-3.006200-8.000000 X-TMASE-MatchedRID: WVKpczY/zoTtAxjyNphE0new7fOv9rv4Kx5ICGp/WtF6unVYJJS8BvlY oV6p/cSxF8u8dQXnFzmAbmfpXu2gQmUlOh2o2oTOFYJUGv4DL3yt4laWdJbsDBL6MU7t349bW9o SzMAtdLLi8zVgXoAltsIJ+4gwXrEtwrbXMGDYqV+HuSUEBMGDjCgTieNKzl0v+c+7T33Au3DNuA ezS6+buStXMlZOFFSrjrE02BmFeIfvcrH62iIKGAXWfB7vcPOFv+VreHCTJr8xLORmmfnUyqMnT JRI0XInfXwUEm1ouDzLDYxFC1/7rjCBQDy1BJSc7ndUHUMmXu5+3BndfXUhXQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-3.006200-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 2E252DE02EC8D4257050ACF60994A700FF1332821D343220C9073F792B30A9112000:8 X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 06 Dec 2023 00:18:21 -0800 (PST) Initialize tee private data to support secure decoder. Release tee related information for each instance when decoder done. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 f47c98faf068..08e7d250487b 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 @@ -310,6 +310,9 @@ static int fops_vcodec_release(struct file *file) v4l2_fh_exit(&ctx->fh); v4l2_ctrl_handler_free(&ctx->ctrl_hdl); + if (ctx->is_secure_playback) + mtk_vcodec_dec_optee_release(dev->optee_private); + mtk_vcodec_dbgfs_remove(dev, ctx->id); list_del_init(&ctx->list); kfree(ctx); @@ -466,6 +469,11 @@ static int mtk_vcodec_probe(struct platform_device *pdev) atomic_set(&dev->dec_active_cnt, 0); memset(dev->vdec_racing_info, 0, sizeof(dev->vdec_racing_info)); mutex_init(&dev->dec_racing_info_mutex); + ret = mtk_vcodec_dec_optee_private_init(dev); + if (ret) { + dev_err(&pdev->dev, "Failed to init svp private."); + goto err_reg_cont; + } ret = video_register_device(vfd_dec, VFL_TYPE_VIDEO, -1); if (ret) { -- 2.18.0