Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp21756lql; Fri, 12 Apr 2024 02:16:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCNYPquYmkqMpyv8e9cUILqDjKNmZYVAYYyL7+vVXsRGLA6VEJbWtbcXPgQz1adIbPGfzYqTDOoZC+XYReP0bFlrqehp/6nVXRft7LLw== X-Google-Smtp-Source: AGHT+IFWzcqF6mRKP+s2VIeWZGk4Ph+Lxzgz7hj9kS1Sxk/HrNfxYKsMliogHbqVWVTaaO+7jRyJ X-Received: by 2002:a05:6a00:1312:b0:6ed:8798:3fa3 with SMTP id j18-20020a056a00131200b006ed87983fa3mr2543635pfu.15.1712913395691; Fri, 12 Apr 2024 02:16:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712913395; cv=pass; d=google.com; s=arc-20160816; b=QBIwmdzYS+kHVxINE1cBMDfMv84V4gGKnLFLRFZwm9OVjhu66gAp+zJGI/njrju+Vo Qd8VAGxzZSEGaKR/CrsqY7C54maA/PWtxW47rkvOklXC8N2e90dnvfy9/bl/W6gLIAD0 /XrsPEgh0s7RZU/nKFuON4rk0a30Q8bpgZgj6eamumO0FuLoM3YYiwT+JRHFY1uuPO/4 yCueZ3OBq4vo2PGMUw9uhxt/3nKpcmJk+TvcYtYFSzjsOe2xpGCPHhUMO805zt+CWMKc KnH6Z69A3Vt6042Vw2X9Z/xWbGtid3/YuRhSX1Doj2B3EZ54mEHLIR4r94Uhf9R962pL gR3Q== 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=kC7KzWLgDHvbqhzMWnc/8P0WK0I0J12Fa3NbbNqI088=; fh=+3keNzaSOvsaq+BXFM2IqKmKMiZV6QsxTCb//k4Cpek=; b=Uommx9VO7ciF/ZUM4vQeMITwQy75umWZlSanS1AthNv75qclC1Oi0mifqXYEmc0Bga HBPHCDN9T+I79D19OTdUNoB4N6v1DmYCRV8SmiMonUJT01QG8t2aU3ZAEiUAdWFfkxe+ PJAHpGGw6VElGk2yrpokFO5Q61b5gHSmRgeEFzDk36nv7Mg+hqFjRSYtI/TvQwCeyDcw NbtluRJKUSicibtm0b8dC26UlF18vUM8+Hf8Op1s6TWC/ZjlLQ+rYwcB0CIWs7HmAz7b UU9jIEJuJwz36WarquIjxompN1PnvKwh0yGZCgjf8NATMcaF0GYZQ6FwfU4CdMTWsA7u F4Cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=uiPyeirB; 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-142361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d8-20020a056a0010c800b006eae866a85csi3011358pfu.314.2024.04.12.02.16.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=uiPyeirB; 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-142361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142361-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3CE3F281703 for ; Fri, 12 Apr 2024 09:14:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 771055FBA5; Fri, 12 Apr 2024 09:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="uiPyeirB" 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 CC90B5D479; Fri, 12 Apr 2024 09:09:31 +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=1712912973; cv=none; b=Qd7pO4sYnp+ZwlAhaDg3BuBrzKb0ZjMsxeuxiYHKQXJZT7hWuaxJ9tDEonprdz+KCzBoJ9RoTvp37V2QgipdNNo663zom/99nCSLrM9XoGNQ8kP4+dynomQTUKbYFp6thEsil7indT4f94RmGThaSvA3alI7zPvRC/5SK4lvGaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912973; c=relaxed/simple; bh=huiD7USOrdWu9NopWmVGEcrOlYp+dwqjiEDlssjdViU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EUEV/sJ7tI42GERZ1Fg5RE0GJ6/vXr0KWBc04SKj7tkdIXuHXe9VxYTuGDah+L6L48/tjf3NPlRFSOT7s1AElY4c7VttUBbHBml1mVUISl8HQNqgKpF3sEQ0wrv3nIwlYiMKi1eDNipEeTSGJe8lF+IC6/upBgiAqNIRUVvEmZw= 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=uiPyeirB; 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: 5cbee334f8ac11ee935d6952f98a51a9-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=kC7KzWLgDHvbqhzMWnc/8P0WK0I0J12Fa3NbbNqI088=; b=uiPyeirBV9MMWk9FdZR0b85gMIBSdZj7uJP3YknQiqEtIF6oHthdIfn0FSFd/wRBOeXlbQqYwm3fEefOAPZa/mgBv5Tnmy9BbNPK3u90g6kt3Q49rX+QyV6aeNYAmm2/PdhuSpWXF1vNPyo7pMHb0PG1uvn5b+tXRjueYChb+6U=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:321e9226-0206-4f1a-8d6b-07be968a4bd1,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:6f543d0,CLOUDID:29b11986-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,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 5cbee334f8ac11ee935d6952f98a51a9-20240412 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1708905770; Fri, 12 Apr 2024 17:09:26 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) 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; Fri, 12 Apr 2024 17:09:24 +0800 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:23 +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,20/23] media: mediatek: vcodec: support tee decoder Date: Fri, 12 Apr 2024 17:08:48 +0800 Message-ID: <20240412090851.24999-21-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-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: 439J4N2hqK3tAxjyNphE0new7fOv9rv4Kx5ICGp/WtF6unVYJJS8BvlY oV6p/cSxF8u8dQXnFzmAbmfpXu2gQmUlOh2o2oTOFYJUGv4DL3yt4laWdJbsDBL6MU7t349bW9o SzMAtdLLi8zVgXoAltsIJ+4gwXrEtKsmEtKMlFWaCSGZ45wiWMD+l9qFvNOFWi6y5+Ht2uRhlFp ydEoZxnuarIFm4SaLFYc37HrwN5J7Q2ITqzvZEQZYVK3tXuzTS93H2AEVqLFaElVGWRzS6/kYFe h7KssddUGjjbmeia+IPZN5fBGmCHDkCyv2R+K5Wnqg/VrSZEiM= 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: 697B85813B9E2A3A1D9F7213A5D4B3AF90888A9B2409EF3FE7C2AD699B0A2B652000:8 X-MTK: N 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